Math 343 F12 Day 24

Math 343 Fall 2012 Lecture Day 24 Homework: 6.3 1, 2, 3 (For these three problems only consider parts a, c, e, f), 7 6.3: Diagonalization 1. Suppose that L: R3 → R3 is a linear transformation. Our goal is to figure out whether we can find a basis so that L is a diagonal matrix. [Actually we want to do this for any finite dimension, but it should be clear from this special case how things will work in general.] 2. Why would we want to do that? There are lots of good reasons, but one of them is that sometimes we want to apply the same linear transformation over and over again. If the matrix representing a linear transformation is diagonal, then this is easy to do. Recall that if A represents the linear transformation L, then L(x) = Ax. So L(L(x)) = A(Ax) = A2x and in general, Ln(x) = Anx. So if we want to apply the linear transformation to x a whole bunch of times, we just need to multiply x by a power of A. Usually it is a real y pain to raise a matrix to a power, but it is easy of A is diagonal. 2
⎡ a 0 0 ⎤
⎡ a 0 0 ⎤ ⎡ a 0 0 ⎤ ⎡ a2 0 0 ⎤
⎥
⎢
⎥ =⎢
⎥⎢
⎥=⎢
2
0
b
0
0
b
0
0
b
0
⎢
⎥ 0
b
0
⎢
⎥
⎢
⎥⎢
⎥
⎢⎣ 0 0 c ⎥⎦
⎢⎣ 0 0 c ⎥⎦ ⎢⎣ 0 0 c ⎥⎦ ⎢ 0 0 c 2 ⎥
⎣
⎦
And in general: n
⎡ an 0 0 ⎤
⎡ a 0 0 ⎤
⎥
⎢
⎥ =⎢
n
0
b
0
⎢
⎥ 0
b
0
⎢
⎥
⎢
n ⎥
⎢⎣ 0 0 c ⎥⎦
⎣ 0 0 c ⎦
3. Definition: A square matrix A is said to be diagonalizable if we can find a transition matrix S such that D = S-­‐1AS is diagonal. 4. We have seen one good reason to learn how to diagonalize a matrix. If we work in the new basis (as determined by the transition matrix) then we can easily repeatedly apply the linear transformation. There is another good reason as well: It gives us a way to easily raise any matrix to any power. 5. Suppose that D = S-­‐1AS is diagonal. Then Dn is easy to calculate. Now, if we multiply the right hand side by itself n times, we get Dn = (S-­‐1AS)(S-­‐1AS)(S-­‐1AS )• • • (S-­‐1AS) = S-­‐1AnS. This means that An = SDnS-­‐1. This is very helpful because, for example, we can raise A to the 100th power by raising all the diagonal entries of D to the 100th power and then multiplying three matrices together INSTEAD of multiplying a matrix by itself 100 times! 6. So, now that we have seen some reasons why we might want to diagonalize a matrix, let’s figure out how to do it. 7. Let’s suppose that A is the matrix representing the linear transformation L with respect to the standard bases of R3. Let’s pretend that we are able change the basis so that the matrix, D, for L is actually diagonal and looks like ⎡ a 0 0 ⎤
D = ⎢ 0 b 0 ⎥ . ⎢
⎥
⎣⎢ 0 0 c ⎦⎥
What can we figure out about this new basis? Let’s call it f1, f2, f3. ⎡ 1 ⎤
⎢
⎥
We know that the first basis element is represented by ⎢ 0 ⎥ because f1 = 1f1+0f2 + 0f2. ⎣⎢ 0 ⎦⎥
Now if we apply the linear transformation to this vector (by multiplying it by D) what do we get? ⎡ a ⎤
We get ⎢ 0 ⎥ = af1 . So what kind of vector is f1? ⎢
⎥
⎢⎣ 0 ⎥⎦
That’s right, it is an eigenvector with eigenvalue a! 8. So the way to diagonalize a matrix is to find a basis made out of eigenvectors! Let’s do two examples. One that works, one that doesn’t. 9. Example 1: It works! ⎡ 1 2 0 ⎤
Let A = ⎢ 0 3 0 ⎥ ⎢
⎥
⎢⎣ 2 −4 2 ⎥⎦
⎡ 1− λ
2
0
A – λI = ⎢ 0
3− λ
0
⎢
−4 2 − λ
⎣⎢ 2
⎡
⎢
⎢
⎢⎣
⎤
⎥ ⎥
⎥⎦
Det(A – λI) = (2-­‐λ)(1-­‐λ)(3-­‐λ). So we have eigenvalues 1, 2, and 3. Let’s find the eigenvectors! For λ=1: We want the null space of ⎡ 0 2 0 ⎤
⎢
⎥ ⎢ 0 2 0 ⎥
⎢⎣ 2 −4 1 ⎥⎦
So let’s solve: 2y = 0 2x -­‐4y + z = 0 This gives y = 0 and z = -­‐2x. So the elements of the null space look like ⎡ 1 ⎤
⎡ 1 ⎤
x ⎤ ⎡ x ⎤
⎥ ⎢
⎥
⎢
⎥
y ⎥=
= x 0 so the eigenspace for 1 is spanned by the eigenvector ⎢ 0 ⎥ . ⎢ 0 ⎥
⎢
⎥
⎢
⎥
z ⎥⎦ ⎢⎣ −2x ⎥⎦
⎢⎣ −2 ⎥⎦
⎢⎣ −2 ⎥⎦
⎡
⎢
⎢
⎢⎣
⎡
⎢
⎢
⎢⎣
For λ=2: We want the null space of ⎡ −1 2 0 ⎤
⎢
⎥ ⎢ 0 1 0 ⎥
⎣⎢ 2 −4 0 ⎦⎥
So let’s solve: -­‐x + 2y = 0 y = 0 2x -­‐4y = 0 This gives y = 0 and x = 0. So the elements of the null space look like ⎡ 0 ⎤
⎡ 0 ⎤
x ⎤ ⎡ 0 ⎤
⎥ ⎢
⎥
⎢
⎥
y ⎥ = 0 = z 0 so the eigenspace for 1 is spanned by the eigenvector ⎢ 0 ⎥ . ⎢
⎥
⎢
⎥
⎢
⎥
z ⎥⎦ ⎣⎢ z ⎦⎥
⎣⎢ 1 ⎦⎥
⎣⎢ 1 ⎥⎦
For λ=3: We want the null space of ⎡ −2 2 0 ⎤
⎢
⎥
0 0 ⎥ ⎢ 0
⎣⎢ 2 −4 −1 ⎦⎥
So let’s solve: -­‐2x + 2y = 0 2x -­‐4y -­‐z= 0 This gives x = y and z = -­‐2x. So the elements of the null space look like ⎡ 1 ⎤
⎡ 1 ⎤
x ⎤ ⎡ x ⎤
⎥ ⎢
⎥
⎢
⎥
y ⎥=
= x 1 so the eigenspace for 1 is spanned by the eigenvector ⎢ 1 ⎥ . ⎢ x ⎥
⎢
⎥
⎢
⎥
z ⎥⎦ ⎢⎣ −2x ⎥⎦
⎢⎣ −2 ⎥⎦
⎢⎣ −2 ⎥⎦
⎧⎡ 1 ⎤ ⎡ 0 ⎤ ⎡ 1 ⎤ ⎫
⎪
⎪
So the basis we want is: ⎨ ⎢ 0 ⎥ , ⎢ 0 ⎥ , ⎢ 1 ⎥ ⎬ ⎢
⎥ ⎢
⎥ ⎢
⎥
⎪ ⎢ −2 ⎥ ⎢ 1 ⎥ ⎢ −2 ⎥ ⎪
⎦ ⎣
⎦ ⎣
⎦⎭
⎩⎣
⎡ 1 0 1 ⎤
and the transition matrix is S = ⎢ 0 0 1 ⎥ ⎢
⎥
⎣⎢ −2 1 −2 ⎦⎥
⎡ 1 −1 0 ⎤
⎥ ⎢ 2 0 1 ⎥
⎢⎣ 0 1 0 ⎥⎦
Then S-­‐1 = ⎢
⎡ 1 −1 0 ⎤ ⎡ 1 2 0 ⎤ ⎡ 1 0 1 ⎤ ⎡ 1 0 0 ⎤
⎥⎢
⎥⎢
⎥ = ⎢
⎥ ⎢ 2 0 1 ⎥⎢ 0 3 0 ⎥⎢ 0 0 1 ⎥ ⎢ 0 2 0 ⎥
⎢⎣ 0 1 0 ⎥⎦ ⎣⎢ 2 −4 2 ⎥⎦ ⎢⎣ −2 1 −2 ⎦⎥ ⎢⎣ 0 0 3 ⎦⎥
Then D = S-­‐1AS = ⎢
Yay! ⎡ 1 2 0 ⎤
And now we will be fancy and compute ⎢ 0 3 0 ⎥
⎢
⎥
⎢⎣ 2 −4 2 ⎥⎦
by itself 999 times! 999
999
. Let’s not multiply this matrix ⎡ 1 2 0 ⎤
We know that ⎢ 0 3 0 ⎥ = SD999S-­‐1 ⎢
⎥
⎢⎣ 2 −4 2 ⎥⎦
0
0 ⎤ ⎡ 1 −1 0 ⎤
⎡ 1 0 1 ⎤⎡ 1
⎢
⎥⎢
⎥
= ⎢ 0 0 1 ⎥ ⎢ 0 2 999
0 ⎥ ⎢ 2 0 1 ⎥ . ⎢
⎥
⎢⎣ −2 1 −2 ⎥⎦ ⎢⎣ 0
0
3999 ⎥⎦ ⎢⎣ 0 1 0 ⎥⎦
Then we just multiply this out. Easy peasy (but with BIG numbers). 10. Example 2: Doesn’t work  ⎡ 4 0 −1 ⎤
Let A = ⎢ 0 3 0 ⎥ ⎢
⎥
⎣⎢ 1 0 2 ⎦⎥
⎡ 4−λ
0
−1 ⎤
⎢
⎥
A – λI = 3− λ
0 ⎥ ⎢ 0
0
2 − λ ⎥⎦
⎢⎣ 1
Det(A – λI) = (3-­‐λ)[(4-­‐ λ)(2-­‐ λ)+1] = (3-­‐λ)(λ2 -­‐6λ + 9) = (3-­‐λ)(3-­‐λ)(3-­‐λ). ⎡
⎢
⎢
⎢⎣
So we have one eigenvalue λ = 3. Let’s see how maybe eigenvectors we can find for this eigenvalue. We want to find the null space of ⎡ 1 0 −1 ⎤
⎢
⎥ ⎢ 0 0 0 ⎥
⎣⎢ 1 0 −1 ⎦⎥
So let’s solve: x – z = 0. This gives x = z, so the null space vectors look like: ⎡ 0 ⎤ ⎡ 1 ⎤
x ⎤ ⎡ z ⎤ ⎡ 0 ⎤ ⎡ z ⎤
⎥ ⎢
⎥ ⎢
⎥
⎢
⎥
y ⎥ = ⎢ y ⎥ = ⎢ y ⎥ + ⎢ 0 ⎥ = y ⎢ 1 ⎥ + z ⎢ 0 ⎥ ⎢
⎥ ⎢
⎥
z ⎥⎦ ⎢⎣ z ⎥⎦ ⎢⎣ 0 ⎥⎦ ⎢⎣ z ⎥⎦
⎢⎣ 0 ⎥⎦ ⎢⎣ 1 ⎥⎦
⎡ 0 ⎤
⎡ 1 ⎤
⎢
⎥
so the eigenspace for 1 is spanned by the eigenvectors 1 and ⎢ 0 ⎥ . ⎢
⎥
⎢
⎥
⎢⎣ 0 ⎥⎦
⎢⎣ 1 ⎥⎦
This DOES NOT give us a full basis of R3 made up of eigenvectors. So this matrix isn’t diagonalizable. In this case, we say that the matrix is defective. For fun, let’s extend this to a basis and see what kind of matrix we get with the resulting ⎡ 0 ⎤
change of basis. Let’s just add in the vector ⎢ 0 ⎥ . ⎢
⎥
⎣⎢ 1 ⎦⎥
⎡ 0 1 0 ⎤
⎡ 0 1 0 ⎤
⎢
⎥
-­‐1
This gives us S = 1 0 0 and this gives us S = ⎢ 1 0 0 ⎥ ⎢
⎥
⎢
⎥
⎣⎢ 0 1 1 ⎦⎥
⎣⎢ −1 0 1 ⎦⎥
⎡ 0 1 0 ⎤ ⎡ 4 0 −1 ⎤ ⎡ 0 1 0 ⎤ ⎡ 3 0 0 ⎤
-­‐1
So we get B = S AS = ⎢ 1 0 0 ⎥ ⎢ 0 3 0 ⎥ ⎢ 1 0 0 ⎥ = ⎢ 0 3 −1 ⎥ ⎢
⎥⎢
⎥⎢
⎥ ⎢
⎥
⎣⎢ −1 0 1 ⎦⎥ ⎣⎢ 1 0 2 ⎦⎥ ⎣⎢ 0 1 1 ⎦⎥ ⎣⎢ 0 0 3 ⎦⎥
Notice that we don’t get a diagonal matrix, but we do get a little 2x2 diagonal block in the upper left corner. 11. An application of diagonalization: Markov processes. Definition: A stochastic process is a sequence of experiments for which the outcome at any stage depends on chance. A Markov process is a stochastic process with the following properties: I.
II.
III.
The set of possible outcomes or states is finite. The probability of the next outcome depends only on the previous outcome. The probabilities are constant over time. 12. Example (Bus usage): Suppose that there was a study conducted on the usage of public busses in Portland. After looking at several years of data it was found that 30% of people that regularly ride the bus in a given year do not ride the bus regularly the next year. It was also found that 20% of the people who do not ride the bus regularly one year go on to ride the bus regularly the next year. Suppose that there are 200,000 regular bus riders in Portland this year and 400,000 people who do not ride the bus regularly. How many people will ride the bus next year? How many in two years? How many will ride the bus 1000 years from now? The number of riders next year is given by .7(200,000) + .2(400,000) The number of non-­‐riders next year is given by .3(200,000) + .8(400,000) We can get the distribution of riders/non-­‐riders using matrix multiplication! ⎡ riders
⎤ ⎡ .7 .2 ⎤ ⎡ 200000 ⎤ ⎡ 220000 ⎤
⎢ non − riders ⎥ = ⎢ .3 .8 ⎥ ⎢ 400000 ⎥ = ⎢ 380000 ⎥ ⎣
⎦ ⎣
⎦⎣
⎦ ⎣
⎦
If we know the number of riders/non-­‐riders any given year, we just multiply by the ⎡ .7 .2 ⎤
matrix ⎢
⎥ to find the number of riders/non-­‐riders the next year. ⎣ .3 .8 ⎦
If we want to know the numbers after two years, we just multiply once and then multiply the answer by the matrix again. So we would do: ⎡ riders
⎤ ⎡ .7 .2 ⎤ ⎛ ⎡ .7 .2 ⎤ ⎡
⎢ non − riders ⎥ = ⎢ .3 .8 ⎥ ⎜ ⎢ .3 .8 ⎥ ⎢
⎣
⎦ ⎣
⎦⎝ ⎣
⎦⎣
But this is the same as multiplying ⎛ ⎡ .7 .2 ⎤ ⎡ .7 .2 ⎤⎞ ⎡ 200000 ⎤ ⎡
⎜ ⎢ .3 .8 ⎥ ⎢ .3 .8 ⎥⎟ ⎢ 400000 ⎥ = ⎢
⎝⎣
⎦⎣
⎦⎠ ⎣
⎦ ⎣
200000 ⎤⎞
⎥ 400000 ⎦⎟⎠
2
.7 .2 ⎤ ⎡ 200000 ⎤
⎥ ⎢
⎥ .3 .8 ⎦ ⎣ 400000 ⎦
And it follows that to find the distribution after 1000 years we just multiply our starting 1000
⎡ 200000 ⎤
⎡ .7 .2 ⎤
state ⎢
⎥ by ⎢
⎥
400000
.3
.8
⎣
⎦
⎣
⎦
So we just have to multiply this matrix by itself 1000 times! OR we could try to diagonalize it! So we need to find the eigenvalues. ⎡ .7 − λ
.2 ⎤
A – λI = ⎢
⎥ .8 − λ ⎦
⎣ .3
Det (A – λI) = (.8-­‐λ)(.7-­‐λ)-­‐.06 = .56 – 1.5λ + λ2 -­‐ .06 = λ2 -­‐ 1.5λ + .5 = (λ -­‐ 1) (λ -­‐ .5) So the eigenvalues are 1 and .5. Let’s find some eigenvectors. ⎡ −.3 .2 ⎤
For λ = 1 we need the null space of ⎢
⎥ .3
−.2
⎣
⎦
So solve -­‐.3x + .2y = 0. This gives y = 3/2 x. So the eigenvectors look like ⎡ x ⎤ ⎡ x ⎤ 1 ⎡ 2 ⎤
⎡ 2 ⎤
. So, the eigenspace for λ = 1 has basis ⎢
⎢
⎥ = ⎢ 3 ⎥ = 2 x⎢
⎥ . ⎥
⎢⎣ y ⎥⎦ ⎢⎣ 2 x ⎥⎦
⎣ 3 ⎦
⎣ 3 ⎦
⎡ .2 .2 ⎤
For λ = .5 we need the null space of ⎢
⎥ ⎣ .3 .3 ⎦
So solve .2x + .2y = 0. This gives y = -­‐x. So the eigenvectors look like ⎡ x ⎤ ⎡ x ⎤
⎡ 1 ⎤
⎡ 1 ⎤
= x⎢
. So, the eigenspace for λ = 1 has basis ⎢
⎢
⎥=⎢
⎥
⎥
⎥ . ⎢⎣ y ⎥⎦ ⎣ −x ⎦
⎣ −1 ⎦
⎣ −1 ⎦
⎡ 2 1 ⎤
⎡ .2 .2 ⎤
This gives us S = ⎢
⎥ and S-­‐1 = ⎢
⎥ . ⎣ 3 −1 ⎦
⎣ .6 −.4 ⎦
⎡ .2 .2 ⎤ ⎡ .7 .2
So D = S-­‐1AS = ⎢
⎥⎢
⎣ .6 −.4 ⎦ ⎣ .3 .8
More importantly: 0
⎡ 2 1 ⎤⎡ 1
An = SDnS-­‐1 = ⎢
⎥⎢
n
⎣ 3 −1 ⎦ ⎢⎣ 0 (.5)
⎤⎡ 2 1 ⎤ ⎡ 1 0 ⎤
⎥⎢
⎥ = ⎢
⎥ ⎦ ⎣ 3 −1 ⎦ ⎣ 0 .5 ⎦
⎤ ⎡ .2 .2 ⎤
⎥⎢
⎥ . ⎥⎦ ⎣ .6 −.4 ⎦
⎡ 2 1 ⎤ ⎡ 1 0 ⎤ ⎡ .2 .2 ⎤
This means that as n gets larger An approaches ⎢
⎥⎢
⎥⎢
⎥ = ⎣ 3 −1 ⎦ ⎣ 0 0 ⎦ ⎣ .6 −.4 ⎦
⎡ 2 0 ⎤ ⎡ .2 .2 ⎤ ⎡ .4 .4 ⎤
⎢
⎥⎢
⎥ = ⎢
⎥ . ⎣ 3 0 ⎦ ⎣ .6 −.4 ⎦ ⎣ .6 .6 ⎦
So that after a large number of years the distributions of riders/non-­‐riders will be approximately ⎡ .4 .4 ⎤ ⎡ 200000 ⎤ ⎡ 240000 ⎤
⎢
⎥⎢
⎥ = ⎢
⎥ . ⎣ .6 .6 ⎦ ⎣ 400000 ⎦ ⎣ 360000 ⎦
So after 1000 years we would expect something pretty close to 240,000 riders and 360,000 non-­‐riders. So we might have to buy a new bus at some point. ⎡ 240000 ⎤
The vector ⎢
⎥ is called the steady-­‐state vector for the Markov process. ⎣ 360000 ⎦