Exercise 07 solutions

🔹 must know, 🔸 ideally should know, ⛑ challenging, 🔫 very challenging

Exercises from the Rasmus’ notes


🔸 Exercise 1

Construct a basis for the subspace \(V = \{(x, y, z) \mid z=x+y\}\) of \(\mathbb{R}^3\). Compute the projection matrix for this subspace.

Solution

To find the basis for \(V\), we need to find set of vectors that span \(V\) and they are linearly independent. To find such set of vectors, we first know that any vector \(v\) from \(V\) is of the following form:

\[v = \begin{bmatrix} x \\ y \\ z \end{bmatrix} = \begin{bmatrix} x \\ y \\ x + y \end{bmatrix}\]

Well, this can be further written as:

\[v = \begin{bmatrix} x \\ y \\ x + y \end{bmatrix} = \begin{bmatrix} x \\ 0 \\ x \end{bmatrix} + \begin{bmatrix} 0 \\ y \\ y \end{bmatrix} = x\begin{bmatrix} 1 \\ 0 \\ 1 \end{bmatrix} + y\begin{bmatrix} 0 \\ 1 \\ 1 \end{bmatrix}\]

Therefore, any vector \(v \in V\) can be written as any linear combination of the following two basis vectors:

\[B = \{ \begin{bmatrix} 1 \\ 0 \\ 1 \end{bmatrix}, \begin{bmatrix} 0 \\ 1 \\ 1 \end{bmatrix} \}\]

I said basis since clearly they are linearly independent, i.e, there is no scalar \(c \in R\) that would allow me to multiply one of the vectors to obtain the other.

Now, we can compute the projection matrix \(P\) for which the formula is:

\[P=A\left(A^T A\right)^{-1} A^T\]

where \(A\) is a matrix whose columns are the basis vectors. I have made the calculations using python. You can check the whole process here which also includes the results of intermediate calculations. The computed projection matrix \(P\) has then the following form:

\[P=\left[\begin{array}{ccc} 2/3 & -1/3 & 1/3 \\ -1/3 & 2/3 & 1/3 \\ 1/3 & 1/3 & 2/3 \end{array}\right]\]


🔹 Exercise 3

See the solution here


Exercises from the book


🔹 5.4.17

Find the projection of the vector \(v\) onto the subspace \(S\):

\[S=\operatorname{span}\left\{\left[\begin{array}{r} 0 \\ 0 \\ -1 \\ 1 \end{array}\right],\left[\begin{array}{l} 0 \\ 1 \\ 1 \\ 1 \end{array}\right]\right\}, \quad \mathbf{v}=\left[\begin{array}{l} 1 \\ 0 \\ 1 \\ 1 \end{array}\right]\]

Solution

To find the projection of \(v\) onto \(S\), we can use the following formula:

\[p = A(A^TA)^{-1}A^Tv\]

where \(A\) is a matrix whose columns are basis of \(S\). Since we already know two vectors that span \(S\) and we also see that they are linearly independent (there is no way how you can scale one vector to obtain the other), we can evaluate the above formula and obtain the following result:

\[p = \begin{bmatrix} 0 \\ 2/3 \\ 2/3 \\ 2/3 \end{bmatrix}\]

Again, I have made an explanation of the calculation here.


🔹 5.4.31

See the solution here.


🔹 5.4.35

See the solution here.


🔍 About the page


  • Last updated: 11/10/2022
  • Unless othewise stated, exercises come from the book: Elementary Linear Algebra, International Metric Edition, Ron Larson
  • Purpose: This page was created as part of a preparation for my teaching assistant session in the course Linear algebra and optimization managed by Rasmus Ejlers Møgelberg. Please note that unless othewise stated, the solutions on this page are my own, thus it should not be considered as official solutions provided as part of the course.