\documentclass[twoside]{article}

\usepackage{palatino}
\usepackage{camnum}
%\renewcommand{\arraystretch}{1.5}

\textheight=22.5cm
\textwidth=15cm
\topmargin=-1cm
\oddsidemargin=0.5cm
\evensidemargin=0.5cm
\parindent=0pt
\parskip=6pt

\begin{document}
\begin{center}
  {\large \textbf{Mathematical Tripos Part IB: Easter 2001}}

  {\Large \textbf{Numerical Analysis -- Detailed Example
      4a\footnote{Corrections and suggestions to these notes should
        be emailed to \texttt{a.shadrin@damtp.cam.ac.uk}. All handouts
        are available on the WWW at the URL 
        \texttt{http://www.damtp.cam.ac.uk/user/na/PartIB/Handouts.html}.}}}

  \vspace{8pt}
  \textbf{\textit{\LARGE QR factorization: Gram--Schmidt}}
\end{center}

Let
\begin{displaymath}
   A = [\MM{a}_1,\MM{a}_2,\MM{a}_3],\quad
   \MM{a}_1
 = \left[\begin{array}{r} 2\\1\\2 \end{array}\right],\qquad 
   \MM{a}_2
 = \left[\begin{array}{r} 4\\-1\\1 \end{array}\right],\qquad 
   \MM{a}_3
 = \left[\begin{array}{r} 5\\1\\-1 \end{array}\right].
\end{displaymath}
Then
$$
\begin{array}{llll}
   \MM{b}_1=\MM{a}_1
& = \left[\begin{array}{r} \phantom{-}2\\1\\2 \end{array}\right]
& = \left[\begin{array}{r} \phantom{-}2\\1\\2 \end{array}\right],\quad
   \underbrace{\|\MM{b}_1\|}_{r_{11}}=3,\\[4ex]
   \MM{q}_1
 = \frac{\MM{b}_1}{\|\MM{b}_1\|}
 = \frac13 
   \left[ \begin{array}{r} \phantom{-}2\\1\\2 \end{array}\right],\\[4ex]
%
   \MM{b}_2=\MM{a}_2-\underbrace{(\MM{q}_1^{\CC{T}}\MM{a}_2)}_{r_{12}}\MM{q}_1
& = \left[\begin{array}{r} 4\\-1\\1 \end{array}\right]
   -3\cdot\frac13 
   \left[\begin{array}{r} 2\\1\\2 \end{array}\right]
& = \left[\begin{array}{r} 2\\-2\\-1 \end{array}\right],\quad
   \underbrace{\|\MM{b}_2\|}_{r_{22}}=3, \\[4ex]
   \MM{q}_2
 = \frac{\MM{b}_2}{\|\MM{b}_2\|} 
 = \frac{1}{3}
   \left[\begin{array}{r} 2\\-2\\-1 \end{array}\right],\\[4ex]
%
   \MM{b}_3
 = \MM{a}_3 
   - \underbrace{(\MM{q}_1^{\CC{T}}\MM{a}_3)}_{r_{13}} \MM{q}_1
   - \underbrace{(\MM{q}_2^{\CC{T}}\MM{a}_3)}_{r_{23}} \MM{q}_2 
& = \left[\begin{array}{r} 5\\1\\-1 \end{array}\right]
   - 3\cdot \frac13 \left[ \begin{array}{r} 2\\ 1\\ 2 \end{array}\right]
   - 3\cdot \frac13 \left[ \begin{array}{r} 2\\-2\\-1 \end{array}\right]
& = \left[\begin{array}{r} 1\\2\\-2 \end{array}\right],\quad
   \underbrace{\|\MM{b}_3\|}_{r_{33}}=3,\\[4ex]
     \MM{q}_3
 = \frac{\MM{b}_3}{\|\MM{b}_3\|}
 = \frac{1}{3}
   \left[\begin{array}{r} 1\\2\\-2 \end{array}\right].
\end{array}
$$
Therefore 
$$
 A = QR, \quad 
   Q  
 = [\MM{q}_1,\MM{q}_2,\MM{q}_3]
 =  \frac{1}{3}
    \left[\begin{array}{rrrr}
      2 &  2 &  1 \\
      1 & -2 &  2 \\
      2 & -1 & -2 \\
    \end{array}\right], \quad 
   R
 = \left[\begin{array}{rrr}
      3 & 3 & 3 \\
      0 & 3 & 3 \\
      0 & 0 & 3 
    \end{array}\right].
$$



\end{document}
%%% Local Variables: 
%%% mode: latex
%%% TeX-master: t
%%% End: 
