---
title: Problem set 7
heading: "Problem set 7: orthogonality, least squares and determinants"
eyebrow: A7 · Problem set 7
type: problems
---

::: hook
These problems use lessons 24 to 31: orthogonality, projections, least squares, Gram-Schmidt, and determinants. The least-squares problems are small enough to do by hand; write out the normal equations each time.
:::

::: pool
pick: 12

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

## The row $\begin{bmatrix}\given{a} & \given{b}\end{bmatrix}$.

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

### A null-space vector has first component 1. What is its second?

::: misses
- [any] Perpendicular to the row: $a + bk = 0$.
:::
:::

::: part
answer: (a*2 + b*1)/(a^2 + b^2)
tolerance: 0.5%

### The vector $(2, 1)$ is projected onto the row space, the line through $(\given{a}, \given{b})$. The projection is $t(\given{a}, \given{b})$. What is $t$?

::: misses
- [any] $\frac{\mathbf{a}\cdot\mathbf{b}}{\mathbf{a}\cdot\mathbf{a}}$.
:::
:::
:::

::: check
kind: parts
given: Vs = 12 | 5; I = 3 | 8; p1 = 10 | 4

## A {Vs} V source drives {I} mA into a network of two resistors. One resistor absorbs {p1} mW.

::: part
answer: Vs*I
unit: mW

### How much power does the source deliver?

::: misses
- [any] $V \times I$, in V and mA.
:::
:::

::: part
answer: Vs*I - p1
unit: mW

### How much does the other resistor absorb?

::: misses
- [any] Tellegen: everything absorbed adds to what the source delivers.
:::
:::
:::

::: check
kind: parts
given: x1 = 4 | 7; x2 = 2 | -1

## The orthonormal basis $\mathbf{q}_1 = \frac{1}{\sqrt 2}(1, 1)$, $\mathbf{q}_2 = \frac{1}{\sqrt 2}(1, -1)$, and $\mathbf{x} = (\given{x1}, \given{x2})$.

::: part
answer: (x1 + x2)/sqrt(2)
tolerance: 0.5%

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

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

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

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

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

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

## The samples $\mathbf{b} = (\given{b1}, \given{b2}, \given{b3})$ are projected onto $(1, 1, 1)$.

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

### What is each entry of the projection?

::: misses
- [any] The mean.
:::
:::

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

### How long is the error vector?

::: misses
- [any] Subtract the mean from each entry, then take the length.
:::
:::
:::

::: check
kind: parts
given: y1 = 2 | 3; y2 = 4 | 5; y3 = 7 | 6

## Fit $y = sx$ (a line through the origin) to $(1, \given{y1})$, $(2, \given{y2})$, $(3, \given{y3})$.

::: part
answer: (y1 + 2*y2 + 3*y3)/14
tolerance: 0.5%

### What is the least-squares slope $s$?

::: misses
- [any] $s = \frac{\sum x_iy_i}{\sum x_i^2}$.
:::
:::

::: part
answer: y1 - (y1 + 2*y2 + 3*y3)/14
tolerance: 0.5%

### What is the residual (measured minus fitted) at $x = 1$?

::: misses
- [any] $y_1 - s \cdot 1$.
:::
:::
:::

::: check
kind: parts
given: y0 = 1 | 2; y1 = 3 | 2; y2 = 4 | 6

## Fit $y = c + mx$ to $(0, \given{y0})$, $(1, \given{y1})$, $(2, \given{y2})$. The normal equations are $\begin{bmatrix}3 & 3\\3 & 5\end{bmatrix}\begin{bmatrix}c\\m\end{bmatrix} = \begin{bmatrix}\sum y\\\sum xy\end{bmatrix}$.

::: part
answer: ((y1 + 2*y2) - (y0 + y1 + y2))/2
tolerance: 0.5%

### What is the slope $m$?

::: misses
- [any] Solve the 2 × 2 system.
:::
:::

::: part
answer: (5*(y0 + y1 + y2) - 3*(y1 + 2*y2))/6
tolerance: 0.5%

### What is the intercept $c$?

::: misses
- [any] $c = \frac{5\sum y - 3\sum xy}{6}$.
:::
:::
:::

::: check
kind: parts
given: a = 3 | 5; b = 4 | 12; c = 2 | 1; d = 1 | 3

## Gram-Schmidt on $\mathbf{a}_1 = (\given{a}, \given{b})$, $\mathbf{a}_2 = (\given{c}, \given{d})$.

::: part
answer: (a*c + b*d)/sqrt(a^2 + b^2)
tolerance: 0.5%

### What is $r_{12}$?

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

::: part
answer: abs(a*d - b*c)/sqrt(a^2 + b^2)
tolerance: 0.5%

### What is $r_{22}$?

::: misses
- [any] Area over base.
:::
:::
:::

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

## Let $M = \begin{bmatrix}\given{a} & 1 & 0\\0 & \given{b} & 1\\1 & 0 & \given{c}\end{bmatrix}$.

::: part
answer: a*b*c + 1

### What is $\det M$?

::: misses
- [a*b*c] Include the cofactor from the 1 in row 1.
- [any] Expand along row 1.
:::
:::

::: part
answer: 1/(a*b*c + 1)
tolerance: 0.5%

