---
title: Problem set 6
heading: "Problem set 6: orthogonality and projections"
eyebrow: A7 · Problem set 6
type: problems
---

::: hook
These problems use lessons 24 and 25: perpendicular vectors and subspaces, orthonormal bases, Tellegen's theorem, and projections onto lines and subspaces. In every projection, check your answer the same way: the error must be perpendicular to what you projected onto.
:::

::: pool
pick: 12

::: check
kind: parts
given: a = 2 | 3; b = 1 | 4

## Find vectors perpendicular to $\mathbf{v} = (1, \given{a}, \given{b})$.

::: part
answer: -a
tolerance: 0.5%

### $(x, 1, 0)$ is perpendicular to $\mathbf{v}$. What is $x$?

::: misses
- [a] Check the sign: $x + a = 0$.
- [any] Set the dot product to zero.
:::
:::

::: part
answer: -b
tolerance: 0.5%

### $(y, 0, 1)$ is too. What is $y$?

::: misses
- [any] $y + b = 0$.
:::
:::
:::

::: check
kind: parts
given: b1 = 1 | 3; b2 = 2 | 4; b3 = 0 | 5

## Project $\mathbf{b} = (\given{b1}, \given{b2}, \given{b3})$ onto the line through $\mathbf{a} = (1, 2, 2)$.

::: part
answer: (b1 + 2*b2 + 2*b3)/9
tolerance: 0.5%

### What is the coefficient $\frac{\mathbf{a}\cdot\mathbf{b}}{\mathbf{a}\cdot\mathbf{a}}$?

::: misses
- [(b1 + 2*b2 + 2*b3)/3] Divide by $|\mathbf{a}|^2 = 9$, not $|\mathbf{a}| = 3$.
- [any] $\mathbf{a}\cdot\mathbf{a} = 9$.
:::
:::

::: part
answer: 2*(b1 + 2*b2 + 2*b3)/9
tolerance: 0.5%

### What is the projection's third entry?

::: misses
- [any] The coefficient times $a_3 = 2$.
:::
:::
:::

::: check
kind: parts
given: k = 2 | 3 | 0.5

## Find the projection matrix onto the line through $(1, \given{k})$.

::: part
answer: 1/(1 + k^2)
tolerance: 0.5%

### What is its top-left entry?

::: misses
- [1] Divide by $\mathbf{a}^T\mathbf{a} = 1 + k^2$.
- [any] $P = \frac{\mathbf{a}\mathbf{a}^T}{\mathbf{a}^T\mathbf{a}}$.
:::
:::

::: part
answer: k/(1 + k^2)
tolerance: 0.5%

### What is its top-right entry?

::: misses
- [any] $\frac{1 \cdot k}{1 + k^2}$.
:::
:::
:::

::: check
kind: parts
given: b1 = 3 | 6; b2 = 1 | 2; b3 = 2 | 7

## Project $\mathbf{b} = (\given{b1}, \given{b2}, \given{b3})$ onto the plane $x + y + z = 0$.

::: part
answer: b1 - (b1 + b2 + b3)/3
tolerance: 0.5%

### What is the projection's first entry?

::: misses
- [b1 - (b1 + b2 + b3)] Remove the part along $(1, 1, 1)$, whose coefficient is the average.
- [any] Subtract the average of the entries.
:::
:::

::: part
answer: (b1 + b2 + b3)/sqrt(3)
tolerance: 0.5%

### How far is $\mathbf{b}$ from the plane?

::: misses
- [(b1 + b2 + b3)/3] That's the average; the error is the average times $(1, 1, 1)$, of length $\sqrt3$ times it.
- [any] $\frac{|\mathbf{b}\cdot\mathbf{n}|}{|\mathbf{n}|}$ with $\mathbf{n} = (1, 1, 1)$.
:::
:::
:::

::: check
kind: parts
given: B = 5 | 13; P = 3 | 4

## A vector of length {B} is projected onto a subspace, and the projection has length {P}.

::: part
answer: sqrt(B^2 - P^2)
tolerance: 0.5%

