---
title: Problem set 7
heading: "Problem set 7: iterative solvers, eigenvalues and nonlinear systems"
eyebrow: A13 · Problem set 7
type: problems
---

::: hook
These problems use lessons 27 to 34: Jacobi, Gauss–Seidel and SOR; conjugate gradients; power and inverse iteration; the QR algorithm; and Newton's method for systems, including circuits.
:::

::: pool
pick: 12

::: check
kind: parts
given: N = 40 | 120; d = 6 | 9

## The model problem on an {N} × {N} grid, to {d} digits.

::: part
answer: d*ln(10)/(-2*ln(cos(pi/N)))
tolerance: 1%

### How many Gauss–Seidel sweeps?

::: misses
- [any] $\rho_{GS} = \cos^2(\pi/N)$.
:::
:::

::: part
answer: d*ln(10)/(-ln(2/(1 + sin(pi/N)) - 1))
tolerance: 1%

### How many SOR sweeps at $\omega_{opt}$?

::: misses
- [any] $\rho = \omega_{opt} - 1$.
:::
:::
:::

::: check
kind: parts
given: a = 4 | 6; b1 = 5 | 7; b2 = 2 | 9

## $\given{a}x_1 + x_2 = \given{b1}$, $x_1 + \given{a}x_2 = \given{b2}$, from (0, 0).

::: part
answer: b2/a
tolerance: 0.1%

### After one Jacobi sweep, what's $x_2$?

::: misses
- [any] Uses the old $x_1 = 0$.
:::
:::

::: part
answer: (b2 - b1/a)/a
tolerance: 0.1%

### After one Gauss–Seidel sweep, what's $x_2$?

::: misses
- [any] Uses the new $x_1 = b_1/a$.
:::
:::
:::

::: check
kind: parts
given: N = 10 | 25 | 50 | 64 | 100 | 200

## SOR on a {N} × {N} grid.

::: part
answer: 2/(1 + sin(pi/N))
tolerance: 0.01%

### What's $\omega_{opt}$?

::: misses
- [any] $\frac{2}{1 + \sin(\pi/N)}$.
:::
:::

::: part
answer: 2/(1 + sin(pi/N)) - 1
tolerance: 0.01%

### What's the spectral radius there?

::: misses
- [any] $\omega_{opt} - 1$.
:::
:::
:::

::: check
kind: parts
given: k = 100 | 400 | 2500 | 10000 | 40000 | 1000000

## A system with κ = {k}.

::: part
answer: (k - 1)/(k + 1)
tolerance: 0.01%

### Steepest descent's factor per step?

::: misses
- [any] $\frac{\kappa - 1}{\kappa + 1}$.
:::
:::

::: part
answer: sqrt(k)/2*ln(2*10^6)
tolerance: 2%

### About how many CG steps for $10^{-6}$?

::: misses
- [any] $\frac{\sqrt\kappa}{2}\ln\frac2\varepsilon$.
:::
:::
:::

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

## CG on $\begin{pmatrix}\given{a} & 1\\ 1 & 2\end{pmatrix}x = \begin{pmatrix}\given{b1}\\ \given{b2}\end{pmatrix}$ from zero.

::: part
answer: (b1^2 + b2^2)/(a*b1^2 + 2*b1*b2 + 2*b2^2)
tolerance: 0.1%

### What's $\alpha_0$?

::: misses
- [any] $\frac{b^Tb}{b^TAb}$.
:::
:::

::: part
answer: (2*b1 - b2)/(2*a - 1)
tolerance: 0.1%

### Where does CG end up after two steps: what's $x_1$ of the solution?

::: misses
- [any] Two steps solve a 2 × 2 exactly.
:::
:::
:::

::: check
kind: parts
given: l1 = 6 | -9; l2 = 2 | 5; d = 8 | 12

## A matrix's two largest eigenvalues are {l1} and {l2}.

::: part
answer: abs(l2/l1)
tolerance: 0.5%

### What's power iteration's ratio?

::: misses
- [any] $\lvert\lambda_2/\lambda_1\rvert$.
:::
:::

::: part
answer: d/log(abs(l1/l2))
tolerance: 1%

### About how many steps for {d} digits in the eigenvector?

::: misses
- [any] $d/\log_{10}\lvert\lambda_1/\lambda_2\rvert$.
:::
:::
:::

::: check
kind: parts
given: s = 1.8 | 4.4; a = 2 | 4; x = 1 | 3

## Eigenvalues 1, 2 and 5; inverse iteration with σ = {s}. Then a Rayleigh quotient.

::: part
answer: step(3 - s)*abs(2 - s)/abs(1 - s) + step(s - 3)*abs(5 - s)/abs(2 - s)
tolerance: 0.5%

