---
title: Problem set 11
heading: "Problem set 11: SVD, bases and computation"
eyebrow: A7 · Problem set 11
type: problems
---

::: hook
These problems use lessons 44 to 53: the singular value decomposition, change of basis, rotations and reflections, complex matrices for AC circuits, conditioning, and the circuit solver. Several ask how much you can trust a computed answer, which is the question to ask of every number a computer gives you.
:::

::: pool
pick: 12

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

## Let $A = \begin{bmatrix}\given{a} & \given{b}\\\given{c} & \given{d}\end{bmatrix}$.

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

### What is $\sigma_1$?

::: misses
- [any] The larger eigenvalue of $A^TA$, square-rooted.
:::
:::

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

### What is $\sigma_2$?

::: misses
- [any] $\sigma_1\sigma_2 = |\det A|$.
:::
:::
:::

::: check
kind: parts
given: s1 = 12 | 20; s2 = 4 | 5; s3 = 1 | 0.5

## A matrix has singular values {s1}, {s2}, {s3}.

::: part
answer: sqrt(s3^2)/sqrt(s1^2 + s2^2 + s3^2)
tolerance: 0.5%

### What is the relative Frobenius error of its best rank-2 approximation?

::: misses
- [any] Only $\sigma_3$ is discarded.
:::
:::

::: part
answer: s1/s3
tolerance: 0.5%

### If it's square, what is its condition number?

::: misses
- [any] $\sigma_{\max}/\sigma_{\min}$.
:::
:::
:::

::: check
kind: parts
given: m = 400 | 1000; n = 300 | 800; k = 5 | 25

## An {m} × {n} data matrix is replaced by its rank-{k} approximation.

::: part
answer: k*(m + n + 1)

### How many numbers does the approximation store?

::: misses
- [any] $k$ terms, each with a $\mathbf{u}$, a $\mathbf{v}$ and a $\sigma$.
:::
:::

::: part
answer: m*n/(k*(m + n + 1))
tolerance: 0.5%

### By what factor is that smaller than the original?

::: misses
- [any] $\frac{mn}{k(m + n + 1)}$.
:::
:::
:::

::: check
kind: parts
given: V = 170 | 325; p = 15 | 40

## A balanced three-phase set with peak {V} V leads the reference angle by {p}°.

::: part
answer: V*cos(p*pi/180)
unit: V
tolerance: 0.5%

### What is $v_d$?

::: misses
- [any] $V\cos\varphi$.
:::
:::

::: part
answer: V*sin(p*pi/180)
unit: V
tolerance: 0.5%

### What is $v_q$?

::: misses
- [any] $V\sin\varphi$.
:::
:::
:::

::: check
kind: parts
given: v1 = 6 | 9; v2 = 2 | -4

## Use the basis $(1, 1)$, $(1, -1)$.

::: part
answer: (v1 + v2)/2

### What is the first coordinate of $(\given{v1}, \given{v2})$?

::: misses
- [any] $c + d = v_1$, $c - d = v_2$.
:::
:::

::: part
answer: (v1 - v2)/2

### What is the second?

::: misses
- [any] Subtract the equations.
:::
:::
:::

::: check
kind: parts
given: R = 1 | 2.2; C = 100 | 470; f = 1 | 5

## A {R} kΩ resistor and a {C} nF capacitor are in parallel from a node to ground, at {f} kHz.

::: part
answer: 1/(R*1000)
unit: S
tolerance: 0.5%

### What is the real part of the node's admittance?

::: misses
- [any] $1/R$.
:::
:::

::: part
answer: 2*pi*f*1000*C*1e-9
unit: S
tolerance: 0.5%

### What is its imaginary part?

::: misses
- [any] $\omega C$.
:::
:::
:::

::: check
kind: parts
given: k = 1e4 | 1e8; eps = 0.01 | 0.1

## A matrix has condition number {k}.

::: part
answer: 16 - log(k)
tolerance: 2%

### Roughly how many correct digits does a double-precision solve keep?

::: misses
- [any] $16 - \log_{10}\kappa$.
:::
:::

::: part
answer: k*eps

### If $\mathbf{b}$ is uncertain by {eps}%, by up to what percent can $\mathbf{x}$ be wrong?

::: misses
- [any] Multiply by $\kappa$.
:::
:::
:::

::: check
kind: parts
given: e = 0.01 | 0.002; d = 0.004 | 0.001

## Solve $x + y = 2$, $x + (1 + \given{e})y = 2 + \given{d}$.

::: part
answer: d/e

### What is $y$?

::: misses
- [any] Subtract the equations.
:::
:::

::: part
answer: 2 - d/e

### What is $x$?

::: misses
- [any] $x = 2 - y$.
:::
:::
:::

::: check
kind: parts
given: k = 100 | 1e3 | 1e4 | 1e5 | 1e6 | 1e7

## A matrix $A$ has condition number {k}.

::: part
answer: k^2

### What is the condition number of $A^TA$?

::: misses
- [any] Squared.
:::
:::

::: part
answer: log(k^2) - log(k)
tolerance: 2%

### How many more digits does solving the normal equations lose than solving with QR?

::: misses
- [any] $\log_{10}\kappa^2 - \log_{10}\kappa$.
:::
:::
:::

::: check
kind: parts
given: Vs = 10 | 5; R1 = 1 | 2; R2 = 1 | 3

## A circuit has a {Vs} V source from node 1 to ground, {R1} kΩ from node 1 to node 2, and {R2} kΩ from node 2 to ground.

