---
title: Problem set 12
heading: "Problem set 12: the whole course"
eyebrow: A7 · Problem set 12
type: problems
---

::: hook
Multi-step problems from the whole course, using matrices the way circuit analysis, signal processing and control do. Each one has your own numbers. Treat it as practice for the final exam.
:::

::: pool
pick: 12

::: check
kind: parts
given: a = 2 | 4; d = 3 | 5; b = 1; c = 1 | 2; x = -3 | -1 | 1 | 3; y = -4 | -2 | 2 | 4; let p = a*x + b*y; let q = c*x + d*y

## Solve $\begin{bmatrix} \given{a} & \given{b} \\ \given{c} & \given{d} \end{bmatrix}\begin{bmatrix} x \\ y \end{bmatrix} = \begin{bmatrix} \given{p} \\ \given{q} \end{bmatrix}$.

::: part
answer: a*d - b*c
tolerance: 0.001

### What is the determinant?

::: misses
- [a*d + b*c] It's $ad - bc$.
- [any] $ad - bc$.
:::
:::

::: part
answer: (d*p - b*q)/(a*d - b*c)
tolerance: 0.5%

### What is $x$?

::: misses
- [(a*q - c*p)/(a*d - b*c)] That's y.
- [any] $x = (dp - bq)/(ad - bc)$.
:::
:::

::: part
answer: (a*q - c*p)/(a*d - b*c)
tolerance: 0.5%

### And $y$?

::: misses
- [(d*p - b*q)/(a*d - b*c)] That's x.
- [any] $y = (aq - cp)/(ad - bc)$.
:::
:::

::: right
Right. Check by putting x and y back into both equations.
:::
:::

::: check
kind: parts
given: s = 3..8 int; b = 1..2 int

## A circuit's state matrix is $\begin{bmatrix} -\given{s} & \given{b} \\ \given{b} & -\given{s} \end{bmatrix}$ (per ms).

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

### What is its eigenvalue closest to zero?

::: misses
- [-s - b] That's the faster one.
- [any] The eigenvalues are $-s \pm b$.
:::
:::

::: part
answer: 1/(s - b)
unit: ms
tolerance: 0.5%

### What is the slowest time constant, in ms?

::: misses
- [1/(s + b)] That's the fast mode's time constant.
- [any] $\tau = -1/\lambda$ for the eigenvalue closest to zero.
:::
:::

::: right
Right. The slowest mode sets how long the circuit takes to settle.
:::
:::

::: check
kind: parts
given: R1 = 1..9 int; R2 = 1..9 int; R3 = 1..9 int

## A current of 1 mA is injected into node 1. Node 1 has {R1} kΩ to ground and {R2} kΩ to node 2; node 2 has {R3} kΩ to ground. Work in kΩ, mA and V.

::: part
answer: 1/R1 + 1/R2
unit: mS
tolerance: 0.5%

### What is $G_{11}$, in mS (1/kΩ)?

::: misses
- [1/R1] Node 1 also connects to node 2 through {R2} kΩ.
- [any] Add the conductances touching node 1.
:::
:::

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

### What is $V_1$?

::: misses
- [R1] Some of the current also flows through {R2} and {R3} kΩ.
- [any] Solve the 2 × 2 system, or notice node 1 sees {R1} kΩ in parallel with ({R2} + {R3}) kΩ.
:::
:::

::: right
Right. The matrix and the series-parallel shortcut agree.
:::
:::

::: check
kind: parts
given: k = 1..3 int; let y1 = k*1 + 1; let y2 = k*2 + 2; let y3 = k*3 + 2

## Fit $y = sx$ (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?

::: misses
- [(y1 + y2 + y3)/6] Use $\sum x_ky_k/\sum x_k^2$: the denominator is $1 + 4 + 9$.
- [any] $s = \sum xy/\sum x^2$.
:::
:::

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

### What is $\sum x_k r_k$, the residuals weighted by $x$? (It should come out the same for everyone.)

::: misses
- [any] At the least-squares slope, the residual is perpendicular to the x column.
:::
:::

::: right
Right. Zero: the residual is perpendicular to the data's x values.
:::
:::
::: check
kind: parts
given: k1 = 0.25 | 0.4; k2 = 0.5 | 0.1; V1 = 8 | 12; out = 5 | 3

## A linear circuit gives {k1} V out per volt of source 1 and {k2} V per volt of source 2.

::: part
answer: (out - k1*V1)/k2
unit: V
tolerance: 0.5%

### With $V_1$ = {V1} V the output is {out} V. What is $V_2$?

::: misses
- [any] Solve $k_1V_1 + k_2V_2 = $ {out}.
:::
:::

::: part
answer: -k1/k2
tolerance: 0.5%

### By how many volts must $V_2$ change for each volt $V_1$ rises, to hold the output fixed?

::: misses
- [any] $k_1\,\Delta V_1 + k_2\,\Delta V_2 = 0$.
:::
:::
:::

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

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

::: part
answer: d - c/a*b
tolerance: 0.5%

### What is the second pivot?

::: misses
- [any] $d - \frac{c}{a}b$.
:::
:::

