ml.lab
Python sleeps until you run code
04 Eigenvectors and eigenvalues

Checkpoint

Eigenvectors and eigenvalues

Twelve questions across the module: finding eigenvectors, what repeated multiplication does, symmetric matrices and singular values. The numbers are new. Work on paper where it helps; the last item is a short piece of code. You pass at 80 percent.

  1. 1

    Which of these are eigenvectors of [320−1]\begin{bmatrix} 3 & 2 \\ 0 & -1 \end{bmatrix}? Select every one.

  2. 2

    The matrix [7−241]\begin{bmatrix} 7 & -2 \\ 4 & 1 \end{bmatrix} has two real eigenvalues. Find the eigenvector for the smaller one, scaled so its first entry is 1.

    v
  3. 3

    You learn that λ=0\lambda = 0 is an eigenvalue of a square matrix A\mathbf{A}. What does that tell you?

  4. 4

    A 3×33 \times 3 matrix has trace 4. Two of its eigenvalues are 2 and −1-1. What is its determinant?

    det
  5. 5

    A matrix A\mathbf{A} has eigenvector (1,1)(1, 1) with eigenvalue 1 and eigenvector (1,−1)(1, -1) with eigenvalue 12\tfrac{1}{2}. Compute A3(3,1)\mathbf{A}^3(3, 1).

    A^3 x
  6. 6

    What is the spectral radius of [0.3−0.40.40.3]\begin{bmatrix} 0.3 & -0.4 \\ 0.4 & 0.3 \end{bmatrix}?

    rho
  7. 7

    A 2×22 \times 2 matrix W\mathbf{W} has eigenvalues 0.50.5 and −1.2-1.2. You multiply a random vector by W\mathbf{W} 60 times. What happens?

  8. 8

    What is the largest singular value of [3400]\begin{bmatrix} 3 & 4 \\ 0 & 0 \end{bmatrix}? Its eigenvalues are 3 and 0.

    sigma 1
  9. 9

    A symmetric 2×22 \times 2 matrix has eigenvalues −4-4 and 2. What are its singular values?

  10. 10

    Centered 2D data has covariance matrix [2225]\begin{bmatrix} 2 & 2 \\ 2 & 5 \end{bmatrix}. What is the first principal component, and what fraction of the variance does it capture?

  11. 11

    You approximate a 512×2048512 \times 2048 weight matrix by its rank-8 truncated SVD, stored as the 8 columns σiui\sigma_i\mathbf{u}_i and the 8 rows vi⊤\mathbf{v}_i^\top. How many numbers do you store?

    numbers
  12. 12
    Code it

    Write gain(A): the largest factor by which the matrix A (any shape) can stretch a vector. Compute it as the square root of the largest eigenvalue of A⊤A\mathbf{A}^\top\mathbf{A}, using np.linalg.eigvalsh. Do not use np.linalg.svd or np.linalg.norm(A, 2).

    ⌘↵ runsPython sleeps until you run code
12 still unanswered. Unanswered questions count as wrong.