Skip to main content

Recitation 11A

Problem 1: Describe all least-squares solutions of the equation Ax=bAx=b, where A=[110110101101],b=[1382]A=\begin{bmatrix}1 & 1 & 0\\ 1 & 1 & 0\\ 1 & 0 & 1\\ 1 & 0 & 1\end{bmatrix}, b=\begin{bmatrix}1 \\ 3 \\ 8 \\ 2\end{bmatrix}.

Solution: All least-squares solutions of Ax=bAx=b is given by ATAx=ATbA^TAx=A^Tb. Note ATA=[422220202],ATb=[14410]A^TA=\begin{bmatrix}4 & 2 & 2 \\ 2 & 2 & 0 \\ 2 & 0 & 2\end{bmatrix}, A^Tb=\begin{bmatrix}14 \\ 4 \\ 10\end{bmatrix}. The solution of ATAx=ATbA^TAx=A^Tb is x1=5x3,x2=2x3,x3=x3x_1 = 5-x_3, x_2 = 2-x_3, x_3 = x_3, which also describes all least-squares solutions of Ax=bAx=b.

Problem 2: Find (a) the orthogonal projection of bb onto ColA\mathrm{Col}A and (b) a least-squares solution of Ax=bAx=b, where A=[153124],b=[423]A=\begin{bmatrix}1 & 5 \\ 3 & 1 \\ -2 & 4\end{bmatrix}, b=\begin{bmatrix}4\\-2\\-3\end{bmatrix}.

Solution: (a) Suppose the columns of AA are a1,a2a_1, a_2. The projection b^=ba1a1a1a1+ba2a2a2a2=27a1+17a2=\hat{b} = \frac{b\cdot a_1}{a_1\cdot a_1}a_1 + \frac{b\cdot a_2}{a_2\cdot a_2}a_2 = \frac{2}{7}a_1 + \frac{1}{7}a_2 =. (b) The least-square solution is given by the coefficients in the projection identity x^=[2/71/7]\hat{x}=\begin{bmatrix}2/7 \\ 1/7\end{bmatrix}.

Problem 3: Find (a) QR factorization of A=[125114143147121]A=\begin{bmatrix}1 & 2 & 5\\ -1 & 1 & -4 \\ -1 & 4 & -3\\ 1 & -4 & 7 \\ 1 & 2 & 1\end{bmatrix} and (b) a least-squares solution of Ax=bAx=b, where b=[72365]b=\begin{bmatrix}7\\2\\3\\6\\5\end{bmatrix}.

Solution: (a) Denote its column vectors by x1,x2,x3x_1, x_2, x_3. Using Gram-Schimidt, we get v1=x1=[11111]v_1 = x_1 = \begin{bmatrix}1 \\ -1 \\ -1 \\ 1 \\ 1\end{bmatrix}, v2=x2x2v1v1v1v1=[30333][10111]v_2 = x_2 - \frac{x_2\cdot v_1}{v_1\cdot v_1}v_1 = \begin{bmatrix}3 \\ 0 \\ 3 \\ -3 \\ 3\end{bmatrix}\sim \begin{bmatrix}1 \\ 0 \\ 1 \\ -1 \\ 1\end{bmatrix} and v3=x3x3v1v1v1v1x3v2v2v2v2=[20222][10111]v_3 = x_3 - \frac{x_3\cdot v_1}{v_1\cdot v_1}v_1 - \frac{x_3\cdot v_2}{v_2\cdot v_2}v_2 = \begin{bmatrix}2 \\ 0 \\ 2 \\ 2 \\ -2\end{bmatrix}\sim \begin{bmatrix}1 \\ 0 \\ 1 \\ 1 \\ -1\end{bmatrix}. Normalize v1,v2,v3v_1, v_2, v_3 and get v^1=v1/5\hat{v}_1 = v_1 / \sqrt{5}, v^2=v2/2\hat{v}_2 = v_2 / 2 and v^3=v3/2\hat{v}_3 = v_3 / 2. Therefore Q=[1/51/21/21/5001/51/21/21/51/21/21/51/21/2]Q=\begin{bmatrix}1/\sqrt{5} & 1/2 & 1/2 \\ -1/\sqrt{5} & 0 & 0 \\ -1/\sqrt{5} & 1/2 & 1/2 \\ 1/\sqrt{5} & -1/2 & 1/2 \\ 1/\sqrt{5} & 1/2 & -1/2\end{bmatrix} and R=QTA=[(5)(5)5(5)062004]R = Q^TA = \begin{bmatrix}\sqrt(5) & \sqrt(5) & 5\sqrt(5) \\ 0 & 6 & -2 \\ 0 & 0 & 4\end{bmatrix}. (b) The least-squares solution of Ax=bAx=b is given by Rx^=QTb=[13/59/211/2]R\hat{x}=Q^Tb=\begin{bmatrix}13/\sqrt{5} \\ 9/2 \\ 11/2\end{bmatrix}. By back substitution, we obtain x^=[203/12029/2411/8]\hat{x}=\begin{bmatrix}-203 / 120 \\ 29/24 \\ 11/8\end{bmatrix}.