::: part
answer: a*d - b*c

### What is the determinant?

::: misses
- [any] The product of the pivots.
:::
:::
:::

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

## Resistors: {R1} kΩ from node 1 to ground, {R2} kΩ between nodes 1 and 2, {R3} kΩ from node 2 to ground.

::: part
answer: (1/R2)/((1/R1 + 1/R2)*(1/R2 + 1/R3) - 1/R2^2)
unit: V
tolerance: 0.5%

### 1 mA is injected into node 1. What is $v_2$?

::: misses
- [any] The off-diagonal entry of $G^{-1}$.
:::
:::

::: part
answer: (1/R2)/((1/R1 + 1/R2)*(1/R2 + 1/R3) - 1/R2^2)
unit: V
tolerance: 0.5%

### 1 mA is injected into node 2 instead. What is $v_1$?

::: misses
- [any] Reciprocity.
:::
:::
:::

::: check
kind: parts
given: n = 7 | 12; m = 10 | 20

## A connected circuit has {n} nodes and {m} branches.

::: part
answer: m - n + 1

### How many independent loop currents are there?

::: misses
- [any] The dimension of $N(A^T)$.
:::
:::

::: part
answer: n - 1

### What is the rank of the incidence matrix?

::: misses
- [any] $n - 1$.
:::
:::
:::

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

## Samples $(\given{b1}, \given{b2}, \given{b3})$ have their DC removed by projecting out $(1, 1, 1)$.

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

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

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

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

### How long is the removed part, the projection?

::: misses
- [any] The mean in each of 3 entries: length $\bar b\sqrt 3$.
:::
:::
:::

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

## Fit $y = sx$ 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?

::: misses
- [any] $\frac{\sum xy}{\sum x^2}$.
:::
:::

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

### What is the residual at $x = 3$?

::: misses
- [any] $y_3 - 3s$.
:::
:::
:::

::: check
kind: parts
given: k = 2..8 int

## $A = \begin{bmatrix}4 & 1\\2 & 3\end{bmatrix}$ has eigenvalues 5 and 2, with eigenvectors $(1, 1)$ and $(1, -2)$.

::: part
answer: 2/3*5^k + 1/3*2^k

### What is the first component of $A^{\given{k}}(1, 0)$?

::: misses
- [any] $(1, 0) = \frac{2}{3}(1, 1) + \frac{1}{3}(1, -2)$.
:::
:::

::: part
answer: 5^k + 2^k

### What is the trace of $A^{\given{k}}$?

::: misses
- [any] The sum of the eigenvalues of $A^k$.
:::
:::
:::

::: check
kind: parts
given: s = 4 | 6; b = 1 | 3

## $S = \begin{bmatrix}\given{s} & \given{b}\\\given{b} & \given{s}\end{bmatrix}$.

::: part
answer: 1/sqrt(s - b)
tolerance: 0.5%

### How long is the longer semi-axis of $\mathbf{x}^TS\mathbf{x} = 1$?

::: misses
- [any] $1/\sqrt{\lambda_{\min}}$, with $\lambda_{\min} = s - b$.
:::
:::

::: part
answer: s
tolerance: 0.5%

### Above what $|b|$ would $S$ stop being positive definite?

::: misses
- [any] $s^2 - b^2 > 0$.
:::
:::
:::

::: check
kind: parts
given: s1 = 30 | 50; s2 = 10 | 20; N = 11 | 101

## A centered data matrix of {N} samples has singular values {s1} and {s2}.

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

### What fraction of the variance does the first principal component explain?

::: misses
- [s1/(s1 + s2)] Variances go as the squares.
- [any] $\frac{\sigma_1^2}{\sigma_1^2 + \sigma_2^2}$.
:::
:::

::: part
answer: s2^2/(N - 1)
tolerance: 0.5%

### What is the variance along the second component?

::: misses
- [any] $\frac{\sigma_2^2}{N - 1}$.
:::
:::
:::

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

## Find the shortest solution of $\given{a}x + \given{b}y = \given{c}$.

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

### What is $y$?

::: misses
- [c/b] That solution sets $x = 0$; it isn't the shortest.
- [any] $\mathbf{x}^+ = \frac{c}{a^2 + b^2}(a, b)$.
:::
:::
:::

::: check
kind: parts
given: V = 5 | 12; R1 = 2 | 3; R2 = 1 | 2; R3 = 3 | 6

## Two meshes: a {V} V source with $R_1$ = {R1} kΩ in mesh 1, $R_2$ = {R2} kΩ shared, and $R_3$ = {R3} kΩ in mesh 2.

::: part
answer: V*R2/((R1 + R2)*(R2 + R3) - R2^2)
unit: mA
tolerance: 0.5%

### What is mesh 2's current?

::: misses
- [any] Cramer's rule on the mesh matrix.
:::
:::

::: part
answer: V*R3/((R1 + R2)*(R2 + R3) - R2^2)
unit: mA
tolerance: 0.5%

### What current flows in the shared resistor?

::: misses
- [any] $i_1 - i_2$.
:::
:::
:::
:::
