Prof. Alex Suciu MTH U371 Linear Algebra Spring 2005
Final Exam: Solutions
Problem 1
v1={2,-6,8}; v2={7,3,-2}; v3={9,1,1};
A=Transpose[{v1,v2,v3}]; MatrixForm[A]
Part (a)
RowReduce[A]//MatrixForm
-(5/12)*v1-(7/6)*v2+v3
Alternate method:
NullSpace[A]
-5*v1-14*v2+12*v3
Part (b)
b={10,-2,5};
(* Take columns of A corresponding to pivots, and adjoin b *)
Ab=Transpose[{v1,v2,b}]; MatrixForm[Ab]
RowReduce[Ab]//MatrixForm
b==(11/12)*v1+(7/6)*v2
Alternate method:
sol={x,y,z}/.Solve[A.{x,y,z}==b,{x,y,z}]
(* Now pick any value for z (say, z=0, or z=1) to find coefficients
expressing b as a linear combination of v1, v2, v3.*)
sol/.{z->0}
b==(11/12)*v1+(7/6)*v2
sol/.{z->1}
b==v1/2+v3
Problem 2
A={{1,-3,5,-4,2,4},{2,-6,10,-8,7,2},{-3,9,-15,-12,0,18},{0,0,0,1,2,3}};
RowReduce[A]
im=Transpose[A][[{1,4,5,6}]] (* basis for im(A) *)
Length[im] (* rank A *)
ker=NullSpace[A] (* basis for ker(A) *)
Length[ker] (* dim ker(A) *)
4-Length[im] (* dim (im A)^\perp *)
6-Length[NullSpace[A]] (* dim (ker A)^\perp *)
Problem 3
A={{1,2},{3,4},{0,1}}; b={5,3,-2};
Solve[A.{y,z}==b,{y,z}]
Transpose[A].A
Inverse[Transpose[A].A]
Factor[Det[%]]
P=Inverse[Transpose[A].A].Transpose[A]
x=P.b
A.P
A.P.b
Problem 4
v1={3,4,0};v2={0,0,2};v3={-2,1,1};
A=Transpose[{v1,v2,v3}]; MatrixForm[A]
<<LinearAlgebra`Orthogonalization`
Q=Transpose[GramSchmidt[{v1,v2,v3}]]; MatrixForm[Q]
R=QRDecomposition[A][[2]]; MatrixForm[R]
A==Q.R
Problem 5
A={{-1,0,0},{0,Cos[45*Degree],-Sin[45*Degree]},
{0,Sin[45*Degree],Cos[45*Degree]}};
MatrixForm[A]
Transpose[A].A == IdentityMatrix[3] (* yes, A is othogonal *)
Det[A]
MatrixForm[Transpose[A]] (* inverse of A just the transpose *)
A.{2, Sqrt[2], 2*Sqrt[2]}
Problem 6
S={{1,0,1},{0,1,0},{1,2,3}};
S.DiagonalMatrix[{3,3,-1}].Inverse[S]
A={{5,4,-2},{0,3,0},{6,12,-3}}; MatrixForm[A]
Factor[Det[t*IdentityMatrix[3]-A]]
Eigenvalues[A]
Eigenvectors[A]
S=Transpose[Eigenvectors[A]]; MatrixForm[S]
d=DiagonalMatrix[Eigenvalues[A]]
A==S.d.Inverse[S]
Problem 7
S={{3,2},{-2,-1}}; MatrixForm[S]
A=S.DiagonalMatrix[{-4,3}].Inverse[S]
{Tr[A],Det[A]}
{Tr[A.A],Det[A.A]}
Det[5*A]
MatrixPower[A,3]
Problem 8
A={{2,3},{0,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 22, 2005)
Back to MTH U371-Linear Algebra.