::: part
answer: Vs*R2/(R1 + R2)
unit: V
tolerance: 0.5%

### What is $v_2$?

::: misses
- [any] A divider.
:::
:::

::: part
answer: -Vs/(R1 + R2)
unit: mA
tolerance: 0.5%

### What is the MNA unknown $j$, the current into the source's positive end?

::: misses
- [Vs/(R1 + R2)] The source delivers current out of its positive end, so $j$ is negative.
- [any] Current through the series resistors, with the sign of $j$.
:::
:::
:::

::: check
kind: parts
given: n = 20 | 100; m = 2 | 5

## A circuit has {n} non-ground nodes and {m} voltage sources.

::: part
answer: n + m

### What size is the MNA matrix?

::: misses
- [any] Node voltages plus source currents.
:::
:::

::: part
answer: (n + m)^3/3

### About how many multiply-adds does factoring it take?

::: misses
- [any] $\frac{N^3}{3}$ for an $N \times N$ matrix.
:::
:::
:::

::: check
kind: parts
given: R1 = 1 | 1.5; R2 = 2 | 3.3; R3 = 4.7 | 10

## A bridge has $R_1$ = {R1} kΩ and $R_2$ = {R2} kΩ on one side, $R_3$ = {R3} kΩ and $R_4$ on the other, fed by 10 V.

::: part
answer: R2*R3/R1
unit: kΩ
tolerance: 0.5%

### What $R_4$ balances it?

::: misses
- [R1*R3/R2] The dividers must match: $R_4/R_3 = R_2/R_1$.
- [any] Equal divider ratios.
:::
:::

::: part
answer: 10*R2/(R1 + R2)
unit: V
tolerance: 0.5%

### At balance, what is the voltage at the midpoints?

::: misses
- [any] The $R_1$, $R_2$ divider.
:::
:::
:::

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

## Find the 4-point DFT of $(\given{a}, \given{b}, \given{a}, \given{b})$.

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

### What is $X_0$?

::: misses
- [any] The sum of the samples.
:::
:::

::: part
answer: 2*(a - b)
tolerance: 0.5%

### What is $X_2$?

::: misses
- [any] Row 2 of $F$ is $(1, -1, 1, -1)$.
:::
:::
:::

::: check
kind: parts
given: N = 8 | 16; E = 32 | 100

## An {N}-point signal has energy $\sum|x_n|^2$ = {E}.

::: part
answer: N*E
tolerance: 0.5%

### What is $\sum|X_k|^2$ for its DFT?

::: misses
- [E] The unscaled DFT multiplies energy by $N$.
- [any] $F^HF = NI$.
:::
:::

::: part
answer: E
tolerance: 0.5%

### What is $|F\mathbf{x}/\sqrt N|^2$?

::: misses
- [any] $F/\sqrt N$ is unitary.
:::
:::
:::

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

## Two nodes are joined by 1 S and each has admittance $j\given{B}$ S to ground. 1 A is injected at node 1.

::: part
answer: 1/(B*sqrt(B^2 + 4))
unit: V
tolerance: 0.5%

### What is $|V_2|$?

::: misses
- [any] $V_2 = \frac{1}{\det Y} = \frac{1}{(1 + jB)^2 - 1} = \frac{1}{-B^2 + 2jB}$.
:::
:::

::: part
answer: sqrt(1 + B^2)/(B*sqrt(B^2 + 4))
unit: V
tolerance: 0.5%

### What is $|V_1|$?

::: misses
- [any] $V_1 = (1 + jB)V_2$.
:::
:::
:::

::: check
kind: parts
given: a = 20 | 50 | 80; b = 30 | 60; x = 1 | 2; y = 1 | 2

## A sensor frame is turned by $R = R_z(\given{a}°)$, then by $R_x(\given{b}°)$ applied first, so $R = R_z(\given{a}°)R_x(\given{b}°)$. A vector $(\given{x}, \given{y}, 0)$ in the sensor frame is mapped by $R$.

::: part
answer: x*cos(a°) - y*cos(b°)*sin(a°)
tolerance: 0.5%

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

::: misses
- [x*cos(a°) - y*sin(a°)] That leaves out $R_x$, which acts first and tilts the $y$ component by {b}°.
- [any] Not yet. Apply $R_x(\given{b}°)$ to the vector, then $R_z(\given{a}°)$ to the result.
:::
:::

::: part
answer: cos(a°) + cos(a°)*cos(b°) + cos(b°)
tolerance: 0.5%

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

::: misses
- [cos(a°) + cos(b°)] Add all three diagonal entries: $\cos a$, $\cos a\cos b$ and $\cos b$.
- [any] Not yet. The diagonal of $R_z(a)R_x(b)$ is $\cos a$, $\cos a\cos b$, $\cos b$.
:::
:::

::: part
answer: acos((cos(a°) + cos(a°)*cos(b°) + cos(b°) - 1)/2)*180/pi
unit: °
tolerance: 0.5%

### Through what single angle does $R$ turn, about its own axis?

::: misses
- [a + b] Turns about different axes don't add. Use the trace: $\text{tr}\,R = 1 + 2\cos\theta$.
- [any] Not yet. Solve $1 + 2\cos\theta = \text{tr}\,R$.
:::
:::

::: right
Right. The trace alone gives the angle of the combined turn, always less than the sum of the two when their axes differ.
:::
:::
:::
