Exam Questions

Consider the following system of equations:

	({{5(Subscript[x, 1])-3(Subscript[x, 2])+4(Subscript[x, 3])+6(Subscript[x, 4])+12(Subscript[x, 5]) = 0}, {-3(Subscript[x, 1])+5(Subscript[x, 2])+(Subscript[x, 3])-10(Subscript[x, 4])+7(Subscript[x, 5]) = 0}, {(Subscript[x, 1])-(Subscript[x, 2])+14(Subscript[x, 3])-5(Subscript[x, 4])+(Subscript[x, 5])  =0}})

Question 1. Use the “Solve” command to solve the systen of equations
Question 2.  Write the system of equations in matrix form AX=0
Question 3. Row reduce your matrix from Question 2 and verify that your answer is the same as that from Question 1.
Question 4. State the dimension of your solution to the system of equations
Question 5. Express the solution found in Question 1 (or 3) as a subspace of (R^5) by writing out the basis vectors for the subspace
Question 6. Is the vector v = <-628, -322, 53, 109, 109> an element of the subspace corresponding to the solution to the given system of equations?
Question 7. If the answer to Question 6 is yes, please express v as a linear combination of basis vectors from the solution subspace.
Question 8. Convert the basis from from Question 5 into an orthonormal basis
Question 9. Project the vector w = <1, -2, 1, 4, 0> on the subspace solution of the system of equations. 

Question 10. Compute the dot product matrix W for the orthonormal basis vectors found in Question 8. Remember that (Subscript[W, i, j]) = (Subscript[v, i])*(Subscript[v, j])
Question 11. Find the orthogonal complement (S^⊥)to the subspace found in  Question 5.  State its dimension.
Question 12. Verify that  S ⋃ (S^⊥)= (R^n) for the subspaces found in Questions 5 and 11.
Question 12 1/2: Convert the basis for (S^⊥) into an orthonormal basis.
Question 13. Let A be the matrix whose columns are the  basis vectors of S and  (S^⊥).  Compute the eigenvalues of this matrix.
Question 14. Verify that det(A) is equal to the product of the eigenvalues.
Question 15. Are the eigenvectors of the matrix A orthogonal?  If so, why?

Question 16. Consider the vector u = <-1, 2, 1>.  Find two other vectors v and w which are both orthogonal to u, and to each other and each has length 4.
Question 17. Compute the angle between the vectors v = <-1,2,1,1> and w=<0,2,3,-4>
Question 18. Find the distance from the point <-1, 2, 3> to the plane 3x+5y-3z=2
Question 19. Express the following matrix A in LU-form.  A = (({{-1, 2, 1, 0}, {1, 0, 2, 3}, {2, 2, 0, -5}, {2, -3, -1, 7}}))
Question 20. Express the vector <1,1,1> in terms of the basis {u,v,w} found in problem 16.

Question 1. Use the “Solve” command to solve the systen of equations

Solns = Solve[{5(Subscript[x, 1])-3(Subscript[x, 2])+4(Subscript[x, 3])+6(Subscript[x, 4])+12(Subscript[x, 5]) == 0, -3(Subscript[x, 1])+5(Subscript[x, 2])+(Subscript[x, 3])-10(Subscript[x, 4])+7(Subscript[x, 5]) == 0, (Subscript[x, 1])-(Subscript[x, 2])+14(Subscript[x, 3])-5(Subscript[x, 4])+(Subscript[x, 5])  ==0},{(Subscript[x, 1]),(Subscript[x, 2]),(Subscript[x, 3])}]

Question 2.  Write the system of equations in matrix form AX=0

(A = {{5,-3,4,6,12},{-3,5,1,-10,7},{1,-1,14,-5,1}})//MatrixForm

(X = {{(Subscript[x, 1])},{(Subscript[x, 2])},{(Subscript[x, 3])},{(Subscript[x, 4])},{(Subscript[x, 5])}})//MatrixForm

(A.X )//MatrixForm

