So last example when we diagonal is the matrix, it turns out that we were given P. And all we needed to do was find P inverse. We were also given D, the diagonal matrix. In most situations were not given P were not given D, were just given a matrix. And we're asked if you can diagonal is this matrix go ahead and do it. And this is the situation that we find ourselves in now. And in order to diagonalize this matrix, we're going to use concepts that we learned in the second course limit for linear algebra. So whether you took the course or not, you would need some foundational linear algebra to be going forward at this point. So here we have a three by three matrix and we are asked to diagonalize the matrix. And in order to do that you need to find the characteristic polynomial. You need to find the eigen values and you need to find their corresponding eigen vectors. Now, since we covered this in course two, I'm not going to go over doing it again. You should feel comfortable finding eigen values and eigen vectors for sure. It is a very important thing in data science or really any subject that uses linear algebra in the least, eigen values and eigen vectors are extremely important. So it's a great review to stop now. Take this matrix and try to figure out, can I do a characteristic polynomial, can I do eigen values, eigenvectors. Yeah, so try to figure it out but either way when you do it, hopefully you get to this solution. Which is my three eigen values which is 1,-2, -2. When you find the characteristic polynomial you'll have lambda plus two squared. So I have a double eigen value here and then I chose these eigen vectors that are corresponding to each eigen value. So for lambda equals one, you get this eigen vector for lambda two equals negative two, chose this, I can vector and then so on. So I have my three eigen values my three eigen vectors. Again, you should feel comfortable getting to this point on your own. Now how do we diagonalize A knowing that we have I can values and eigen vectors for the matrix. So it turns out that if we have A. And we want to decompose it into this forum which we've been working with the last few lessons. P and D will come specifically from my eigen values and eigen vectors. So for P and for D, for D I'll have my eigen values. So 1, -2, -2 0, it's a diagonal matrix, so it has to have zeros over. So my diagonal matrix is made up of eigen values of my original matrix. Now P, that's made up of corresponding respective eigen vectors. So since I put an eigen value of one in this first spot, I'll need the corresponding eigen vector in the first column. So since I put it 1 -2 -2, we'll need this order. So I'll have 1,-1,1, -1,1,0 and -1, 0, 1. Now being able to compute P inverse is also something that we learned in course two, which is computing the inverse of a matrix. So once we do that, we'll have this general form and we'll be able to plug in P, which we know already D. Which we know already and P inverse, which we should be able to compute somewhat quickly. So that's how you diagonalize a matrix, given pretty much nothing but the original matrix.