## Linear Algebra and Its Applications, Exercise 3.2.5

Exercise 3.2.5. If $a = (1, 1, \dots, 1)$ is a vector in $\mathbb{R}^n$ then what is the angle $\theta$ between $a$ and the coordinate axes? What is the matrix $P$ that projects vectors in $\mathbb{R}^n$ onto $a$?

Answer: Consider the $i^{th}$ coordinate axis and the unit vector $e_i$ lying along that axis, whose $i^{th}$ entry is 1 and whose other entries are zero. If $\theta$ is the angle between $a$ and $e_i$ then we have $\cos \theta = a^Te_i / \|a\|\|e_i\|$. We have $\|e_i\| = 1$ and $\|a\|^2 = \sum_{j=1}^n 1^2 = n$ so that $\|a\| = \sqrt{n}$. We also have $a^Te_i = 1$ since the $i^{th}$ entries of $a$ and $e_i$ are both 1 and all other entries of $e_i$ are zero.

We thus have $\cos \theta = a^Te_i / \|a\|\|e_i\| = 1/\sqrt{n}$ so that $\theta = \arccos 1/\sqrt{n}$.

The matrix $P$ that projects vectors in $\mathbb{R}^n$ onto $a$ is

$P = aa^T/a^Ta = \frac{1}{a^Ta}(aa^T) = \frac{1}{n} \begin{bmatrix} 1 \\ \vdots \\ 1 \end{bmatrix} \begin{bmatrix} 1&\cdots&1 \end{bmatrix}$

$= \frac{1}{n} \begin{bmatrix} 1&\cdots&1 \\ \vdots&\ddots&\vdots \\ 1&\cdots&1 \end{bmatrix} = \begin{bmatrix} \frac{1}{n}&\cdots&\frac{1}{n} \\ \vdots&\ddots&\vdots \\ \frac{1}{n}&\cdots&\frac{1}{n} \end{bmatrix}$

NOTE: This continues a series of posts containing worked out exercises from the (out of print) book Linear Algebra and Its Applications, Third Edition by Gilbert Strang.

If you find these posts useful I encourage you to also check out the more current Linear Algebra and Its Applications, Fourth Edition, Dr Strang’s introductory textbook Introduction to Linear Algebra, Fourth Edition and the accompanying free online course, and Dr Strang’s other books.

This entry was posted in linear algebra and tagged . Bookmark the permalink.