|Problems & Projects|
|Problem Set Solutions|
*Linear recurrence relations revisited*Edit
We have already discussed linear recurrence relations in the Counting and Generating functions chapter. We shall study it again using matrices. Consider the Fibonacci numbers
- 1, 1, 2, 3, 5, 8, 13, 21...
where each number is the sum of two preceding numbers. Let xn be the (n + 1)th Fibonacci number, we can write:
In fact many linear recurrence relations can be expressed in matrix form , e.g.
can be expressed as
So if we knew how to compute the powers of matrices quickly then we can work out the (n + 1)th Fibonacci number rather quickly!
Computing Powers QuicklyEdit
Note that from now on we emphasise if a matrix is a vector by writing an arrow on top of it.
Something interesting happens when you multiply A by either or (Try it). In fact
Generally for a matrix B, if a vector w ≠ 0 (the matrix with all entries zero) such that
for some scalar λ, then is called a eigenvector of B and λ the eigenvalue of B (corresponding to w).
This is a feature of matrices that be exploited to compute powers easily. Here's how, using A, x and y from above, we write the two pieces of information together in matrix form:
or written completely in numeral form
you are encouraged to check the above is correct. What we did was we merged and into a matrix using each vector as a column, next we multiplied it by the diagonal matrix whose entries are the eigenvalue of each eigenvector correspondingly.
How to now exploit this matrix form to calculate powers of A quickly? We require a simple but ingenius step -- post-multiply (i.e. multiply from the right) both sides by the inverse of
Now to calculate An, we need only to do
but inverses multiply to give I, so we are left with
which is very easy to compute since powers of a diagonal matrix are easy to compute (just take each entry to the power).
Compute A5 where A is given above.
Solution We do
and its eigenvectors are
Calculate B5 directly (optional), and again using the method above.
Solution We need to first determine its eigenvalues. We do
so the eigenvalue corresponding to
so the other eigenvalue is 3.
Now we write them in the form:
now make B the subject
- so multiplying the right hand side out, we get
Summary -- compute powers quicklyEdit
Given eigenvectors of a matrix A
- Compute the eigenvalues (if not given)
- Write in the form A = PDP-1, where D is a diagonal matrix of the eigenvalues, and P the eigenvectors as columns
- Compute An using the right hand side equivalent
1. The eigenvectors of
2. The eigenvectors of
3. The eigenvectors of
Eigenvector and eigenvalueEdit
We know from the above section that for a matrix if we are given its eigenvectors, we can find the corresponding eigenvalues, and then we can compute its powers quickly. So the last hurdle becomes finding the eigenvectors.
An eigenvectors of a matrix A and its corresponding eigenvalue λ are related by the following expression:
where x ≠ 0 where 0 is the zero matrix (all entries zero). We can safely assume that A is given so there are two unknowns -- and λ. We have enough information now to be able to work out the eigenvalues (and from that the eigenvectors):
The matrix (A - λI) must NOT have an inverse, because if it does then = 0. Therefore det(A - λI) = 0. Suppose
Now we see det(A-λI) is a polynomial in λ and det(A-λI) = 0. We are already well-trained in solving quadratics, so it's easy to work out the values of λ. Once we've worked out the values of λ, we can work out (see examples).
Find the eigenvalues and eigenvectors of
and then find D and P such that A = P-1DP.
We aim to find and λ such that
- A = λ
- det(A - λI) =
- 0 = (-4 - λ)(7 - λ) + 30
- 0 = -28 - 3λ + λ2 + 30
- 0 = λ2 - 3λ + 2
- 0 = (λ - 1)(λ - 2)
- λ = 1, 2
Now for each eigenvalue we will get a different corresponding eigenvector. So we consider the case λ = 1 and λ = 2 separately.
Consider first λ = 1, from (**) we get
where since det(A - λI) = 0, we know that there is no unique solution to the above equation. But we note that:
for any real number t is a solution, and we choose t = 1 as our solution because it's the simpliest. Therefore
is the eigenvector corresponding to λ = 1. (***)
Similarly, if λ = 2, from (**) we get
where we note that:
for any real number t is a solution, as before we choose t = 1 as our solution. Therefore
- is the eigenvector corresponding to λ = 2. (****)
We summarise the result of (***) and (****), we have
we combine the results into one
- a) Diagonalize A, i.e find P (invertible) and B (diagonal) such that AP = PB
- b) Compute A5
' Solution a) We are solving Ax = λx, where λ is a constant and x a column vector. Firstly
since x ≠ 0 we have
For λ = 3,
is a solution. Note that we do not accept x = 0 as an solution, because we assume x ≠ 0. Note also that
for some constant t is also a solution. Indeed we could use x = y = 2, 3 or 4 as a solution, but for convenience we choose the simplest i.e. x = y = 1.
For λ = 2,
is a solution.
is a solution and
is also a solution.
Solve the linear recurrence relation
We need to diagonalize
- λ = 2, 3
For λ = 2
For λ = 3
1. Compute A5 where
2. Compute A5 where
3. Solve the following recurrence relations
...more to come
Problem Set > High_School_Mathematics_Extensions/Matrices/Problem Set
What do you think? Too easy or too hard? Too much information or not enough? How can we improve? Please let us know by leaving a comment in the discussion section. Better still, edit it yourself and make it better.
To tell the truth ,I haven't finished it. The theories included are not difficult for me because I have studied a little game theory. But, the passage is a little long for me, and I am not very interested in certain parts. It's maybe a little too much information for me. I will try to finish it. Thank you!
I was directed here for information before taking cryptography I. This was a good review of probability rules. A little disappointed that author didn't get back to the definition of independent events and continuous probability. And I don't know what happen at the end; it looked kind of cut off. But, overall it was a nice guide and thanks! - undergrad
Around the middle of the article, you introduced the notation of two numbers — one over the other — inside of parenthesis. There was no description of the meaning of this notation or how it is used.
I do not have a background in mathematics (In Fact, I was never any good at it). However, I have found this quite understandable for my novice capabilities. I was too referred here by my cryptography teacher. Now, I can look at his presentation with only one eye crossed. I am still a little confused about some of the information, such as binomial distribution. However, I will reread and see if I can understand.
Some sections got way to complex for me, with the info dumps.