Question 3. Row reduce your matrix from Question 2 and verify that your answer is the same as that from Question 1.

RowReduce[A]//MatrixForm

Expand[Solns]

Question 4. State the dimension of your solution to the system of equations
The dimension of the solution is two, since (Subscript[x, 1]) and (Subscript[x, 2]) and (Subscript[x, 3]) depend upon (Subscript[x, 4]) and (Subscript[x, 5])

Question 5. Express the solution found in Question 1 (or 3) as a subspace of (R^5) by writing out the basis vectors for the subspace

(Subscript[v, 1]) = {-161/218,317/218, 56/109,1,0}
(Subscript[v, 2]) = {-1095/218,-961/218, -3/109,0,1}

Question 6. Is the vector v = <-628, -322, 53, 109, 109> an element of the subspace corresponding to the solution to the given system of equations?

(M = Transpose[{(Subscript[v, 1]),(Subscript[v, 2]),{-628, -322, 53, 109, 109}}])//MatrixForm

RowReduce[M]//MatrixForm

The vector v = 109(Subscript[v, 1])+109(Subscript[v, 2]), so yes!

Question 7. If the answer to Question 6 is yes, please express v as a linear combination of basis vectors from the solution subspace.
The vector v = 109(Subscript[v, 1])+109(Subscript[v, 2]) from the RREF above.

Question 8. Convert the basis from from Question 5 into an orthonormal basis

(Subscript[q, 1])= (Subscript[v, 1]);

(Subscript[q, 2]) = (Subscript[v, 2]) - ((Subscript[v, 2]).(Subscript[q, 1]))/((Subscript[q, 1]).(Subscript[q, 1]))(Subscript[q, 1]);

(Subscript[q, 1]).(Subscript[q, 2])

(Subscript[vort, 1]) = (Subscript[q, 1])/Norm[(Subscript[q, 1])]
(Subscript[vort, 2]) = (Subscript[q, 2])/Norm[(Subscript[q, 2])]

Question 9. Project the vector w = <1, -2, 1, 4, 0> on the subspace solution of the system of equations.

w = {1, -2, 1, 4, 0};

projwontoS = Simplify[(w.(Subscript[vort, 1]))(Subscript[vort, 1]) + (w.(Subscript[vort, 2]))(Subscript[vort, 2])]

Question 10. Compute the dot product matrix W for the orthonormal basis vectors found in Question 8. Remember that (Subscript[W, i, j]) = (Subscript[v, i])*(Subscript[v, j])

DotProdW = ConstantArray[0,{2,2}];
For[k=1, k≤ 2, k=k+1,
For[j=1, j≤2, j=j+1,
DotProdW[[k,j]] = Simplify[(Subscript[vort, k]).(Subscript[vort, j])];];];
DotProdW//MatrixForm

Question 11. Find the orthogonal complement (S^⊥)to the subspace found in  Question 5.  State its dimension.

So here, we put the vectors from S ( (Subscript[v, 1 ])and (Subscript[v, 2])) into an array and row reduce, what is left will give us the orthogonal complement!

(Vmat = Join[{(Subscript[v, 1])},{(Subscript[v, 2])}])//MatrixForm

RowReduce[Vmat]//MatrixForm

(Subscript[u, 1]) = {(485/2302),-(567/2302), 1, 0 ,0};
(Subscript[u, 2]) = {(961/2302), -(1095/2302), 0, 1, 0};
(Subscript[u, 3]) = {(317/2302),(161/2302), 0, 0, 1};

Question 12. Verify that  S ⋃ (S^⊥)= (R^n) for the subspaces found in Questions 5 and 11.

We join the vectors from S and (S^⊥) and row reduce, we should end up with (Subscript[I, 5])

(Umat = Join[Join[{(Subscript[u, 1])},{(Subscript[u, 2])}],{(Subscript[u, 3])}])//MatrixForm

(UVMat = Join[Vmat,Umat])//MatrixForm

RowReduce[UVMat]//MatrixForm