### What is $\det M^{-1}$?

::: misses
- [any] The reciprocal.
:::
:::
:::

::: check
kind: parts
given: n = 3 | 4; k = 2 | 3; d = 6 | -3

## $A$ is {n} × {n} with $\det A$ = {d}.

::: part
answer: k^n*d

### What is $\det(\given{k}A)$?

::: misses
- [k*d] Every row is scaled.
- [any] $k^n\det A$.
:::
:::

::: part
answer: d^2

### What is $\det(A^TA)$?

::: misses
- [any] $\det A^T\det A$.
:::
:::
:::

::: check
kind: parts
given: a = 3 | 2; b = 1 | -2; c = 2 | 1; d = 4 | 5; b1 = 5 | 9; b2 = 6 | 3

## Use Cramer's rule on $\begin{bmatrix}\given{a} & \given{b}\\\given{c} & \given{d}\end{bmatrix}\mathbf{x} = (\given{b1}, \given{b2})$.

::: part
answer: (b1*d - b*b2)/(a*d - b*c)
tolerance: 0.5%

### What is $x_1$?

::: misses
- [any] Replace column 1 with $\mathbf{b}$.
:::
:::

::: part
answer: (a*b2 - c*b1)/(a*d - b*c)
tolerance: 0.5%

### What is $x_2$?

::: misses
- [any] Replace column 2 with $\mathbf{b}$.
:::
:::
:::

::: check
kind: parts
given: g1 = 2 | 1; g2 = 1 | 3; g3 = 2 | 0.5; I = 4 | 1

## A two-node network: $g_1$ = {g1} mS node 1 to ground, $g_2$ = {g2} mS between the nodes, $g_3$ = {g3} mS node 2 to ground, and {I} mA into node 1.

::: part
answer: I*(g2 + g3)/(g1*g2 + g1*g3 + g2*g3)
unit: V
tolerance: 0.5%

### What is $v_1$?

::: misses
- [any] Cramer's rule, column 1 replaced.
:::
:::

::: part
answer: g2*I/(g1*g2 + g1*g3 + g2*g3)
unit: V
tolerance: 0.5%

### What is $v_2$?

::: misses
- [any] Cramer's rule, column 2 replaced.
:::
:::
:::

::: check
kind: parts
given: n = 50 | 200; k = 2 | 4

## A {n}-sample signal is cleaned by projecting out a {k}-dimensional interference subspace.

::: part
answer: n - k

### What is the dimension of the space the cleaned signal lies in?

::: misses
- [any] The orthogonal complement: $n - k$.
:::
:::

::: part
answer: k

### What is the rank of the projection matrix $P$ onto the interference subspace?

::: misses
- [any] Its column space is the subspace itself.
:::
:::
:::

::: check
kind: parts
given: y1 = 10 | 12; y2 = 11 | 15; s1 = 0.1 | 0.2; s2 = 0.3 | 0.5

## Two measurements of the same voltage read {y1} V (standard deviation {s1} V) and {y2} V (standard deviation {s2} V). Combine them by weighted least squares.

::: part
answer: (y1/s1^2 + y2/s2^2)/(1/s1^2 + 1/s2^2)
unit: V
tolerance: 0.5%

### What is the estimate?

::: misses
- [(y1 + y2)/2] The more precise reading deserves more weight.
- [any] Weight each reading by $1/\sigma^2$.
:::
:::

::: part
answer: 1/sqrt(1/s1^2 + 1/s2^2)
unit: V
tolerance: 0.5%

### What is its standard deviation?

::: misses
- [any] The weights add: $\sigma^{-2} = \sigma_1^{-2} + \sigma_2^{-2}$.
:::
:::
:::

::: check
kind: parts
given: V0 = 10 | 5; V1 = 4 | 2; t1 = 1 | 3

## A decaying voltage reads {V0} V at $t = 0$ and {V1} V at $t$ = {t1} ms. Fit $V_0e^{-t/\tau}$ through both points.

::: part
answer: t1/ln(V0/V1)
unit: ms
tolerance: 0.5%

### What is $\tau$?

::: misses
- [t1/log(V0/V1)] Use the natural logarithm.
- [any] Take logs: $\ln V_1 = \ln V_0 - t_1/\tau$.
:::
:::

::: part
answer: V1^2/V0
unit: V
tolerance: 0.5%

### What does it predict at $2t_1$?

::: misses
- [any] Each interval of $t_1$ multiplies by $V_1/V_0$.
:::
:::
:::

::: check
kind: parts
given: g = 0.5 | 2; n = 5 | 8

## $T_n$ is the $n \times n$ matrix with 2 on the diagonal and $-1$ beside it.

::: part
answer: 4*g^3
tolerance: 0.5%

### What is $\det(\given{g}T_3)$?

::: misses
- [4*g] Scaling a 3 × 3 matrix by $g$ scales its determinant by $g^3$.
- [any] $\det T_3 = 4$.
:::
:::

::: part
answer: n + 1
tolerance: 0

### What is $\det T_{\given{n}}$?

::: misses
- [any] $D_n = 2D_{n-1} - D_{n-2}$ gives $n + 1$.
:::
:::
:::
:::
