% m211oh58.tex (prev.: og57) - Orthogonal Projection Examples
%
\newcommand{\titlesize}{28pt}  % for title 
\input{m211oh.tex}
%
\begin{titlepage}
\vspace*{-35pt}
\begin{center}\tcr{\rmH Orthogonal Projection Examples} \end{center} \vspace{-12pt}
\huge

\begin{description}  
\item[\tcr{Example 1:}] Find the \tcg{orthogonal projection} of \mc{\vec{y} = (2,3)} onto the line \mc{L = \lb (3,1)\rb}.

\item[\tcr{Solution:}] Let \mc{A = (3,1)^t}. By \tcr{Theorem 4.8}, the orthogonal projection is given by %\mc{P_V(\vec{y}) = A(A^tA)^{-1}A^t\vec{y}}. 
\begin{eqnarray*}
\tcb{P_V(\vec{y})} &\tcb{=}& \tcb{A(A^tA)^{-1}A^t\vec{y}} \\
 &\tcb{=}& \tcb{\left(\begin{array}{c} 3\\ 1 \end{array}\right)
  \left((3,1)\left(\begin{array}{c} 3\\ 1 \end{array}\right)\right)^{-1}
  \left((3,1) \left(\begin{array}{c} 2\\ 3 \end{array}\right)\right)} \\
 &\tcb{=}& \tcb{\left(\begin{array}{c} 3\\ 1 \end{array}\right)
  \left((10)\right)^{-1}
  \left(9\right)  = \frac{9}{10}\left(\begin{array}{c} 3\\ 1 \end{array}\right).}
\end{eqnarray*}

\item[\tcr{Example 2:}] Let \mc{V = \lb(1,0,1), (1,1,0)\rb}. 
Find the vector \mc{\vec{v} \in V}
which is \tcg{closest to}  \mc{\vec{y} = (1,2,3).} 

\item[\tcr{Solution:}] By \tcr{Theorem 4.7}, the desired vector is the \tcg{orthogonal projection} \mc{\vec{v} = P_V(\vec{y})}. Put \mc{A = (\vec{v}_1|\vec{v_2})}, where \mc{\vec{v}_1=(1,0,1)} and \mc{\vec{v}_2=(1,1,0).} 
Since the columns of \mc{A} are a \tcr{basis} of \mc{V}, \tcr{Theorem 4.8} tells us  that \mc{P_V(\vec{y}) = A(A^tA)^{-1}A^t\vec{y}.} Now
%\begin{eqnarray*}
$$
\tcb{A^tA  =  
  \left(\begin{array}{ccc} 1 & 0 & 1\\ 1 & 1 & 0 \end{array}\right)
  \left(\begin{array}{cc} 1 & 1 \\ 0 & 1 \\ 1 & 0 \end{array}\right)
= \left(\begin{array}{cc} 2 & 1 \\ 1 & 2  \end{array}\right),}
$$
and hence
$$
\tcb{(A^tA)^{-1} 
= \left(\begin{array}{cc} 2 & 1 \\ 1 & 2  \end{array}\right)^{-1}
= \frac{1}{3}\left(\begin{array}{rr} 2 & -1 \\ -1 & 2 \end{array}\right).}
$$
Moreover,
$$
\tcb{A^t\vec{y} = \left(\begin{array}{ccc} 1 & 0 & 1\\ 1 & 1 & 0 \end{array}\right)
\left(\begin{array}{c} 1  \\ 2 \\ 3 \end{array}\right)
= \left(\begin{array}{c} 4  \\  3 \end{array}\right).}
$$
Thus, the \tcr{closest vector} \mc{\vec{v} = P_V(\vec{y})} is given by
\begin{eqnarray*}
\tcb{P_V(\vec{y})} 
& \tcb{=} & \tcb{A(A^tA)^{-1}A^t\vec{y}} \\
& \tcb{=} & \tcb{\left(\begin{array}{cc} 1 & 1 \\ 0 & 1 \\ 1 & 0   \end{array}\right)
  \frac{1}{3}\left(\begin{array}{rr} 2 & -1 \\ -1 & 2  \end{array}\right)
  \left(\begin{array}{c} 4  \\  3 \end{array}\right)} \\
& \tcb{=} &  \tcb{\frac{1}{3} 
  \left(\begin{array}{cc} 1 & 1 \\ 0 & 1 \\ 1 & 0 \end{array}\right)
  \left(\begin{array}{c} 5  \\  2 \end{array}\right)} \\
& \tcb{=} & \tcb{\frac{1}{3} 
\left(\begin{array}{c} 7  \\  2 \\ 5 \end{array}\right).}
\end{eqnarray*}
\end{description}
\end{titlepage}
\end{document}                          