Pset 8: Due Thursday April 30
(1.) (a) Find the eigenvalues and eigenvectors ofA=(1423),A+2I=(3425)
(b) If Ax=λx, then what is (A+αI)x? Therefore, how are the eigenvalues and eigenvectors of A+αI related to those of A? Is this consistent with your answer from (a)?
Ans:(a) det(A−λI)=det(1−λ423−λ)=λ2−4λ−5. Set det(A−λI)=0, we get λ=−1 or 5.
For the eigenvalue λ=−1, a eigenvector u1 satisfies (2424)x1=0. We choose x1=(2−1).
For the eigenvalue λ=5, a eigenvector u2 satisfies (−442−2)x2=0. we choose x2=(11).
A+2I has eigenvalues 1 and 7 and the corresponding eigenvectors are x1 and x2.
(b) (A+αI)x=(λ+α)x.
The eigenvalues of (A+αI) are eigenvalues of A plus α.
The eigenvectors of (A+αI) are the sames as the eigenvectors of A.
This is consistent with (a).
(2) (From Strang, section 6.1, problem 11.)
Here is a strange fact about 2×2 matrices with eigenvalues λ1≠λ2: the columns of A−λ1I are multiples of the eigenvector x2. Why?
(Hint: think about the column and null spaces of A−λ1I.)
Ans: We have (A−λ1I)x2=(λ2−λ1)x2. Note that the column space of A−λ1I is 1 dimensional and (λ2−λ1)x2∈col(A−λ1I). Thus each column of A−λ1I is a multiple of x2.
(3) (Based on Strang, section 6.2, problem 9.)
Suppose we form the sequence
g0,g1,g2,g3,…=0,1,12,34,58,1116,2132,4364,85128,171256,341512,6831024,13652048,27314096,54618192,1092316384,2184532768,…by the rule that gk+2=gk+1+gk2: each number is the average of the previous two.
(a) If we define xk=(gk+1gk), then write the rule for the sequence in matrix form: xk+1=Axk. What is A?
(b) Find the eigenvalues and eigenvectors of A.
(c) The eigenvalues immediately tell which of these three possibilities: the sequence blows up, decays, or goes to a constant as n→∞? Does this behavior depend on the starting vector x0?
(d) Find the limit as n→∞ of An from the diagonalization of A.
(e) If g0=0 and g1=1, i.e. x0=(10), then show that the sequence approaches 2/3.
(f) With g0=0 and g1=1 as in the previous part, how fast does gn−2/3 go to zero? In particular, what should gn+1−2/3gn−2/3 approach for large n? Optionally heck your answer by the using the following Julia code, which numerically computes the sequence.
function gsequence(n)
g = [0.0, 1.0]
for i = 3:n
push!(g, (g[end]+g[end-1])/2)
end
return g
end
gsequence(25);
gsequence(25) .- 2/3;
Ans: (a) (1/21/210).
(b) Eigenvalues are 1 and −1/2. An eigenvector for λ=1 is x1=(11). An eigenvector for λ=−1/2 is x2=(−12).
(c) The sequense goes to a constant as n→∞. It does not depend on the initial value.
(d) Note A=UΣU−1, where Σ=(100−1/2) and u=(x1,x2). We have lim \begin{pmatrix}1& -1\\ 1&2 \end{pmatrix} \begin{pmatrix}1& 0\\ 0&0 \end{pmatrix} \begin{pmatrix}2&1\\ -1&1\end{pmatrix}\frac{1}{3}=\frac{1}{3}\begin{pmatrix}2& 1\\ 2&1 \end{pmatrix}.
(e) As \lim_{n\to \infty}A^n x_0= \begin{pmatrix}2/3\\2/3\end{pmatrix}, we have \lim_{n\to \infty}g_k=2/3.
(f) As \begin{pmatrix}1\\0\end{pmatrix}=\frac{2}{3}\begin{pmatrix}1\\1\end{pmatrix}-\frac{1}{3}\begin{pmatrix}-1\\2\end{pmatrix}, we know \begin{pmatrix}g_{n+1}\\g_n\end{pmatrix}=A^n \begin{pmatrix}1\\0\end{pmatrix}=\frac{2}{3}\begin{pmatrix}1\\1\end{pmatrix}-\frac{1}{3}(-\frac{1}{2})^n\begin{pmatrix}-1\\2\end{pmatrix}. Therefore \displaystyle{\frac{g_{n+1}-2/3}{g_n-2/3}= -\frac{1}{2}}.
(4) If M is an m\times m Markov matrix with positive entries, consider the system of ODEs\frac{dx}{dt} = (M-I)x.
(a) Explain why the sum of the components of x(t) is "conserved": that is, o^T x(t) is the same number for all t, where o is the vector of m 1's.
(b) What do the eigenvalues of M (positive Markov: one λ=1 eigenvalue and the remainder have |\lambda|\lt 1) tell you about the solution x(t) for large t? Does it blow up, oscillate, decay to zero, or … ?
(c) Given the initial condition x(0), give a formula for the solution x(\infty) = \lim_{t\to\infty} x(t) in terms of x(0), o, and the "steady-state" eigenvector v_0 (M v_0 = v_0) of M.
(d) Optionally Check your answers to (a) and (c) by using the following Julia code to generate a random 5×5 positive Markov matrix, a random initial condition, and evaluating x(t)=e^{(M-I)t} x(0) via exp((M-I)t)x₀ for one or more values of t in Julia.
\bf{\mbox{Ans}}: (a) \displaystyle{\frac{d}{dt}o^T x = o^T \frac{dx}{dt}= o^T (M-I)x= ((M-I)^T o)^T x=0.} The last equation is because the sum of each column of M-I is 0. Therefore o^Tx(t) is a constant.
(b) x(t) goes to a constant since one eigenvalue is 0 and all the other eigenvalues of M-I are negative.
(c) It is known that the only vector that contributes the the steady-state is the eigenvector of M-I for 0 eigenvalue, which is v_0. I.e. x(\infty)=a_0 v_0 where a_0 is a constant.
This can be understand when M-I is diaonalizable. Supose x(0)=a_0v_0+a_1v_1+\cdots a_{m-1}v_{m-1}, where a_i are numbers and v_i are eigenvectors of M-I for eigenvalues 0, \lambda_1, \cdots \lambda_{m-1}. In particular, Mv_0=v_0. Then x(\infty)=\lim_{n\to \infty} e^{(M-I)t}x(0)=\lim_{n\to \infty} a_0v_0+ a_1 e^{\lambda_1}v_1+\cdots a_{m-1}e^{\lambda_{m-1}}v_{m-1}=a_0v_0.
By part (a), we know that o^T(a_0v_0)=o^Tx(0), which implies a_0=\displaystyle{\frac{o^Tx(0)}{o^Tv_0}}. Hence we have x(\infty)=\displaystyle{\frac{o^Tx(0)}{o^Tv_0} v_0}.
(d) Julia code as below.
# generate a random 5×5 Markov matrix
M = rand(5,5)
M = M ./ sum(M,dims=1)
5×5 Array{Float64,2}: 0.185064 0.163531 0.216239 0.199078 0.185472 0.100901 0.140709 0.16902 0.111907 0.211666 0.295306 0.106829 0.217277 0.482829 0.197706 0.103092 0.15851 0.287594 0.0106187 0.227307 0.315637 0.43042 0.10987 0.195567 0.177849
using LinearAlgebra
v₀ = nullspace(M-I) # the λ=1 eigenvector of M
5×1 Array{Float64,2}: 0.4224202176432261 0.33297797141355534 0.5636251746168992 0.3763807065014143 0.5013492361529326
?nullspace; # Remove semicolon to read about nullspace
o = ones(size(v₀)) # the vector of 1's
5×1 Array{Float64,2}: 1.0 1.0 1.0 1.0 1.0
x₀ = randn(size(o)) # a random initial condition
5×1 Array{Float64,2}: 0.8854250021078691 2.9917147669203197 -0.06843156042186728 0.2260076379324639 -0.6424660553057497
t = 100
x = exp((M-I) * t) * x₀ # the solution x(t)
5×1 Array{Float64,2}: 0.6523057873567594 0.5141881206046452 0.8703559819030439 0.5812110851845147 0.7741888161841227
sum(x), sum(x₀) # compare the sums of the components of x(t) and x(0)
(3.392249791233086, 3.392249791233035)
((o'x₀)/(o'v₀)).*v₀
5×1 Array{Float64,2}: 0.6523057873567496 0.5141881206046378 0.8703559819030305 0.5812110851845063 0.7741888161841108
(5) Construct for every n=2,3,... a non-zero matrix A that has all eigenvalues 0, but has (n-1) singular values 1. Is A diagonalizible? (Possible Hint: Permuting the rows or columns of a matrix does not influence the singular values.)
\bf{\mbox{Ans}}: Let A_n= \begin{pmatrix} 0&1&0&\cdots &0\\ 0&0&1&\cdots &0\\ \vdots&\vdots &\vdots& \ddots&\vdots\\ 0&0&0&\cdots&1\\ 0&0&0&\cdots&0\\ \end{pmatrix} One can check that all the eigenvalues of A are 0.
A_n has to following SVD. A_n=\begin{pmatrix} 0& 1 & 0& \cdots & 0\\ 0& 0 & 1& \cdots &0\\ \vdots& \vdots & \ddots & \ddots& \vdots\\ 0& 0& 0& \ddots & 1\\ 1& 0& 0& \cdots& 0 \end{pmatrix} \begin{pmatrix} 0& 0 & \cdots &0& 0\\ 0& 1& \cdots &0&0\\ \vdots&\vdots & \ddots& \vdots& \vdots\\ 0& 0& \cdots&1& 0\\ 0& 0& \cdots& 0& 1 \end{pmatrix}I_n. Thus A has n-1 singular values being 1.
A_n is not diagonalizible. If it was diagnoalizable, say A_n= U\Sigma U^{-1}, then A_nU=U\Sigma. Since all the eigenvalues are 0, all the columns of U are eigenvectors for \lambda=0 and they are linear independent. However, the null space of A_n-0I is one dimensional. Thus A_n is not diagonalizible.
(6) Find two matrices (or argue that is impossible) for which AB-BA=I.
\bf{\mbox{Ans}}: It is impossible since tr(AB-BA)=tr(AB)-tr(BA)=0 but tr(I)\neq 0.
(7) Use the full svd to derive the so called "polar factorization" of a matrix: Every square matrix A can be factored into QS where Q is orthogonal and S is positive semi-definite. If A is invertible further show S is positive definite. (Hint: if A=U\Sigma V^T, the orthogonal matrix Q will be UV^T. What do we need to complete the story.) (Hint: if you don't yet see the answer, the polar decomposition is on page 394 of Strang.)
\bf{\mbox{Ans}}: Write down a full svd A=U\Sigma V^T such that all the entries of \Sigma are non-negative. If any entry is negative, one can move the negative sign to the corresponding column of U. Then A=(UV^T)(V\Sigma V^T). Let Q=UV^T ( which is orthogonal) and S=V\Sigma V^T (which is positive semi-definite). Thus we get the polar factorization.
If A is invertible, we know all the diagonal entries of \Sigma are positive and thus S is positive definite.
(8) Suppose x\in R^n is constant and A is nxn variable. Find the gradient \nabla_A of sum( sin.(Ax) ). The answer can be expressed as an nxn matrix or a linear transformation.
\bf{\mbox{Ans}}: \nabla_Asum( sin.(Ax) )=cos.(Ax)x^T