In this example, we're going to work with a matrix that we have diagonal lines, and
we're going to show how that diagonal representation makes it much easier to compute it raised
to some arbitrary power.
So we're going to work with a matrix A, but A has been factored in a very special way.
It's been factored in this way right here.
It's been written as a matrix P times the matrix D times the same matrix P but inverted,
so PDP inverse is the representation.
And we're actually told in this problem that P is equal to 2, 1, 1, 3, so it's a 2 by 2
matrix.
D is a diagonal matrix.
And actually, anytime you work with this kind of diagonal representation, D is always an
actual matrix, and that's why we call it D for diagonal, OK?
So if we actually multiply these things out, P and D times P inverse, we can figure out
what A is, and we'll do that here in a minute.
What we're going to do is we would like to know what A to the fifth is.
So what is A to the 5th?
So A times A times A times A times A, multiply A by itself five times.
So as a first step, let's actually go ahead and compute what P inverse is and figure out
what A is.
So remember for a 2 by 2 matrix, computing the inverse is pretty easy.
All you have to do is divide by the determinant.
That's the determinant right there, A times D minus B times C, all right?
So divide by the determinant, flip these two elements.
So A took the spot of B and D took the spot of A, and then negate these two elements.
So B turned into minus B, and C turned into minus C.
So this is just a rule you should remember or be familiar with somewhat, hopefully.
Given this rule, we can just do a write down for what P inverse is.
I need to divide by 2 times 3 minus 1 times 1, 2 times 3 is 6, 6 minus will be 5.
I need to flip A and D, in this case, that's 2 and 3.
So I did have a 2 here and a 3 here, that's become a 3 here and it 2 here.
I flip those locations.
And then previously, I had 1 and 1.
I need to negate those, so that will be minus 1 and minus 1.
So that simplifies 2.6, right?
3 over 5 is 0.6, and negative 1 over 5 is a negative point 2, and negative 1 over 5
is negative 0.2, and 2 over 5 is 0.4.
So this is what the matrix p inverse is equal to.
And now, let's go ahead multiply out P times D times P inverse.
There's P, there's D, there's P inverse.
If you plug this into your calculator, or go to Wolfram, or use Matlab, or something,
you get this matrix right here.
So the matrix A that we're working with is actually this 2 by 2 matrix.
And our goal is to compute A to the fifth.
Now honestly, given a calculator, it's pretty easy to put this in.
Hit Enter a few times to replicate it five times, put multiply, multiply it out, it's
not too bad to do this computation right here on a calculator, which will mean multiply
matrix A times itself five times.
If you're doing this by hand, this right here would obviously be pretty tedious, all right?
So in some ways, what we're talking about here are some tricks to make your life simpler.
You can try to do something by hand, but also, it's just some more general efficient ways
that are sometimes handy when doing algebra on pen and paper or even do an algorithm sometimes
as factorization can be handy.
So instead of doing things this way, which is what I would call the brute force way and
tedious, let's think of a more clever way to actually do this.
So let's do it a different way.
So let's think about A to the 5 as a times itself five times, obviously.
But let's use the diagonalization factorization that we were provided.
A is PDP inverse.
So I can also think about doing A to the fifth as performing this operation, right here right,
PDP inverse times itself five times.
Well, something very interesting happens when you write it out this way.
Look at all these things that pair up.
P inverse times P is the identity matrix.
This P inverse times P gives me the identity matrix.
So this P inverse times P gives me an identity matrix.
This P inverse times P gives me a identity matrix as well.
So all of these things that I'm grouped here with the little blue arrows actually turned
into identity.
And when I multiply a matrix D by identity, I just get D itself.
So all of this simplifies to P times this D and that D right here.
And then what's next?
That goes away.
That right here this is the identity matrix.
So I have another D, and then I have another D, and then I have another D, and then finally,
I have the last P inverse.
This P inverse right here doesn't pair up with anybody and cancel, so it's left.
So it's interesting.
So if I use the nationalization representation, I'm actually left with this, which is a lot
simpler to look at than this up here, obviously.
D times itself 5 times is D to the fifth, so I have D to the fifth.
So actually A to the fifth can be written as P times the D to the fifth P inverse.
And that's a very important difference, because remember D is a diagonal matrix.
Computing a diagonal matrix raised to a power is very easy.
All you have to do is raise each of the diagonal elements to the appropriate power.
So since I'm raising to the fifth power, computing D the fifth is as simple as raising 2 to the
fifth and raising 5 to the fifth.
And that's easy to do.
2 to the fifth is 32, 5 to the fifth is 3125.
So now I know what the matrix in D to thel fifth is.
So we can actually go ahead and write out what P is, what D to the fifth is, and what
P inverse is.
So this now is a much simpler computation.
If you had to do this by hand on pen and paper, this would not nearly be as bad as the first
one that we wrote down.
In fact, let's go ahead and do it.
These two things when I multiply those out, I get this matrix, I'm left with the last
one still.
And if I multiply these out, I get this quantity right here.
And that is our final answer.
Really, what we've talked about here is a general way to find the power of a matrix.
Even with to the fifth power, the previous quote tedious way might not have been too
bad.
But what if I had to do it to the 50oth power, right?
Raising a diagonal matrix to a large power is much simpler, and we would have been left
with still just these three matrices to multiply with and we're done.
In general, if I can have A written in this dag analyzation framework, PDP inverse, if
I want to compute A to the arbitrary power k, that's always going to result in PD to
the k P inverse.
So no matter how big k is, this part of the computation is going to be trivial, because
D is by definition a diagonal matrix.
So that sums up this video.
It's just a clever way to do matrix diagonalization and also how to use that representation when
doing a matrix raised to a power.
If you can get it diagonalized in this form, doing this computation by hand is not that
bad.