4(a)
Note that
\[\begin{split}
\begin{array}{ll}
X^{T} y &=\left(\begin{array}{cc}
1 & 15 \\
1 & 20 \\
1 & 5 \\
1 & 16 \\
1 & 1
\end{array}\right)^{T}\left(\begin{array}{l}
6 \\
4 \\
7 \\
5 \\
9
\end{array}\right) \\
& =\left(\begin{array}{ccccc}
1 & 1 & 1 & 1 & 1 \\
15 & 20 & 5 & 16 & 1
\end{array}\right)\left(\begin{array}{l}
6 \\
4 \\
7 \\
5 \\
9
\end{array}\right) \\
& =\left(\begin{array}{c}
(1)(6)+(1)(4)+(1)(7)+(1)(5)+(1)(9) \\
(15)(6)+(20)(4)+(5)(7)+(16)(5)+(1)(9)
\end{array}\right) \\
& =\left(\begin{array}{c}
6+4+7+5+9 \\
90+80+35+80+9
\end{array}\right) \\
& =\left(\begin{array}{c}
31 \\
294
\end{array}\right) \text {. }
\end{array}
\end{split}\]
4(b)
Note that
\[\begin{split}
\begin{array}{ll}
X^{T} X & =\left(\begin{array}{cc}
1 & 15 \\
1 & 20 \\
1 & 5 \\
1 & 16 \\
1 & 1
\end{array}\right)^{T}\left(\begin{array}{cc}
1 & 15 \\
1 & 20 \\
1 & 5 \\
1 & 16 \\
1 & 1
\end{array}\right) \\
& =\left(\begin{array}{ccccc}
1 & 1 & 1 & 1 & 1 \\
15 & 20 & 5 & 16 & 1
\end{array}\right)\left(\begin{array}{cc}
1 & 15 \\
1 & 20 \\
1 & 5 \\
1 & 16 \\
1 & 1
\end{array}\right) \\
& =\left(\begin{array}{ll}
a_{11} & a_{12} \\
a_{21} & a_{22}
\end{array}\right) .
\end{array}
\end{split}\]
We have
\[\begin{split}
\begin{array}{ll}
a_{11} & =(1)(1)+(1)(1)+(1)(1)+(1)(1)+(1)(1) \\
& =1+1+1+1+1 \\
& =5, \\ \\
a_{12} & =(1)(15)+(1)(20)+(1)(5)+(1)(16)+(1)(1) \\
& =15+20+5+16+1 \\
& =57, \\ \\
a_{21} & =(15)(1)+(20)(1)+(5)(1)+(16)(1)+(1)(1) \\
& =15+20+5+16+1 \\
& =57, \\ \\
a_{22} & =(15)(15)+(20)(20)+(5)(5)+(16)(16)+(1)(1) \\
& =225+400+25+256+1 \\
& =907
\end{array}
\end{split}\]
This means that
\[\begin{split}
X^{T} X=\left(\begin{array}{cc}
5 & 57 \\
57 & 907
\end{array}\right)
\end{split}\]
4(c)
Note that
\[\begin{split}
\begin{array}{ll}
\left(X^{T} X\right)^{-1} X^{T} y & =\left(\begin{array}{cc}
\frac{4,535}{6,430} & \frac{-57}{1,286} \\
\frac{-57}{1,286} & \frac{5}{1,286}
\end{array}\right)\left(\begin{array}{c}
31 \\
294
\end{array}\right) \\
& =\left(\begin{array}{l}
\left(\frac{4,435}{6,430}\right)(31)+\left(\frac{-57}{1,286}\right)(294) \\
\left(\frac{-57}{1,286}\right)(31)+\left(\frac{5}{1,286}\right)(294)
\end{array}\right) \\
& =\left(\left(\begin{array}{c}
\left.\frac{907}{1,286}\right)(31)+\left(\frac{-57}{1,286}\right)(294) \\
\left(\frac{-57}{1,286}\right)(31)+\left(\frac{5}{1,286}\right)(294)
\end{array}\right)\right. \\
& =\left(\begin{array}{c}
\frac{28,117}{1,286}-\frac{16,758}{1,286} \\
\frac{-1,767}{1,286}+\frac{1,470}{1,286}
\end{array}\right) \\
& =\left(\begin{array}{c}
\frac{11,359}{1,286} \\
\frac{-297}{1,286}
\end{array}\right) .
\end{array}
\end{split}\]
4(d)
Note that
\[\begin{split}
\begin{array}{ll}
P & =X\left(X^{T} X\right)^{-1} X^{T} \\
& =X\left[\left(X^{T} X\right)^{-1} X^{T}\right] .
\end{array}
\end{split}\]
We have
\[\begin{split}
\begin{array}{ll}
& \left(X^{T} X\right)^{-1} X^{T}=\left(\begin{array}{cc}
\frac{4,535}{6,430} & \frac{-57}{1,286} \\
\frac{-57}{1,286} & \frac{5}{1,286}
\end{array}\right)\left(\begin{array}{cc}
1 & 15 \\
1 & 20 \\
1 & 5 \\
1 & 16 \\
1 & 1
\end{array}\right)^{T} \\
& =\left(\begin{array}{ll}
\frac{4,535}{6,430} & \frac{-57}{1,286} \\
\frac{-57}{1,286} & \frac{5}{1,286}
\end{array}\right)\left(\begin{array}{ccccc}
1 & 1 & 1 & 1 & 1 \\
15 & 20 & 5 & 16 & 1
\end{array}\right) \\
& =\left(\begin{array}{lllll}
b_{11} & b_{12} & b_{13} & b_{14} & b_{15} \\
b_{21} & b_{22} & b_{23} & b_{24} & b_{25}
\end{array}\right) .
\end{array}
\end{split}\]
The elements of this matrix are
\[\begin{split}
\begin{array}{ll}
b_{11} & =\left(\frac{4,535}{6,430}\right)(1)+\left(\frac{-57}{1,286}\right) (15)\\
& =\frac{907}{1,286}-\frac{855}{1,286} \\
& =\frac{52}{1,286}, \\ \\
b_{12} & =\left(\frac{4,535}{6,430}\right)(1)+\left(\frac{-57}{1,286}\right) (20)\\
& =\frac{907}{1,286}-\frac{1,140}{1,286} \\
& =\frac{-233}{1,286}, \\ \\
b_{13} & =\left(\frac{4,535}{6,430}\right)(1)+\left(\frac{-57}{1,286}\right) (5)\\
& =\frac{907}{1,286}-\frac{285}{1,286} \\
& =\frac{622}{1,286},\\ \\
b_{14}&=\left(\frac{4,535}{6,430}\right)(1)+\left(\frac{-57}{1,286}\right)(16) \\
& =\frac{907}{1,286}-\frac{912}{1,286} \\
& =\frac{-5}{1,286}, \\ \\
b_{15}&=\left(\frac{4,535}{6,430}\right)(1)+\left(\frac{-57}{1,286}\right)(1) \\
& =\frac{907}{1,286}-\frac{57}{1,286} \\
& =\frac{850}{1,286} \\ \\
b_{21}&=\left(\frac{-57}{1,286}\right)(1)+\left(\frac{5}{1,286}\right)(15) \\
& =\frac{-57}{1,286}+\frac{75}{1,286} \\
& =\frac{18}{1,286}, \\ \\
b_{22}&=\left(\frac{-57}{1,286}\right)(1)+\left(\frac{5}{1,286}\right)(20) \\
& =\frac{-57}{1,286}+\frac{100}{1,286} \\
& =\frac{43}{1,286}, \\ \\
b_{23}&=\left(\frac{-57}{1,286}\right)(1)+\left(\frac{5}{1,286}\right)(5) \\
& =\frac{-57}{1,286}+\frac{25}{1,286} \\
& =\frac{-32}{1,286}, \\ \\
b_{24}&=\left(\frac{-57}{1,286}\right)(1)+\left(\frac{5}{1,286}\right)(16) \\
& =\frac{-57}{1,286}+\frac{80}{1,286} \\
& =\frac{23}{1,286}, \\ \\
b_{25} & =\left(\frac{-57}{1,286}\right)(1)+\left(\frac{5}{1,286}\right)(1)\\
& =\frac{-57}{1,286}+\frac{5}{1,286} \\
& =\frac{-52}{1,286} .
\end{array}
\end{split}\]
This means that
\[\begin{split}
\left(X^{T} X\right)^{-1} X^{T}=\left(\begin{array}{lllll}
\frac{52}{1,286} & \frac{-233}{1,286} & \frac{622}{1,286} & \frac{-5}{1,286} & \frac{850}{1,286} \\
\frac{18}{1,286} & \frac{43}{1,286} & \frac{-32}{1,286} & \frac{23}{1,286} & \frac{-52}{1,286}
\end{array}\right)
\end{split}\]
Thus we have
\[\begin{split}
\begin{array}{ll}
P & =X\left(X^{T} X\right)^{-1} X^{T} \\
& =X\left[\left(X^{T} X\right)^{-1} X^{T}\right] \\
& =\left(\begin{array}{cc}
1 & 15 \\
1 & 20 \\
1 & 5 \\
1 & 16 \\
1 & 1
\end{array}\right)\left(\begin{array}{ccccc}
\frac{52}{1,286} & \frac{-233}{1,286} & \frac{622}{1,286} & \frac{-5}{1,286} & \frac{850}{1,286} \\
\frac{18}{1,286} & \frac{43}{1,286} & \frac{-32}{1,286} & \frac{23}{1,286} & \frac{-52}{1,286}
\end{array}\right) \\
& =\left(\begin{array}{ccccc}
c_{11} & c_{12} & c_{13} & c_{14} & c_{15} \\
c_{21} & c_{22} & c_{23} & c_{24} & c_{25} \\
c_{31} & c_{32} & c_{33} & c_{34} & c_{35} \\
c_{41} & c_{42} & c_{43} & c_{44} & c_{45} \\
c_{51} & c_{52} & c_{53} & c_{54} & c_{55}
\end{array}\right) .
\end{array}
\end{split}\]
The elements of this matrix are
\[\begin{split}
\begin{array}{ll}
c_{11} & =(1)\left(\frac{52}{1,286}\right)+(15)\left(\frac{18}{1,286}\right) \\
& =\frac{52}{1,286}+\frac{270}{1,286} \\
& =\frac{322}{1,286}, \\
c_{12} & =(1)\left(\frac{-233}{1,286}\right)+(15)\left(\frac{43}{1,286}\right) \\
& =\frac{-233}{1,286}+\frac{645}{1,286} \\
& =\frac{412}{1,286}, \\ \\
c_{13} &=(1)\left(\frac{622}{1,286}\right)+(15)\left(\frac{-32}{1,286}\right) \\
& =\frac{622}{1,286}-\frac{480}{1,286} \\
& =\frac{142}{1,286}, \\ \\
c_{14}&=(1)\left(\frac{-5}{1,286}\right)+(15)\left(\frac{23}{1,286}\right) \\
& =\frac{-5}{1,286}+\frac{345}{1,286} \\
& =\frac{340}{1,286}, \\ \\
c_{15}&=(1)\left(\frac{850}{1,286}\right)+(15)\left(\frac{-52}{1,286}\right) \\
& =\frac{850}{1,286}-\frac{780}{1,286} \\
& =\frac{70}{1,286}, \\ \\
c_{21}&=(1)\left(\frac{52}{1,286}\right)+(20)\left(\frac{18}{1,286}\right) \\
& =\frac{52}{1,286}+\frac{360}{1,286} \\
& =\frac{412}{1,286}, \\ \\
c_{22}&=(1)\left(\frac{-233}{1,286}\right)+(20)\left(\frac{43}{1,286}\right) \\
& =\frac{-233}{1,286}+\frac{860}{1,286} \\
& =\frac{627}{1,286}, \\ \\
c_{23}&=(1)\left(\frac{622}{1,286}\right)+(20)\left(\frac{-32}{1,286}\right) \\
& =\frac{622}{1,286}-\frac{640}{1,286} \\
& =\frac{-18}{1,286}, \\ \\
c_{24}&=(1)\left(\frac{-5}{1,286}\right)+(20)\left(\frac{23}{1,286}\right) \\
& =\frac{-5}{1,286}+\frac{460}{1,286} \\
& =\frac{455}{1,286}, \\ \\
c_{25}&=(1)\left(\frac{850}{1,286}\right)+(20)\left(\frac{-52}{1,286}\right) \\
& =\frac{850}{1,286}-\frac{1,040}{1,286} \\
& =\frac{-190}{1,286}, \\ \\
c_{31}&=(1)\left(\frac{52}{1,286}\right)+(5)\left(\frac{18}{1,286}\right) \\
& =\frac{52}{1,286}+\frac{90}{1,286} \\
& =\frac{142}{1,286}, \\ \\
c_{32}&=(1)\left(\frac{-233}{1,286}\right)+(5)\left(\frac{43}{1,286}\right) \\
& =\frac{-233}{1,286}+\frac{215}{1,286} \\
& =\frac{-18}{1,286} \\ \\
c_{33}&=(1)\left(\frac{622}{1,286}\right)+(5)\left(\frac{-32}{1,286}\right) \\
& =\frac{622}{1,286}-\frac{160}{1,286} \\
& =\frac{462}{1,286}, \\ \\
c_{34}&=(1)\left(\frac{-5}{1,286}\right)+(5)\left(\frac{23}{1,286}\right) \\
& =\frac{-5}{1,286}+\frac{115}{1,286} \\
& =\frac{110}{1,286}, \\ \\
c_{35}&=(1)\left(\frac{850}{1,286}\right)+(5)\left(\frac{-52}{1,286}\right) \\
&=\frac{850}{1,286}-\frac{260}{1,286} \\
&=\frac{590}{1,286}, \\ \\
c_{41} &=(1)\left(\frac{52}{1,286}\right)+(16)\left(\frac{18}{1,286}\right) \\
&=\frac{52}{1,286}+\frac{288}{1,286} \\
&=\frac{340}{1,286}, \\ \\
c_{42} &=(1)\left(\frac{-233}{1,286}\right) + (16)\left(\frac{43}{1,286}\right) \\
&=\frac{-233}{1,286}+\frac{688}{1,286} \\
&=\frac{455}{1,286}, \\ \\
c_{43} &= (1)\left(\frac{622}{1,286} \right) + (16)\left(\frac{-32}{1,286}\right) \\
&= \frac{622}{1,286}-\frac{512}{1,286} \\
&= \frac{110}{1,286}, \\ \\
c_{44} &= (1) \left(\frac{-5}{1,286}\right) + (16) \left(\frac{25}{1,286}\right) \\
&= \frac{-5}{1,286} + \frac{368}{1,286} \\
&=\frac{363}{1,286}, \\ \\
c_{45} &=(1)\left(\frac{850}{1,286}\right)+(16)\left(\frac{-52}{1,286}\right) \\
&= \frac{850}{1,286} - \frac{832}{1,286} \\
&= \frac{18}{1,286}, \\ \\
c_{51} & =(1)\left(\frac{52}{1,286}\right)+(1)\left(\frac{18}{1,286}\right) \\
& =\frac{52}{1,286}+\frac{18}{1,286} \\
& =\frac{70}{1,286}, \\ \\
c_{52} & =(1)\left(\frac{-233}{1,286}\right)+(1)\left(\frac{43}{1,286}\right) \\
& =\frac{-233}{1,286}+\frac{43}{1,286} \\
& =\frac{-190}{1,286}, \\ \\
c_{53} & =(1)\left(\frac{622}{1,286}\right)+(1)\left(\frac{-32}{1,286}\right) \\
& =\frac{622}{1,286}-\frac{32}{1,286} \\
& =\frac{590}{1,286}, \\ \\
c_{54} & =(1)\left(\frac{-5}{1,286}\right)+(1)\left(\frac{23}{1,286}\right) \\
& =\frac{-5}{1,286}+\frac{23}{1,286} \\
& =\frac{18}{1,286}, \\ \\
c_{55} & =(1)\left(\frac{850}{1,286}\right)+(1)\left(\frac{-52}{1,286}\right) \\
& =\frac{850}{1,286}-\frac{52}{1,286} \\
& =\frac{798}{1,286} .
\end{array}
\end{split}\]
As such, the hat matrix is given by
\[\begin{split}
P=\left(\begin{array}{ccccc}
\frac{322}{1,286} & \frac{412}{1,286} & \frac{142}{1,286} & \frac{340}{1,286} & \frac{70}{1,286} \\
\frac{412}{1,286} & \frac{627}{1,286} & \frac{-18}{1,286} & \frac{455}{1,286} & \frac{-190}{1,286} \\
\frac{142}{1,286} & \frac{-18}{1,286} & \frac{462}{1,286} & \frac{110}{1,286} & \frac{590}{1,286} \\
\frac{340}{1,286} & \frac{455}{1,286} & \frac{110}{1,286} & \frac{363}{1,286} & \frac{18}{1,286} \\
\frac{70}{1,286} & \frac{-190}{1,286} & \frac{590}{1,286} & \frac{18}{1,286} & \frac{798}{1,286}
\end{array}\right) .
\end{split}\]
4(e)
Note that
\[\begin{split}
\begin{aligned}
P^{T} & =\left(\begin{array}{ccccc}
\frac{322}{1,286} & \frac{412}{1,286} & \frac{142}{1,286} & \frac{340}{1,286} & \frac{70}{1,286} \\
\frac{412}{1,286} & \frac{627}{1,286} & \frac{-18}{1,286} & \frac{455}{1,286} & \frac{-190}{1,286} \\
\frac{142}{1,286} & \frac{-18}{1,286} & \frac{462}{1,286} & \frac{110}{1,286} & \frac{590}{1,286} \\
\frac{340}{1,286} & \frac{455}{1,286} & \frac{110}{1,286} & \frac{363}{1,286} & \frac{18}{1,286} \\
\frac{70}{1,286} & \frac{-190}{1,286} & \frac{590}{1,286} & \frac{18}{1,286} & \frac{798}{1,286}
\end{array}\right)^{T} \\
& =\left(\begin{array}{ccccc}
\frac{322}{1,286} & \frac{412}{1,286} & \frac{142}{1,286} & \frac{340}{1,286} & \frac{70}{1,286} \\
\frac{412}{1,286} & \frac{627}{1,286} & \frac{-18}{1,286} & \frac{455}{1,286} & \frac{-190}{1,286} \\
\frac{142}{1,286} & \frac{-18}{1,286} & \frac{462}{1,286} & \frac{110}{1,286} & \frac{590}{1,286} \\
\frac{340}{1,286} & \frac{455}{1,286} & \frac{110}{1,286} & \frac{363}{1,286} & \frac{18}{1,286} \\
\frac{70}{1,286} & \frac{-190}{1,286} & \frac{590}{1,286} & \frac{18}{1,286} & \frac{798}{1,286}
\end{array}\right) \\
& =P .
\end{aligned}
\end{split}\]
Thus we can conclude that the hat matrix is symmetric.
4(f)
Note that
\[\begin{split}
\begin{array}{ll}
PP &= \left(\begin{array}{ccccc}
\frac{322}{1,286} & \frac{412}{1,286} & \frac{142}{1,286} & \frac{340}{1,286} & \frac{70}{1,286} \\
\frac{412}{1,286} & \frac{627}{1,286} & \frac{-18}{1,286} & \frac{455}{1,286} & \frac{-190}{1,286} \\
\frac{142}{1,286} & \frac{-18}{1,286} & \frac{462}{1,286} & \frac{110}{1,286} & \frac{590}{1,286} \\
\frac{340}{1,286} & \frac{455}{1,286} & \frac{110}{1,286} & \frac{363}{1,286} & \frac{18}{1,286} \\
\frac{70}{1,286} & \frac{-190}{1,286} & \frac{590}{1,286} & \frac{18}{1,286} & \frac{798}{1,286}
\end{array}\right)
\left(\begin{array}{ccccc}
\frac{322}{1,286} & \frac{412}{1,286} & \frac{142}{1,286} & \frac{340}{1,286} & \frac{70}{1,286} \\
\frac{412}{1,286} & \frac{627}{1,286} & \frac{-18}{1,286} & \frac{455}{1,286} & \frac{-190}{1,286} \\
\frac{142}{1,286} & \frac{-18}{1,286} & \frac{462}{1,286} & \frac{110}{1,286} & \frac{590}{1,286} \\
\frac{340}{1,286} & \frac{455}{1,286} & \frac{110}{1,286} & \frac{363}{1,286} & \frac{18}{1,286} \\
\frac{70}{1,286} & \frac{-190}{1,286} & \frac{590}{1,286} & \frac{18}{1,286} & \frac{798}{1,286}
\end{array}\right) \\
& =\left[\left(\frac{1}{1,286}\right)\left(\begin{array}{ccccc}
322 & 412 & 142 & 340 & 70 \\
412 & 627 & -18 & 455 & -190 \\
142 & -18 & 462 & 110 & 590 \\
340 & 455 & 110 & 363 & 18 \\
70 & -190 & 590 & 18 & 798
\end{array}\right)\right] \bullet
{\left[\left(\frac{1}{1,286}\right)\left(\begin{array}{ccccc}
322 & 412 & 142 & 340 & 70 \\
412 & 627 & -18 & 455 & -190 \\
142 & -18 & 462 & 110 & 590 \\
340 & 455 & 110 & 363 & 18 \\
70 & -190 & 590 & 18 & 798
\end{array}\right)\right]} \\
& =\left(\frac{1}{1,286}\right)^{2}\left(\begin{array}{ccccc}
322 & 412 & 142 & 340 & 70 \\
412 & 627 & -18 & 455 & -190 \\
142 & -18 & 462 & 110 & 590 \\
340 & 455 & 110 & 363 & 18 \\
70 & -190 & 590 & 18 & 798
\end{array}\right) \bullet
\left(\begin{array}{ccccc}
322 & 412 & 142 & 340 & 70 \\
412 & 627 & -18 & 455 & -190 \\
142 & -18 & 462 & 110 & 590 \\
340 & 455 & 110 & 363 & 18 \\
70 & -190 & 590 & 18 & 798
\end{array}\right) \\
& =\left(\frac{1}{1,653,796}\right)\left(\begin{array}{ccccc}
322 & 412 & 142 & 340 & 70 \\
412 & 627 & -18 & 455 & -190 \\
142 & -18 & 462 & 110 & 590 \\
340 & 455 & 110 & 363 & 18 \\
70 & -190 & 590 & 18 & 798
\end{array}\right) \bullet \left(\begin{array}{ccccc}
322 & 412 & 142 & 340 & 70 \\
412 & 627 & -18 & 455 & -190 \\
142 & -18 & 462 & 110 & 590 \\
340 & 455 & 110 & 363 & 18 \\
70 & -190 & 590 & 18 & 798
\end{array}\right) .
\end{array}
\end{split}\]
We have
\[\begin{split}
\begin{array}{ll}
& \left(\begin{array}{ccccc}
322 & 412 & 142 & 340 & 70 \\
412 & 627 & -18 & 455 & -190 \\
142 & -18 & 462 & 110 & 590 \\
340 & 455 & 110 & 363 & 18 \\
70 & -190 & 590 & 18 & 798
\end{array}\right)\left(\begin{array}{cccccc}
322 & 412 & 142 & 340 & 70 \\
412 & 627 & -18 & 455 & -190 \\
142 & -18 & 462 & 110 & 590 \\
340 & 455 & 110 & 363 & 18 \\
70 & -190 & 590 & 18 & 798
\end{array}\right) \\
& = \left(\begin{array}{lllll}
d_{11} & d_{12} & d_{13} & d_{14} & d_{15} \\
d_{21} & d_{22} & d_{23} & d_{24} & d_{25} \\
d_{31} & d_{32} & d_{33} & d_{34} & d_{35} \\
d_{41} & d_{42} & d_{43} & d_{44} & d_{45} \\
d_{51} & d_{52} & d_{53} & d_{54} & d_{55}
\end{array}\right),
\end{array}
\end{split}\]
where
\[\begin{split}
\begin{array}{ll}
d_{11} & =(322)(322)+(412)(412)+(142)(142)+(340)(340)+(70)(70) \\
& =103,684+169,744+20,164+115,600+4,900 \\
& =414,092 \\ \\
d_{12} & =(322)(412)+(412)(627)+(142)(-18)+(340)(455)+(70)(-190) \\
& =132,664+258,324-2,556+154,700-13,300 \\
& =529,832, \\ \\
d_{13} & =(322)(142)+(412)(-18)+(142)(462)+(340)(110)+(70)(590) \\
& =45,724-7,416+65,604+37,400+41,300 \\
& =182,612, \\ \\
d_{14} & =(322)(340)+(412)(455)+(142)(110)+(340)(363)+(70)(18) \\
& =109,480+187,460+15,620+123,420+1,260 \\
& =437,240, \\ \\
d_{15} & =(322)(70)+(412)(-190)+(142)(590)+(340)(18)+(70)(798) \\
& =22,540-78,280+83,780+6,120+55,860 \\
& =90,020, \\ \\
d_{21} & =(412)(322)+(627)(412)+(-18)(142)+(455)(340)+(-190)(70) \\
& =132,664+258,324-2,556+154,700-13,300 \\
& =529,832, \\ \\
d_{22} &= (412)(412)+(627)(627)+(-18)(-18)+(455)(455)+(-190)(-190) \\
& =169,744+393,129+324+207,025+36,100 \\
& =806,322 \\ \\
d_{23} &=(412)(142)+(627)(-18)+(-18)(462)+(455)(110)+(-190)(590) \\
& =58,504-11,286-8,316+50,050-112,100 \\
& =-23,148, \\ \\
d_{24}&=(412)(340)+(627)(455)+(-18)(110)+(455)(363)+(-190)(18) \\
& =140,080+285,285-1,980+165,165-3,420 \\
& =585,130 \\ \\
d_{25}&=(412)(70)+(627)(-190)+(-18)(590)+(455)(18)+(-190)(798) \\
& =28,840-119,130-10,620+8,190-151,620 \\
& =-244,340, \\ \\
d_{31}&=(142)(322)+(-18)(412)+(462)(142)+(110)(340)+(590)(70) \\
& =45,724-7,416+65,604+37,400+41,300 \\
& =182,612, \\ \\
d_{32}&=(142)(412)+(-18)(627)+(462)(-18)+(110)(455)+(590)(-190) \\
& =58,504-11,286-8,316+50,050-112,100 \\
& =-23,148, \\ \\
d_{33}&=(142)(142)+(-18)(-18)+(462)(462)+(110)(110)+(590)(590) \\
& =20,164+324+213,444+12,100+348,100 \\
& =594,132, \\ \\
d_{34}&=(142)(340)+(-18)(455)+(462)(110)+(110)(363)+(590)(18) \\
& =48,280-8,190+50,820+39,930+10,620 \\
& =141,460, \\ \\
d_{35}&=(142)(70)+(-18)(-190)+(462)(590)+(110)(18)+(590)(798) \\
& =9,940+3,420+272,580+1,980+470,820 \\
& =758,740, \\ \\
d_{41} &=(340)(322)+(455)(412)+(110)(142)+(363)(340)+(18)(70) \\
& =109,480+187,460+15,620+123,420+1,260 \\
& =437,240 \\ \\
d_{42}&=(340)(412)+(455)(627)+(110)(-18)+(363)(455)+(18)(-190) \\
& =140,080+285,285-1,980+165,165-3,420 \\
& =585,130, \\ \\
d_{43}&=(340)(142)+(455)(-18)+(110)(462)+(363)(110)+(18)(590) \\
& =48,280-8,190+50,820+39,930+10,620 \\
& =141,460, \\ \\
d_{44}&=(340)(340)+(455)(455)+(110)(110)+(363)(363)+(18)(18) \\
& =115,600+207,025+12,100+131,769+324 \\
& =466,818 \\ \\
d_{45}&=(340)(70)+(455)(-190)+(110)(590)+(363)(18)+(18)(798) \\
& =23,800-86,450+64,900+6,534+14,364 \\
& =23,148 \\ \\
d_{51}&=(70)(322)+(-190)(412)+(590)(142)+(18)(340)+(798)(70) \\
& =22,540-78,280+83,780+6,120+55,860 \\
& =90,020 \\ \\
d_{52}&=(70)(412)+(-190)(627)+(590)(-18)+(18)(455)+(798)(-190) \\
& =28,840-119,130-10,620+8,190-151,620 \\
& =-244,340, \\ \\
d_{53}&=(70)(142)+(-190)(-18)+(590)(462)+(18)(110)+(798)(590) \\
& =9,940+3,420+272,580+1,980+470,820 \\
& =758,740, \\ \\
d_{54}&=(70)(340)+(-190)(455)+(590)(110)+(18)(363)+(798)(18) \\
& =23,800-86,450+64,900+6,534+14,364 \\
& =23,148, \\ \\
d_{55} & =(70)(70)+(-190)(-190)+(590)(590)+(18)(18)+(798)(798) \\
& =4,900+36,100+348,100+324+636,804 \\
& =1,026,228 .
\end{array}
\end{split}\]
This means that
\[\begin{split}
\begin{array}{ll}
& \left(\begin{array}{ccccc}
322 & 412 & 142 & 340 & 70 \\
412 & 627 & -18 & 455 & -190 \\
142 & -18 & 462 & 110 & 590 \\
340 & 455 & 110 & 363 & 118 \\
70 & -190 & 590 & 18 & 798
\end{array}\right)\left(\begin{array}{ccccc}
322 & 412 & 142 & 340 & 70 \\
412 & 627 & -18 & 455 & -190 \\
142 & -18 & 462 & 110 & 590 \\
340 & 455 & 110 & 363 & 118 \\
70 & -190 & 590 & 18 & 798
\end{array}\right) \\
= & \left(\begin{array}{ccccc}
414,092 & 529,832 & 182,612 & 437,240 & 90,020 \\
529,832 & 806,322 & -23,148 & 585,130 & -244,340 \\
182,612 & -23,148 & 594,132 & 141,460 & 758,740 \\
437,240 & 585,130 & 141,460 & 466,818 & 23,148 \\
90,020 & -244,340 & 758,740 & 23,148 & 1,026,228
\end{array}\right) .
\end{array}
\end{split}\]
As such, we know that
\[\begin{split}
\begin{array}{ll}
& P P=\left(\frac{1}{1,653,796}\right)\left(\begin{array}{ccccc}
414,092 & 529,832 & 182,612 & 437,240 & 90,020 \\
529,832 & 806,322 & -23,148 & 585,130 & -244,340 \\
182,612 & -23,148 & 594,132 & 141,460 & 758,740 \\
437,240 & 585,130 & 141,460 & 466,818 & 23,148 \\
90,020 & -244,340 & 759,010 & 758,740 & 1,026,228
\end{array}\right) \\
& =\left(\frac{1}{1,286}\right)^{2}\left(\begin{array}{ccccc}
414,092 & 529,832 & 182,612 & 437,240 & 90,020 \\
529,832 & 806,322 & -23,148 & 585,130 & -244,340 \\
182,612 & -23,148 & 594,132 & 141,460 & 758,740 \\
437,240 & 585,130 & 141,460 & 466,818 & 23,148 \\
90,020 & -244,340 & 758,740 & 23,148 & 1,026,228
\end{array}\right) \\
& =\left(\frac{1}{1,286}\right)\left(\begin{array}{ccccc}
322 & 412 & 142 & 340 & 70 \\
412 & 627 & -18 & 455 & 190 \\
142 & -18 & 462 & 110 & 590 \\
340 & 455 & 110 & 363 & 18 \\
70 & 190 & 590 & 18 & 798
\end{array}\right) \\
& =\left(\begin{array}{lllll}
\frac{322}{1,286} & \frac{412}{1,286} & \frac{142}{1,286} & \frac{340}{1,286} & \frac{70}{1,286} \\
\frac{412}{1,286} & \frac{627}{1,286} & \frac{-18}{1,286} & \frac{455}{1,286} & \frac{-190}{1,286} \\
\frac{142}{1,286} & \frac{-18}{1,286} & \frac{462}{1,286} & \frac{110}{1,286} & \frac{590}{1,286} \\
\frac{340}{1,286} & \frac{455}{1,286} & \frac{110}{1,286} & \frac{363}{1,286} & \frac{18}{1,286} \\
\frac{70}{1,286} & \frac{-190}{1,286} & \frac{590}{1,286} & \frac{18}{1,286} & \frac{798}{1,286}
\end{array}\right) \\
& =P \text {. }
\end{array}
\end{split}\]
Thus we can conclude that the hat matrix is idempotent.
4(g)
The residual-making matrix is given by
\[\begin{split}
\begin{array}{ll}
M&=I-P \\
& =\left(\begin{array}{ccccc}
1 & 0 & 0 & 0 & 0 \\
0 & 1 & 0 & 0 & 0 \\
0 & 0 & 1 & 0 & 0 \\
0 & 0 & 0 & 1 & 0 \\
0 & 0 & 0 & 0 & 1
\end{array}\right)-\left(\begin{array}{ccccc}
\frac{322}{1,286} & \frac{412}{1,286} & \frac{142}{1,286} & \frac{340}{1,286} & \frac{70}{1,286} \\
\frac{412}{1286} & \frac{627}{1,286} & \frac{-18}{1,286} & \frac{455}{1,286} & \frac{-190}{1,286} \\
\frac{1442}{1,286} & \frac{-18}{1,286} & \frac{462}{1,286} & \frac{110}{1,286} & \frac{590}{1,286} \\
\frac{340}{1,286} & \frac{455}{1,286} & \frac{110}{1,286} & \frac{363}{1,286} & \frac{18}{1,286} \\
\frac{70}{1,286} & \frac{-190}{1,286} & \frac{590}{1,286} & \frac{188}{1,286} & \frac{798}{1,286}
\end{array}\right) \\
& =\left(\begin{array}{ccccc}
\frac{1,286}{1,286} & 0 & 0 & 0 & 0 \\
0 & \frac{1,286}{1,286} & 0 & 0 & 0 \\
0 & 0 & \frac{1,286}{1,286} & 0 & 0 \\
0 & 0 & 0 & \frac{1,286}{1,286} & 0 \\
0 & 0 & 0 & 0 & \frac{1,286}{1,286}
\end{array}\right)-\left(\begin{array}{cccccc}
\frac{322}{1,286} & \frac{412}{1,286} & \frac{142}{1,286} & \frac{340}{1,286} & \frac{70}{1,286} \\
\frac{412}{1,286} & \frac{627}{1,286} & \frac{128}{1,286} & \frac{455}{1,286} & \frac{1190}{1,286} \\
\frac{142}{1,286} & \frac{-18}{1,286} & \frac{462}{1,286} & \frac{110}{1,286} & \frac{550}{1,286} \\
\frac{340}{1,286} & \frac{455}{1,286} & \frac{110}{1,286} & \frac{363}{1,286} & \frac{18}{1,286} \\
\frac{70}{1,286} & \frac{-190}{1,286} & \frac{590}{1,286} & \frac{18}{1,286} & \frac{798}{1,286}
\end{array}\right) \\
& =\left(\begin{array}{ccccc}
\frac{1,286}{1,286}-\frac{322}{1,286} & 0-\frac{412}{1,286} & 0-\frac{142}{1,1286} & 0-\frac{340}{1,286} & 0-\frac{70}{1,286} \\
0-\frac{412}{1,286} & \frac{1,286}{1,286}-\frac{627}{1,286} & 0-\left(\frac{-18}{1,286}\right) & 0-\frac{455}{1,286} & 0-\left(\frac{-190}{1,286}\right) \\
0-\frac{142}{1,286} & 0-\left(\frac{-18}{1,286}\right) & \frac{1,286}{1,286}-\frac{462}{1,286} & 0-\frac{110}{1,286} & 0-\frac{590}{1,286} \\
0-\frac{340}{1,286} & 0-\frac{455}{1,286} & 0-\frac{110}{1,286} & \frac{1,286}{1,286}-\frac{363}{1,286} & 0-\frac{18}{1,286} \\
0-\frac{70}{1,286} & 0-\left(\frac{-190}{1,286}\right) & 0-\frac{590}{1,286} & 0-\frac{18}{1,286} & \frac{1,286}{1,286}-\frac{798}{1,286}
\end{array}\right) \\
& =\left(\begin{array}{ccccc}
\frac{964}{1,286} & \frac{-412}{1,286} & \frac{-142}{1,286} & \frac{-340}{1,286} & \frac{-70}{1,286} \\
\frac{1-4212}{1,286} & \frac{659}{1,286} & \frac{18}{1,286} & \frac{-455}{1,286} & \frac{190}{1,286} \\
\frac{142}{1,286} & \frac{18}{1,286} & \frac{324}{1,286} & \frac{-110}{1,286} & \frac{-590}{1,286} \\
\frac{-340}{1,286} & \frac{-455}{1,286} & \frac{-110}{1,286} & \frac{923}{1,286} & \frac{-18}{1,286} \\
\frac{-70}{1,286} & \frac{190}{1,286} & \frac{-590}{1,286} & \frac{-18}{1,286} & \frac{488}{1,286}
\end{array}\right) .
\end{array}
\end{split}\]
4(h)
Note that
\[\begin{split}
\begin{array}{ll}
M^{T} & =\left(\begin{array}{ccccc}
\frac{964}{1,286} & \frac{-412}{1,286} & \frac{-142}{1,286} & \frac{-340}{1,286} & \frac{-70}{1,286} \\
\frac{-412}{1,286} & \frac{659}{1,286} & \frac{18}{1,286} & \frac{-455}{1,286} & \frac{190}{1,286} \\
\frac{-142}{1,286} & \frac{18}{1,286} & \frac{824}{1,286} & \frac{-110}{1,286} & \frac{-590}{1,286} \\
\frac{-340}{1,286} & \frac{-455}{1,286} & \frac{-110}{1,286} & \frac{993}{1,286} & \frac{-18}{1,286} \\
\frac{-70}{1,286} & \frac{190}{1,286} & \frac{-590}{1,286} & \frac{-18}{1,286} & \frac{488}{1,286}
\end{array}\right)^{T} \\
& =\left(\begin{array}{llllll}
\frac{964}{1,286} & \frac{-412}{1,286} & \frac{-142}{1,286} & \frac{-340}{1,286} & \frac{-70}{1,286} \\
\frac{-412}{1,286} & \frac{659}{1,286} & \frac{18}{1,286} & \frac{-455}{1,286} & \frac{190}{1,286} \\
\frac{-142}{1,286} & \frac{18}{1,286} & \frac{824}{1,286} & \frac{-110}{1,286} & \frac{-590}{1,286} \\
\frac{-340}{1,286} & \frac{-455}{1,286} & \frac{-110}{1,286} & \frac{993}{1,286} & \frac{-18}{1,286} \\
\frac{-70}{1,286} & \frac{190}{1,286} & \frac{-590}{1,286} & \frac{-18}{1,286} & \frac{488}{1,286}
\end{array}\right) \\
& =M .
\end{array}
\end{split}\]
Thus we can conclude that the residual making matrix is symmetric.
4(i)
This is left as an exercise. While it is tedious, the practice that you will gain in matrix multiplication by completing this exercise might be useful. You should find that \(M M=M\), so that the residual-making matrix is indeed idempotent.