### How long is the error?

::: misses
- [B - P] The error is perpendicular to the projection: use Pythagoras.
- [any] $|\mathbf{e}|^2 = |\mathbf{b}|^2 - |\mathbf{p}|^2$.
:::
:::
:::

::: check
kind: parts
given: x1 = 1 | 2; x2 = 2 | 5

## $\mathbf{q}_1 = \frac15(3, 4)$ and $\mathbf{q}_2 = \frac15(-4, 3)$ are an orthonormal basis. Write $\mathbf{x} = (\given{x1}, \given{x2})$ in it.

::: part
answer: (3*x1 + 4*x2)/5
tolerance: 0.5%

### What is the coordinate along $\mathbf{q}_1$?

::: misses
- [any] $\mathbf{q}_1\cdot\mathbf{x}$.
:::
:::

::: part
answer: (-4*x1 + 3*x2)/5
tolerance: 0.5%

### And along $\mathbf{q}_2$?

::: misses
- [any] $\mathbf{q}_2\cdot\mathbf{x}$.
:::
:::
:::

::: check
kind: parts
given: a = 2 | 5; b = 1 | 3

## The reflection $H = I - 2\mathbf{u}\mathbf{u}^T$ with $\mathbf{u} = \frac{1}{\sqrt2}(1, 1)$ is applied to $(\given{a}, \given{b})$.

::: part
answer: -b
tolerance: 0.5%

### What is the first entry of the result?

::: misses
- [b] $H = \begin{bmatrix}0 & -1\\-1 & 0\end{bmatrix}$: watch the sign.
- [any] Compute $\mathbf{u}\mathbf{u}^T = \frac12\begin{bmatrix}1 & 1\\1 & 1\end{bmatrix}$ first.
:::
:::

::: part
answer: -a
tolerance: 0.5%

### And the second?

::: misses
- [any] $H(a, b) = (-b, -a)$.
:::
:::
:::

::: check
kind: parts
given: p1 = 2 | 5; p2 = 3 | 1.5; p3 = 4 | 0.5

## A circuit has four branches. Three of them absorb {p1}, {p2} and {p3} mW.

::: part
answer: -(p1 + p2 + p3)
unit: mW
tolerance: 0.5%

### By Tellegen's theorem, what power does the fourth branch absorb?

::: misses
- [p1 + p2 + p3] It delivers that much, so it absorbs the negative.
- [any] The branch voltages and currents are perpendicular: $\sum v_ki_k = 0$.
:::
:::
:::

::: check
kind: parts
given: x1 = 3 | 1; x2 = 2 | 4; x3 = -1 | 0.5; x4 = 1 | -2

## Four samples per cycle of a hum, $(\given{x1}, \given{x2}, \given{x3}, \given{x4})$, are fitted with $a\cos + b\sin$, whose sampled patterns are $(1, 0, -1, 0)$ and $(0, 1, 0, -1)$.

::: part
answer: (x1 - x3)/2
tolerance: 0.5%

### What is $a$?

::: misses
- [x1 - x3] The pattern's squared length is 2.
- [any] Project onto $(1, 0, -1, 0)$.
:::
:::

::: part
answer: (x2 - x4)/2
tolerance: 0.5%

### What is $b$?

::: misses
- [any] Project onto $(0, 1, 0, -1)$.
:::
:::
:::

::: check
kind: parts
given: b1 = 1 | 2; b2 = 3 | 4; b3 = 4 | 6

## Project $\mathbf{b} = (\given{b1}, \given{b2}, \given{b3})$ onto the column space of $A = \begin{bmatrix}1 & 0\\1 & 1\\1 & 2\end{bmatrix}$ by solving $A^TA\hat{\mathbf{x}} = A^T\mathbf{b}$.

::: part
answer: (b3 - b1)/2
tolerance: 0.5%

### What is $\hat x_2$?

::: misses
- [any] $A^TA = \begin{bmatrix}3 & 3\\3 & 5\end{bmatrix}$.
:::
:::