### What's the inverse-iteration ratio?

::: misses
- [any] Nearest over next nearest.
:::
:::

::: part
answer: (a*x^2 + 2*x + a)/(x^2 + 1)
tolerance: 0.1%

### Rayleigh quotient of ({x}, 1) for $\begin{pmatrix}\given{a} & 1\\ 1 & \given{a}\end{pmatrix}$?

::: misses
- [any] $\frac{v^TAv}{v^Tv}$.
:::
:::
:::

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

## One unshifted QR step on $\begin{pmatrix}\given{a} & \given{b}\\ \given{b} & \given{d}\end{pmatrix}$.

::: part
answer: a + b^2*(a + d)/(a^2 + b^2)
tolerance: 0.1%

### What's the new (1, 1) entry?

::: misses
- [any] $a + \frac{b^2(a + d)}{a^2 + b^2}$.
:::
:::

::: part
answer: b*(a*d - b^2)/(a^2 + b^2)
tolerance: 0.1%

### What's the new off-diagonal?

::: misses
- [any] $\frac{b(ad - b^2)}{a^2 + b^2}$.
:::
:::
:::

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

## The symmetric matrix ({a}, {b}; {b}, {d}).

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

### What's its larger eigenvalue?

::: misses
- [any] From the trace and determinant.
:::
:::

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

### By what factor does unshifted QR shrink the off-diagonal per step?

::: misses
- [any] The smaller eigenvalue's size over the larger's.
:::
:::
:::

::: check
kind: parts
given: R = 20 | 100; L = 2 | 5; n = 300 | 3000; g = 50 | 200

## Poles and cost.

::: part
answer: -R/(2*L*1e-3)
unit: s^-1
tolerance: 0.5%

### A series RLC with R = {R} Ω and L = {L} mH, underdamped: real part of its poles?

::: misses
- [any] $-R/(2L)$.
:::
:::

::: part
answer: 10*n^3/(g*1e9)
unit: s
tolerance: 1%

### All eigenvalues of a dense {n} × {n} matrix at {g} GFLOP/s?

::: misses
- [any] About $10n^3$ operations.
:::
:::
:::

::: check
kind: parts
given: V = 0.58 | 0.6 | 0.62 | 0.65 | 0.68 | 0.7

## A diode ($I_s = 10^{-14}$ A, $nV_T$ = 25.85 mV) linearized at {V} V.

::: part
answer: 1e-14/0.02585*exp(V/0.02585)*1000
unit: mS
tolerance: 0.5%

### What's $g_d$?

::: misses
- [any] $\frac{I_s}{nV_T}e^{V/nV_T}$.
:::
:::

::: part
answer: (1e-14*(exp(V/0.02585) - 1) - 1e-14/0.02585*exp(V/0.02585)*V)*1000
unit: mA
tolerance: 0.5%

### What's $I_{eq}$?

::: misses
- [any] $I_d - g_dV$.
:::
:::
:::

::: check
kind: parts
given: x = 0.5 | 2; y = 1 | 2; n = 20 | 2000

## Newton for $F = (x^2 + y^2 - 4,\; e^x + y - 1)$, and Jacobian cost.

::: part
answer: 2*x - 2*y*exp(x)
tolerance: 0.1%

### What's det J at ({x}, {y})?

::: misses
- [any] $2x - 2ye^x$.
:::
:::

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

### How many F evaluations does a forward-difference Jacobian take for n = {n}, counting the current point?

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

::: check
kind: parts
given: d = 1 | 2 | 3

## A multigrid V-cycle in {d} dimensions with one sweep per level.

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

### How many fine-grid sweeps' worth of smoothing does it cost?

::: misses
- [any] Sum the geometric series of level sizes.
:::
:::
:::

::: check
kind: parts
given: s = 20 | 100; r = 0.5 | 0.8; k = 4 | 10

## A matrix's singular values fall geometrically: $\sigma_i = \given{s}r^{i-1}$ with r = {r}.

::: part
answer: s*r^k
tolerance: 0.5%

### What is the 2-norm error of the best rank-{k} approximation?

::: misses
- [s*r^(k - 1)] That's $\sigma_k$; the error is $\sigma_{k+1}$.
- [any] $\sigma_{k+1}$.
:::
:::
:::

::: check
kind: parts
given: x = 1 | 2; y = -1 | 1

## Newton's method on $F = (x^2 + y^2 - 4,\; e^x + y - 1)$ at ({x}, {y}).

::: part
answer: 2*x - 2*y*exp(x)
tolerance: 0.5%

### What is the Jacobian's determinant?

::: misses
- [any] $\det\begin{pmatrix}2x & 2y\\ e^x & 1\end{pmatrix}$.
:::
:::
:::
:::