Question 12 1/2: Convert the basis for (S^⊥) into an orthonormal basis.

For[k=1, k≤3, k=k+1,
(Subscript[uq, k])= Simplify[(Subscript[u, k])-Sum[((Subscript[u, k]).(Subscript[uq, j])/((Norm[(Subscript[uq, j])])^2))(Subscript[uq, j]), {j,1,k-1}]];
(Subscript[uort, k])= (Subscript[uq, k])/Norm[(Subscript[uq, k])];];

List[(Subscript[uort, 1]),(Subscript[uort, 2]),(Subscript[uort, 3])]

Question 13. Let A be the matrix whose columns are the  basis vectors of S and  (S^⊥).  Compute the eigenvalues of this matrix.

(VortMat = Join[{(Subscript[vort, 1])},{(Subscript[vort, 2])}])//MatrixForm

(UortMat = Join[Join[{(Subscript[uort, 1])},{(Subscript[uort, 2])}],{(Subscript[uort, 3])}])//MatrixForm

(UVortMat = Transpose[Join[VortMat, UortMat]])//MatrixForm

Simplify[(Subscript[uort, 1]).(Subscript[uort, 2])]
Simplify[(Subscript[uort, 1]).(Subscript[uort, 3])]
Simplify[(Subscript[uort, 2]).(Subscript[uort, 3])]
Simplify[(Subscript[vort, 1]).(Subscript[vort, 2])]
Simplify[(Subscript[uort, 1]).(Subscript[vort, 1])]
Simplify[(Subscript[uort, 1]).(Subscript[vort, 2])]
Simplify[(Subscript[uort, 2]).(Subscript[vort, 1])]
Simplify[(Subscript[uort, 2]).(Subscript[vort, 2])]
Simplify[(Subscript[uort, 3]).(Subscript[vort, 1])]
Simplify[(Subscript[uort, 3]).(Subscript[vort, 2])]

UVortMatEigs = N[Eigenvalues[N[UVortMat]]]

Question 14. Verify that det(A) is equal to the product of the eigenvalues.

Det[UVortMat]

Product[UVortMatEigs[[j]],{j,1,5}]

Question 15. Are the eigenvectors of the matrix A orthogonal?  If so, why?

(UVortMatEigVects = Eigenvectors[N[UVortMat]])

(Subscript[ev, 1]) = {0.02371369993318584` +0.666730203069859` I,0.700737225799518` +0.` I,0.04282721551715667` -0.11360954579362242` I,0.06119224090198255` -0.2042327865658959` I,-0.05316333396914052`-0.029200621748878504` I};
(Subscript[ev, 2]) = {0.02371369993318584` -0.666730203069859` I,0.700737225799518` +0.` I,0.04282721551715667` +0.11360954579362242` I,0.06119224090198255` +0.2042327865658959` I,-0.05316333396914052`+0.029200621748878504` I};
(Subscript[ev, 3])= {0.04460545967748568`,0.07415442809262372`,-0.17312842747270948`,0.10241710453627811`,0.9757298591620777`};
(Subscript[ev, 4]) = {0.11460587681670531` -0.2019385209227252` I,-0.034401793737720954`+0.07095362826205602` I,0.6857637891548579` +0.` I,-0.024728385411785625`-0.6698420364899857` I,0.12164925822051008` +0.07414892146848873` I};
(Subscript[ev, 5]) = {0.11460587681670531` +0.2019385209227252` I,-0.034401793737720954`-0.07095362826205602` I,0.6857637891548579` +0.` I,-0.024728385411785625`+0.6698420364899857` I,0.12164925822051008` -0.07414892146848873` I};

DotProdEV = ConstantArray[0,{5,5}];
For[k=1, k≤ 5, k=k+1,
For[j=1, j≤5, j=j+1,
DotProdEV[[k,j]] = Simplify[(Subscript[ev, k]).Conjugate[(Subscript[ev, j])]];];];
Chop[DotProdEV]//MatrixForm