Math 4133 - Linear Algebra
Exam 3 - 2015.05.01
Solutions

1. A linear map T is defined by the following four points. Determine the matrix A that satisfies T((OverVector[v])) = A(OverVector[v]).

T(⟨1, -2, 1, -1⟩) = ⟨1, 2, 1, 0⟩
T(⟨1,0,1,1⟩) = ⟨1, 0, 1, 1⟩
T(⟨1,2,1,0⟩) = ⟨0,1,1,1⟩
T(⟨0,1,1,1⟩) = ⟨1,-2,1,-1⟩

We create the two matrices, M and B, whose columns are the vectors from the domain and range, respectively:

(M = Transpose[{{1,-2,1,-1},{1,0,1,1},{1,2,1,0},{0,1,1,1}}])//MatrixForm

(B = Transpose[{{1,2,1,0},{1,0,1,1},{0,1,1,1},{1,-2,1,-1}}])//MatrixForm

Then the matrix we want is A = B*M^(-1)

(A = B.Inverse[M])//MatrixForm

We can verify that our matrix A does exactly what it was supposed to by checking the four vectors below:

A.{{1},{-2},{1},{-1}}

A.{{1},{0},{1},{1}}

A.{{1},{2},{1},{0}}

A.{{0},{1},{1},{1}}

2. The following matrix A represents a linear map T:(R^3) ⟶ (R^8).
A = (({{1, -3, -5}, {0, 1, 3}, {-1, 7, 2}, {3, 3, -1}, {-1, 0, 5}, {-1, 8, 3}, {6, 3, -1}, {-1, -9, 0}}))
(a) Compute Ker(T), expressing your answer in terms of a basis.
(b) Compute Im(T), expressing your answer in terms of a basis.
(c) Compute the dimensions of both Ker(T) and Im(T).
(d) Determine if T is one-to-one or onto.  Explain your answers!

A = (({{1, -3, -5}, {0, 1, 3}, {-1, 7, 2}, {3, 3, -1}, {-1, 0, 5}, {-1, 8, 3}, {6, 3, -1}, {-1, -9, 0}}))

RowReduce[A]//MatrixForm

(a) Here, the Ker(T) is the set of all vectors which get mapped to zero.  By row reducing A, we get x=0, y=0, z=0... Thus the only vector in Ker(T) is the zero vector, which has dimension zero.

RowReduce[Transpose[A]]//MatrixForm

(b) Im(T) consists of 3 vectors as follows, which were found by row reducing the transpose of A:
(Subscript[(OverVector[v]), 1]) =  ⟨({{1, 0, 0, (67/15), -(8/5), (2/15), (124/15), -(46/15)}})⟩, 
(Subscript[(OverVector[v]), 2]) =  ⟨({{0, 1, 0, (92/15), -(3/5), (7/15), (179/15), -(56/15)}})⟩, 
(Subscript[(OverVector[v]), 3]) =  ⟨({{0, 0, 1, (22/15), -(3/5), (17/15), (34/15), -(31/15)}})⟩,

(c) Clearly the dimension of Ker(T) = 0, dimension of Im(T) = 3, which adds up to the dimension of (R^3)

(d) by definition, since Ker(T) = {0}, it is one-to-one.  However, since the image is not all of, (R^8) it is not onto.

3. Construct a map T:(R^4) ⟶ (R^4) which takes vectors in (R^4) expressed in terms of basis (Subscript[B, 1]) and expresses them in terms of the basis (Subscript[B, 2]) as given below:

(Subscript[B, 1]) : { (Subscript[(OverVector[v]), 1]) = ⟨1, 1, -1, 0⟩,  (Subscript[(OverVector[v]), 2]) = ⟨0, 1, -1, 1⟩,  (Subscript[(OverVector[v]), 3]) = ⟨1, 0, -1, -1⟩,  (Subscript[(OverVector[v]), 4]) = ⟨1, 0, 1, 0⟩ }
(Subscript[B, 2]) : { (Subscript[(OverVector[w]), 1]) = ⟨1, 0, 1, 1⟩,  (Subscript[(OverVector[w]), 2]) = ⟨0, 1, 1, 1⟩,  (Subscript[(OverVector[w]), 3]) = ⟨0, 0, 1, 0⟩,  (Subscript[(OverVector[w]), 4]) = ⟨-1, -1, 1, 0⟩ }

Note: You may express the map T in terms of matrix multiplication by a 4x4 matrix A.

(B1 = Transpose[{{1, 1, -1, 0},{0, 1, -1, 1},{1, 0, -1, -1},{1, 0, 1, 0}}])//MatrixForm

(B2 = Transpose[{{1, 0, 1, 1},{0, 1, 1, 1},{0, 0, 1, 0},{-1, -1, 1, 0}}])//MatrixForm

