Link to this document's Jupyter Notebook

In order to successfully complete this assignment you must do the required reading, watch the provided videos and complete all instructions. The embedded survey form must be entirely filled out and submitted on or before 11:59pm on on the day before class. Students must come to class the next day prepared to discuss the material covered in this assignment.


Readings for this topic (Recommended in bold)

Pre-Class Assignment: Diagonalization and Powers

Goals for today's pre-class assignment

  1. Eigenvalues and eigenvectors review
  2. Diagonalizable Matrix
  3. Assignment wrap-up

1. Eigenvalues and eigenvectors review

Definition: A non-zero vector $x$ in $R^n$ is called an eigenvector of a $n\times n$ matrix $A$ if $Ax$ is a scalar multiple of $x$. If $Ax = \lambda x$, then $\lambda$ is called the eigenvalue of $A$ corresponding to $x$.

Steps for finding the eigenvalues and eigenvectors

We want to find $\lambda$ and non-zero vector $x$ such that $Ax=\lambda x$ for a $n\times n$ matrix.

  1. We introduce an identity matrix $I$ of $n\times n$. Then the equation becomes $$Ax = \lambda I x$$ $$Ax-\lambda I x = 0$$ $$(A-\lambda I)x = 0$$
  2. This suggests that we want to find $\lambda$ such that $(A-\lambda I)x=0$ has a non-trivial solution. It is equivalent to that the matrix $A-\lambda I$ is singular, i.e., has a determinant of $0$. $$|A-\lambda I|=0$$
  3. The determinant is polynomial in $\lambda$ (called the characteristic polynomial of $A$) with degree $n$. We solve this equation (called the characteristic equation) for all possible $\lambda$ (eigenvalues).
  4. After finding the eigenvalues, we substitute them back into $$(A-\lambda I)x=0$$ and find the eigenvectors $x$.

Let's calculate eigenvalues for the following matrix:

$$ A=\begin{bmatrix} 0 & 0 & -2 \\ 1 & 2 & 1 \\ 1 & 0 & 3 \end{bmatrix}$$

Find eigenvalues

Looking at the above recipe, let's solve the problem symbollically using sympy. First lets create a matrix $B$ such that:

$$B = A-\lambda I$$

Now, per step 2, the determinate of $B$ must be zero. Note that sympy calculates the determinate symbollically as follows:

Do This: Using the sympy.solve function on the determinate of $B$ to solve for lam ($\lambda$). Verify that the solution to the last question produces the same eigenvalues as above.

Do This: First, let's use the built in funciton eigenvals function in sympy to calculate the eigenvalues. Find out the meaning of the output.

Explain your output here.

Find eigenvectors

Now we know the eigenvalues, we can substitue them back into the equation to find the eigenvectors.
We solve this symbollically using sympy. First let's make a vector of our eigenvalues (from above):

Now (per step 4 above) we need to solve the equation $(A-\lambda I)x=0$. One way to do this in sympy is as follows:

QUESTION: Explain your output here. (Hint, you can also try the rref to find the solutions)

Put your answer here

Do This: Next, let's use the eigenvects function in sympy to find three linear independent eigenvectors for the matrix $A$?

QUESTION: Compare this answer to the eigenvectors we calculated above. Does this answer make sense? What does the syntax tell us?

Put your answer here

DO THIS: Find the eigenvalues and eigenvectors of the following matrix: $$ A2=\begin{bmatrix} 2 & 1 \\ 0 & 2 \end{bmatrix}$$

QUESTION: What are the eigenvalues for the matrix $A2$?

Put your answer to the above question here

QUESTION: What are the eigenvectors for the matrix $A2$?

Put your answer to the above question here


2. Diagonalizable Matrix

In class we will be using matrix diagonalization to solve some problems.

Matrix $A$ is diagonalizable if there exists a diagonal matrix $D$ that is similar similar to $A$:

$$ D = C^{-1}AC$$

If matrix $A$ has linearly independent eigenvectors ($v_1, \ldots v_n$) then $A$ is diagonalizable with the following solution:

$$C = \left[ v_1^T, \ldots, v_n^T \right]$$

In other words, each column of $C$ is a linearly independent eigenvector of $A$. The diagonal matrix $D$ is

$$ D = \left[ \begin{matrix} \lambda_1 & 0 & 0 \\ 0 & \ddots & 0 \\ 0 & 0 & \lambda_n \end{matrix} \right] $$

In other-other words, $D$ consists of the corresponding eigenvalues.

DO THIS: Using numpy, Diagonalize (i.e. calculate C and D) the following matrix:

DO THIS: Verify that $A$ is in fact Diagonalizable by calculating $D2 = C^{-1}AC$ and comparing it to your original $D$ using np.allclose.

Diagonalization of Symmetric Matrices

One special case is Symmetric Matrices. It can be shown that symmetric Matrices are Diagonalizable and the resulting eigenvectors are not only linearly independent but also orthogonal. Since this is true, the equation changes to:

$$ D = C^{T}AC$$

QUESTION: Why do we care if $C$ is orthogonal? What advantages does the above equation give us?

Put your answer to the above question here.


3. Assignment wrap-up

Please fill out the form that appears when you run the code below. You must completely fill this out in order to receive credit for the assignment!

Direct Link to Google Form

If you have trouble with the embedded form, please make sure you log on with your MSU google account at googleapps.msu.edu and then click on the direct link above.

Assignment-Specific QUESTION: Why do we care if $C$ is orthogonal? What advantages does the above equation give us?

Put your answer to the above question here

QUESTION: Summarize what you did in this assignment.

Put your answer to the above question here

QUESTION: What questions do you have, if any, about any of the topics discussed in this assignment after working through the jupyter notebook?

Put your answer to the above question here

QUESTION: How well do you feel this assignment helped you to achieve a better understanding of the above mentioned topic(s)?

Put your answer to the above question here

QUESTION: What was the most challenging part of this assignment for you?

Put your answer to the above question here

QUESTION: What was the least challenging part of this assignment for you?

Put your answer to the above question here

QUESTION: What kind of additional questions or support, if any, do you feel you need to have a better understanding of the content in this assignment?

Put your answer to the above question here

QUESTION: Do you have any further questions or comments about this material, or anything else that's going on in class?

Put your answer to the above question here

QUESTION: Approximately how long did this pre-class assignment take?

Put your answer to the above question here


Congratulations, we're done!

Course Resources:


Written by Dr. Dirk Colbry, Michigan State University Creative Commons License
This work is licensed under a Creative Commons Attribution-NonCommercial 4.0 International License.