Prof. Alex Suciu MTH U371 Linear Algebra Spring 2005
Practice Final Exam: Solutions
Problem 1
v1={3,0,-1};v2={0,3,5};v3={1,-4,-7};
A=Transpose[{v1,v2,v3}]; MatrixForm[A]
NullSpace[A]
-v1+4*v2+3*v3
Problem 2
v1={1,2,-1};v2={2,1,0};v3={-1,0,1};
A=Transpose[{v1,v2,v3}]; MatrixForm[A]
NullSpace[A]
b={1,-7,5};
Inverse[A].b
b==-5*v1+3*v2
Problem 3
v1={1,2,5};v2={6,2,4};v3={-7,1,4};
A=Transpose[{v1,v2,v3}]; MatrixForm[A]
NullSpace[A]
b={-2,1,3};
{x,y,z}/.Solve[A.{x,y,z}==b,{x,y,z}]
%/.{z->0}
b==v1-v2/2
Problem 4
A={{2,0,3},{4,5,7},{-6,10,-7}};MatrixForm[A]
b={-2,-3,8};
{x,y,z}/.Solve[A.{x,y,z}==b,{x,y,z}]
RowReduce[A]
b=Transpose[A][[{1,2}]]
(* Basis vectors for im(A) are the first two columns of A *)
NullSpace[A]
Length[b] (* Rank of A is size of basis for im(A) *)
NullSpace[{{2,0,3},{-6,10,-7}}] (* Same answer as for ker(A) *)
Problem 5
A={{1,2,3,1,0},{2,3,5,2,1},{3,5,8,3,1},{4,7,11,4,1}};
RowReduce[A]
Transpose[A][[{1,2}]] (* basis for im(A) *)
NullSpace[A] (* basis for ker(A) *)
Length[NullSpace[Transpose[A]]] (* rank(A) *)
Length[NullSpace[A]] (* dim ker(A) *)
4-Length[NullSpace[Transpose[A]]] (* dim im(A^T) *)
5-Length[NullSpace[A]] (* dim ker(A^T) *)
Problem 6
A={{1,2,3,4,5},{6,7,8,9,10},{11,12,13,14,15},
{16,17,18,19,20}};
RowReduce[A]
Transpose[A][[{1,2}]] (* basis for im(A) *)
NullSpace[A] (* basis for ker(A) *)
Length[NullSpace[Transpose[A]]] (* rank(A) *)
Length[NullSpace[A]] (* dim ker(A) *)
4-Length[NullSpace[Transpose[A]]] (* dim im(A^T) *)
5-Length[NullSpace[A]] (* dim ker(A^T) *)
Problem 7
A={{-1,0,0},{0,Cos[-60*Degree],-Sin[-60*Degree]},
{0,Sin[-60*Degree],Cos[60*Degree]}};
MatrixForm[A]
Transpose[A].A == IdentityMatrix[3] (* yes, A is othogonal *)
Det[A]
MatrixForm[Transpose[A]] (* inverse of A just the transpose *)
A.{-3, 2, 1}
Problem 8
A=6*{{Cos[30*Degree],0,-Sin[30*Degree]},{0,1,0},
{Sin[30*Degree],0,Cos[30*Degree]}};
MatrixForm[A]
A.{5, 4, 3}
Problem 9
A={{Cos[120*Degree],0,-Sin[120*Degree]},{0,-1,0},
{Sin[120*Degree],0,Cos[120*Degree]}};
MatrixForm[A]
Det[A]
Transpose[A].A == IdentityMatrix[3] (* yes, A is othogonal *)
MatrixForm[Transpose[A]] (* inverse of A just the transpose *)
A.{-2, 5, 1}
Problem 14
A={{0,1},{1,1},{2,1},{3,1}}; y={2,1,4,6};
Transpose[A].A
Inverse[Transpose[A].A]
PseudoInverse[A]
{m,b}=Inverse[Transpose[A].A].Transpose[A].y
4*m+b
Problem 15
a1={3,4};a2={-1,1};
A=Transpose[{a1,a2}]; MatrixForm[A]
u1=a1/Sqrt[a1.a1]
u2=a2/Sqrt[a2.a2]
{Sqrt[a1.a1],Sqrt[a2.a2],a1.a2}
theta=N[ArcCos[(a1.a2)/(Sqrt[a1.a1]*Sqrt[a2.a2])]]
<<LinearAlgebra`Orthogonalization`
Q=Transpose[GramSchmidt[{a1,a2}]]; MatrixForm[Q]
R=QRDecomposition[A][[2]]; MatrixForm[R]
A==Q.R
Problem 16
v1={1,0,1};v2={0,1,1};v3={0,1,2};
A=Transpose[{v1,v2,v3}]; MatrixForm[A]
Q=Transpose[GramSchmidt[{v1,v2,v3}]]; MatrixForm[Q]
R=QRDecomposition[A][[2]]; MatrixForm[R]
A==Q.R
Problem 17
v1={0,3,4};v2={0,2,1};v3={1,2,3};
A=Transpose[{v1,v2,v3}]; MatrixForm[A]
Q=Transpose[GramSchmidt[{v1,v2,v3}]]; MatrixForm[Q]
R=QRDecomposition[A][[2]]; MatrixForm[R]
A==Q.R
Problem 18
A={{2,2},{3,1}}; MatrixForm[A]
Factor[Det[x IdentityMatrix[2]-A]]
Eigenvalues[A]
S=Transpose[Eigenvectors[A]]; MatrixForm[S]
d=DiagonalMatrix[Eigenvalues[A]]
A==S.d.Inverse[S]
Problem 19
A={{5,6,0},{7,6,0},{0,0,3}}; MatrixForm[A]
Eigenvalues[A]
S=Transpose[Eigenvectors[A]]; MatrixForm[S]
d=DiagonalMatrix[Eigenvalues[A]]
A==S.d.Inverse[S]
Problem 20
A={{4,0,0},{0,2,0},{0,9,-5}}; MatrixForm[A]
Factor[Det[x IdentityMatrix[3]-A]]
Eigenvalues[A]
S=Transpose[Eigenvectors[A]]; MatrixForm[S]
d=DiagonalMatrix[Eigenvalues[A]]
A==S.d.Inverse[S]
Problem 21
A=DiagonalMatrix[{-1,2,2,3,4}];
(* For simplicity, I will pretend A is diagonal *)
{Tr[A],Det[A]}
{Tr[A.A],Det[A.A]}
Det[3*IdentityMatrix[5]-A]
Det[3*A]
Det[A]=!=0
Transpose[A].A==IdentityMatrix[5]
Problem 22
A=DiagonalMatrix[{-2,1,3,4}];
(* For simplicity, I will pretend A is diagonal *)
Det[t*IdentityMatrix[4]-A]
{Tr[A],Det[A]}
Det[-2*A]
Det[A+2*IdentityMatrix[4]]
Eigenvalues[MatrixPower[A,3]]
Det[A]=!=0
Transpose[A].A==IdentityMatrix[4]
Complement[Union[Eigenvalues[A]],Eigenvalues[A]]=={}
Problem 23
S={{4,1},{2,1}};MatrixForm[S]
d={{-2,0},{0,5}}
A=S.d.Inverse[S]
Problem 24
A={{27,-12},{56,-25}};MatrixForm[A]
Simplify[MatrixPower[A,t]]
S=Transpose[Eigenvectors[A]];MatrixForm[S]
d=DiagonalMatrix[Eigenvalues[A]]
At=S.MatrixPower[d,t].Inverse[S]; MatrixForm[At]
Problem 25
S={{1,4},{5,-1}};MatrixForm[S]
d={{2,0},{0,3}}
A=S.d.Inverse[S]; MatrixForm[A]
At=S.MatrixPower[d,t].Inverse[S]; MatrixForm[At]
Problem 26
λ[1]=4;
sol=Solve[{λ[1]+λ[2]+λ[3]==8,λ[1]*λ[2]*λ[3]==52},{λ[2],λ[3]}][[1]]
eval2={λ[1],λ[2],λ[3]}^2/.sol
Total[eval2]
Apply[Times,eval2]
Problem 27
A={{3/2,0},{0,1/2}};MatrixForm[A]
x[0]={2,1};
x[t_]:=MatrixPower[A,t].x[0]
Simplify[x[t]]
data=Table[N[x[t]],{t,-2,2}]
ListPlot[data,PlotRange->{0,4},PlotJoined->True,PlotStyle->Hue[.7],
AxesOrigin->{2,0}]
Problem 28
A={{3/5,3/10},{2/5,7/10}};MatrixForm[A]
x[0]={1,1};
x[t_]:=MatrixPower[A,t].x[0]
Simplify[x[t]]
data=Table[N[x[t]],{t,-2,8}]
ListPlot[data,PlotRange->{-0.5,1.5},PlotJoined->False,
PlotStyle->PointSize[0.015], PlotStyle->Hue[.7],AxesOrigin->{1,0}]
Limit[Simplify[x[t]],t->Infinity]
Problem 29
A={{2,2},{2,-5}};MatrixForm[A]
evalues=Eigenvalues[A]
{w1,w2}=Eigenvectors[A]
v1=N[w1/Sqrt[w1.w1]]
v2=N[w2/Sqrt[w2.w2]]
S=Transpose[{v1,v2}]; MatrixForm[S]
d=DiagonalMatrix[N[evalues]]
A==S.d.Transpose[S]
Problem 30
A={{1,0,1},{0,2,0},{1,0,1}};MatrixForm[A]
evalues=Eigenvalues[A]
{w1,w2,w3}=Eigenvectors[A]
v1=w1/Sqrt[w1.w1]
v2=w2/Sqrt[w2.w2]
v3=w3/Sqrt[w3.w3]
S=Transpose[{v1,v2,v3}]; MatrixForm[S]
d=DiagonalMatrix[evalues]
A==S.d.Transpose[S]
Problem 31
A={{1,2},{2,4}};MatrixForm[A]
B=Transpose[A].A
Eigenvalues[B]
{s1,s2}=Sqrt[%]
{w1,w2}=Eigenvectors[B]
{v1,v2}={w1/Sqrt[w1.w1], w2/Sqrt[w2.w2]}
V=Transpose[{v1,v2}]; MatrixForm[V]
u1=A.v1/s1
u2=v2
U=Transpose[{u1,u2}]; MatrixForm[U]
A==U.DiagonalMatrix[{s1,s2}].Transpose[V]
SingularValueDecomposition[N[A]]
Problem 32
A={{6,3},{-1,2}};MatrixForm[A]
B=Transpose[A].A
Eigenvalues[B]
{s1,s2}=Sqrt[%]
{w1,w2}=Eigenvectors[B]
{v1,v2}={w1/Sqrt[w1.w1], w2/Sqrt[w2.w2]}
V=Transpose[{v1,v2}]; MatrixForm[V]
u1=A.v1/s1
u2=A.v2/s2
U=Transpose[{u1,u2}]; MatrixForm[U]
A==U.DiagonalMatrix[{s1,s2}].Transpose[V]
SingularValueDecomposition[N[A]]
Created by Mathematica (April 15, 2005)
Back to MTH U371-Linear Algebra.