If we apply matrix B1 to a vector expressed in terms of the basis (Subscript[B, 1]), then we get a vector in the standard basis. If we apply matrix B2 to a vector expressed in terms of the basis (Subscript[B, 2]), then we get a vector in the standard basis.  So to go from basis (Subscript[B, 1]) to (Subscript[B, 2]) , we simply apply B1 first, then the inverse to B2 second, thus:

(T = Inverse[B2].B1)//MatrixForm

4. For the dataset (given in (x,y) pairs) S = {{-0.1,2.3}, {-0.4,5.3}, {0.2,1.5}, {0.4,-1.3}, {-0.1,2.2}, {-0.4,5.1}, {0.3,-1.7}, {0.7,-4.3}, {0.6,-3.3}, {-0.25,3.5}}, find the line y = m x + b of best fit the data.  Compute the error in your curve fit by computing |A(OverVector[y])-(OverVector[b])|.  Plot both the points and the line of best fit together.

Here, our unknown vector (OverVector[y]) =  ⟨m, b⟩

S= {{-0.1,2.3}, {-0.4,5.3}, {0.2,1.5}, {0.4,-1.3}, {-0.1,2.2}, {-0.4,5.1}, {0.3,-1.7},{0.7,-4.3}, {0.6,-3.3}, {-0.25,3.5}};

(A = Join[Drop[S,{},{2}],Table[{1},{i,1,10}],2])//MatrixForm

B = Drop[S,{},{1}]

Y = (Inverse[Transpose[A].A].Transpose[A]).B

So m = -8.32398 and b = 1.72078, so y = -8.32398 x + 1.72078.  We plot this line along with the points below....

LinePlot = Plot[-8.32398 x+1.72078,{x,-1,1},PlotStyle->Black];
PtsPlot = ListPlot[S,PlotMarkers->{"+", Large}, PlotStyle->Red];

Show[LinePlot, PtsPlot]

So we have a best possible solution which corresponds to (OverVector[Y]) =  ⟨m, b⟩, If we plug this into  our original equation and compare it against B, we get:

Norm[A.Y-B]

5. For the dataset  (given in (x, y, z) triples)  S = {{1935,14.4,18.7}, {2233,14,21.7}, {2235,14.1,24.2}, {1970,14.2,21.6}, {2254,16.3,19.3}, {2238,16.3,20.2}, {2337,15.6,20.6}, {1951,16,8.6}, {1419,15.4,2.8}, {1295,13.9,9.8}, {2592,14.2,21.7}, {2592,17.1,7.1}, {1885,15.4,6.7}, {1361,14.8,4}, {1037,17,2.7}, {1419,18,4.1}, {1345,16.4,3}, {1334,16.9,3.1}, {1110,16.6,0.7}, {668,11.5,8.5}, {730,11.6,4.7}, {785,11.9,14.2}}, find the surface response curve z = a(x^2) + b(y^2) + cxy + dx + ey + f of best fit the data.  Compute the error in your curve fit by computing |A(OverVector[z])-(OverVector[b])|. Plot both the points the the surface response curve of best fit together.

S= {{1935.0,14.4,18.7}, {2233.0,14,21.7}, {2235.0,14.1,24.2}, {1970.0,14.2,21.6}, {2254.0,16.3,19.3}, {2238.0,16.3,20.2}, {2337.0,15.6,20.6}, {1951.0,16,8.6}, {1419.0,15.4,2.8}, {1295.0,13.9,9.8}, {2592.0,14.2,21.7}, {2592.0,17.1,7.1}, {1885.0,15.4,6.7}, {1361.0,14.8,4}, {1037.0,17,2.7}, {1419.0,18,4.1}, {1345.0,16.4,3}, {1334.0,16.9,3.1}, {1110.0,16.6,0.7}, {668.0,11.5,8.5}, {730.0,11.6,4.7}, {785.0,11.9,14.2}};

Here, first column will correspond to a, next to b, then c, d, e and lastly, f.  So the vector of constants in this case looks like (OverVector[v]) = ⟨a, b, c, d, e, f⟩

(A = Table[{S[[i,1]]^2, S[[i,2]]^2, S[[i,1]]*S[[i,2]],S[[i,1]],S[[i,2]],1},{i,1,22}])//MatrixForm

(B = Drop[S,{},{1,2}])//MatrixForm

(Z = (Inverse[Transpose[A].A].Transpose[A]).B)//MatrixForm

So z = -4.480759843383448`*^-6(x^2) + 0.79397(y^2) -0.0019208 xy + 0.0578179x + -24.1457y +158.908

SurfPlot = Plot3D[ -4.48076*^-6(x^2)+0.79397(y^2)-0.0019208x*y+0.0578179x+-24.1457y+158.908,{x,600,2600},{y,10,18.5}, Mesh->None, PlotStyle->{Opacity[0.1], Blue}];
Pts3DPlot = ListPointPlot3D[S,PlotStyle->{Red, PointSize[0.01]} ];

Show[SurfPlot,Pts3DPlot]

Here is the error:

Norm[A.Z-B]