::: part
answer: (5*b1 + 2*b2 - b3)/6
tolerance: 0.5%

### What is $\hat x_1$?

::: misses
- [any] $\hat x_1 = \bar b - \hat x_2$, with $\bar b$ the average of the entries.
:::
:::
:::

::: check
kind: parts
given: n = 5 | 8; k = 2 | 3

## $P$ projects $\mathbb{R}^{\given{n}}$ onto a {k}-dimensional subspace.

::: part
answer: k
tolerance: 0

### What is the trace of $P$?

::: misses
- [n] $P$ has eigenvalue 1 only along the subspace.
- [any] The eigenvalues are $k$ ones and the rest zeros.
:::
:::

::: part
answer: n - k
tolerance: 0

### What is the trace of $I - P$?

::: misses
- [any] $I - P$ projects onto the orthogonal complement.
:::
:::
:::

::: check
kind: parts
given: a = 1 | 3 | -4

## $(1, 2, \given{a})$ and $(b, 1, 1)$ are perpendicular.

::: part
answer: -2 - a
tolerance: 0.5%

### What is $b$?

::: misses
- [2 + a] Check the sign: $b + 2 + a = 0$.
- [any] Set the dot product to zero.
:::
:::
:::

::: check
kind: parts
given: x0 = 3 | 4; y0 = 1 | 2; z0 = 2 | 5; d = 1 | 2

## The plane $x + 2y + 2z = \given{d}$ and the point $(\given{x0}, \given{y0}, \given{z0})$.

::: part
answer: (x0 + 2*y0 + 2*z0 - d)/3
tolerance: 0.5%

### How far is the point from the plane?

::: misses
- [(x0 + 2*y0 + 2*z0 - d)/9] Divide by $|\mathbf{n}| = 3$, not $|\mathbf{n}|^2$.
- [any] $\frac{\mathbf{n}\cdot\mathbf{p} - d}{|\mathbf{n}|}$ with $\mathbf{n} = (1, 2, 2)$.
:::
:::

::: part
answer: x0 - (x0 + 2*y0 + 2*z0 - d)/9
tolerance: 0.5%

### What is the $x$ coordinate of the closest point on the plane?

::: misses
- [any] Move back along $\mathbf{n}$ by $\frac{\mathbf{n}\cdot\mathbf{p} - d}{|\mathbf{n}|^2}\mathbf{n}$.
:::
:::
:::

::: check
kind: parts
given: c1 = 1 | 2; c2 = 2 | 3; c3 = 2 | 6

## $\mathbf{x} = \given{c1}\mathbf{q}_1 + \given{c2}\mathbf{q}_2 + \given{c3}\mathbf{q}_3$ with orthonormal $\mathbf{q}$'s.

::: part
answer: sqrt(c1^2 + c2^2 + c3^2)
tolerance: 0.5%

### What is $|\mathbf{x}|$?

::: misses
- [c1 + c2 + c3] The cross terms vanish, but the coordinates still add in squares.
- [any] $|\mathbf{x}|^2 = c_1^2 + c_2^2 + c_3^2$.
:::
:::
:::

::: check
kind: parts
given: b1 = 2 | 5; b2 = 3 | 1; b3 = 4 | 6; b4 = 7 | 0

## Remove the DC from the samples $(\given{b1}, \given{b2}, \given{b3}, \given{b4})$ by projecting out $(1, 1, 1, 1)$.

::: part
answer: (b1 + b2 + b3 + b4)/4
tolerance: 0.5%

### What is the coefficient removed?

::: misses
- [(b1 + b2 + b3 + b4)/2] Divide by $|(1, 1, 1, 1)|^2 = 4$.
- [any] The average.
:::
:::

::: part
answer: (b1 + b2 + b3 + b4)^2/4
tolerance: 0.5%

### How much energy ($\sum b_k^2$) does that remove?

::: misses
- [any] The removed part is the average times $(1, 1, 1, 1)$: energy $4\bar b^2$.
:::
:::
:::
:::
