LINEAR TRANSFORMATIONS FOR BEGINNERS

Graphical representations are used to illustrate basic concepts in linear algebra

by Roberto E. Caligaris, Georgina B. Rodríguez and Marta G. Caligaris

We present here an introduction to linear transformations that corresponds to the treatment in an introductory course for engineering students. 
We begin by defining linear transformations analytically and studying their properties. Then we take advantage of the Mathematica´s graphical capabilities, to visualize linear transformations on the plane. Our interest is to make the students "see" the kernel and the image of linear transformations—for this purpose we use the vector space (ℝ^2). To conclude, we analyze a linear transformation on (ℝ^3) .

Recognizing linear transformations

Let´s  consider  the following transformations on the vector space  (ℝ^2) :

T1[{x_, y_}] := {x + y, x + y + 1}; T2[{x_, y_}] := {x/2 + y, x + 2*y}; 
  T3[{x_, y_}] := {3*x, 3*y}; T4[{x_, y_}] := {-y, x}; 
  T5[{x_, y_}] := {x, 0}; T6[{x_, y_}] := {x^2, y^2};

Define arbitrary elements (Subscript[v, 1]) and (Subscript[v, 2]) in (ℝ^2)as lists to match the definition of the transformations:

Subscript[v, 1] = {Subscript[x, 1], Subscript[y, 1]}; 
  Subscript[v, 2] = {Subscript[x, 2], Subscript[y, 2]};

We ask our students to check the following properties:

	1) T((Subscript[v, 1]) + (Subscript[v, 2])) = T((Subscript[v, 1])) + T((Subscript[v, 2])) ∀ (Subscript[v, 1]), (Subscript[v, 2]) ∈  (ℝ^2)
	2) T(k v) = k T(v) ∀ v ∈  (ℝ^2)
	3) T(0,0) = (0,0)

We show here what happens with T1, T2 and T6.

For T1:

T1[Subscript[v, 1]] + T1[Subscript[v, 2]] === 
  T1[Subscript[v, 1] + Subscript[v, 2]]

T1[k*Subscript[v, 1]] === k*T1[Subscript[v, 1]]

We also ask the students to check these properties by typing the right and left sides of the expressions separately, as follows:

Expand[k*T1[Subscript[v, 1]]]

T1[k (Subscript[v, 1])]

Obviously, the expressions are not the same.

T1[{0, 0}]

For T2:

T2[Subscript[v, 1]] + T2[Subscript[v, 2]] === 
  Expand[T2[Subscript[v, 1] + Subscript[v, 2]]]

T2[k*Subscript[v, 1]] === Expand[k*T2[Subscript[v, 1]]]

T2[{0, 0}]

Finally, for T6:

T6[Subscript[v, 1]] + T6[Subscript[v, 2]] === 
  Expand[T6[Subscript[v, 1] + Subscript[v, 2]]]

T6[k*Subscript[v, 1]] === Expand[k*T6[Subscript[v, 1]]]

T6[{0, 0}]

After examining the remaining cases, the students should conclude that all the transformations except T1 and T6 satisfy the properties 1 and 2.

DEFINITION: The transformations T that satisfy the properties
	1) T((Subscript[v, 1]) + (Subscript[v, 2])) = T((Subscript[v, 1])) + T((Subscript[v, 2])) ∀ (Subscript[v, 1]), (Subscript[v, 2]) ∈  (ℝ^2)
	2) T(k v) = k T(v) ∀ v ∈  (ℝ^2)
are called Linear Transformations on the plane.

We ask our students to calculate T(0,0) to demonstrate that T(0,0) = (0,0) does not imply that a transformation will be linear. We ask them to show the converse: 

T:  (ℝ^2)->  (ℝ^2) is a linear transformation => T(0,0) = (0,0).

Images of linear transformations

In this section we are going to draw several sets of points of (ℝ^2).  We define the function drawPoints to draw the sets we´ll work with:

drawPoints[pointSet_, shade_, size_] := 
   ListPlot[pointSet, PlotStyle -> {GrayLevel[shade], PointSize[size]}, 
    DisplayFunction -> Identity, AspectRatio -> Automatic];

When this function is called, we must specify: the subset we want to drawPoints, the gray level, and the size of the points.

We also define the function trans to transform the subset  "set" by the transformation "T",

trans[T_, ptSet_] := ptSet /. {(x_)?NumericQ, y_} :> T[{x, y}];

To see the effect of the transformations, we are going to choose random points on the plane.

quad[1] = Table[{Random[], Random[]}, {200}]; 
  quad[2] = Table[{-Random[], Random[]}, {200}]; 
  quad[3] = Table[{-Random[], -Random[]}, {200}]; 
  quad[4] = Table[{Random[], -Random[]}, {200}];

For plotting we use the function drawPoints previously defined.To distinguish the four quadrants, we´ll use different  gray levels:

quadPlot[n_] := drawPoints[quad[n], (n - 1)/4, 0.015];

domain = Show[{Table[quadPlot[n], {n, 4}]}, 
    PlotLabel -> "\!\(TraditionalForm\`ℝ\^2\)"];

Now we apply T3 to these points:

T3quad[n_] := trans[T3, quad[n]];

T3quadPlot[n_]  :=  drawPoints[T3quad[n], (n - 1)/4,  0.015];

imageT3 = Show[{Table[T3quadPlot[n], {n, 4}]}, 
    PlotLabel -> "T3[\!\(TraditionalForm\`ℝ\^2\)]"];

Show[GraphicsArray[{domain, imageT3}], DisplayFunction -> $DisplayFunction];

Note the change in the scale on the axes, illustrating the effect of the transformation.

Now, we apply T4 to these points:

T4quad[n_] := trans[T4, quad[n]];

T4quadPlot[n_] := drawPoints[T4quad[n], (n - 1)/4, 0.015];

imageT4 = Show[{Table[T4quadPlot[n], {n, 4}]}, 
    PlotLabel -> "T4[\!\(TraditionalForm\`ℝ\^2\)]"];

Show[GraphicsArray[{domain, imageT4}], DisplayFunction -> $DisplayFunction];

Note the rotation.  Now, we apply T2 to the domain points:

T2quad[n_] := trans[T2, quad[n]];

T2quadPlot[n_] := drawPoints[T2quad[n], (n - 1)/4, 0.015];

imageT2 = Show[{Table[T2quadPlot[n], {n, 4}]}, 
    PlotLabel -> "T2[\!\(TraditionalForm\`ℝ\^2\)]"];

Show[GraphicsArray[{domain, imageT2}], DisplayFunction -> $DisplayFunction];

Now the points have been "flattened" to a line. To obtain the equation of this line, we note that the line contains the origin and the point (1,2) . So its equation is y = 2x, or { (x, 2x), x ∈ ℝ }.

Now, we apply T5 to these points:

T5quad[n_] := trans[T5, quad[n]];

T5quadPlot[n_] := drawPoints[T5quad[n], (n - 1)/4, 0.015];

imageT5 = Show[{Table[T5quadPlot[n], {n, 4}]}, 
    PlotLabel -> "T5[\!\(TraditionalForm\`ℝ\^2\)]"];

Show[GraphicsArray[{domain, imageT5}], DisplayFunction -> $DisplayFunction];

Again, all the points have been "flattened" to a straight line. In this case, it´s clear that the equation is y = 0.
Then, the image set of T2 is { (x, 0), x ∈ ℝ }. At this point we can introduce the formal proposition:

\(The\ image\ set\ of\ a\ linear\ transformation\ is\ a\ vector\ subspace
      \ of\ the\ codomain . \ 
So\ the\ possibilities\ 
      \(are : 
					• {\((0, 0)\)}\), 
					
    •\ straight\ lines\ that\ pass\ through\ the\ origin, 
    \ and
					•\ ℝ\^2\ 
      \(itself . \)\)

See, for example, [Halmos 1960].

Recognizing the kernel of a linear transformation

Let T :  (ℝ^2)→(ℝ^2) be a linear transformation. 
We know that T (0, 0) = 0, so the subset of the domain  {(x, y) / T(x, y) = (0,0)} is not empty.

If T is a linear transformation, then the subset of the domain, Ker (T) = {(x, y) / T(x, y) = (0,0)},
is a subspace of  (ℝ^2) called the Kernel of T.

Our first attempt to find the kernel is graphical. As we know that Ker (T) is a vector subspace of (ℝ^2), we´ll consider straight lines passing through the origin, whose union we call S and see what happens when we transform S by the linear transformations defined above.

We associate the same gray level with each line and its image.

We first define the subsets:

s[1] = Table[{0, y}, {y, -3, 3, 0.2}]; 
  s[2] = Table[{-y, y/2}, {y, -3, 3, 0.2}]; 
  s[3] = Table[{x, 0}, {x, -3, 3, 0.2}]; 
  s[4] = Table[{-y, 2*y}, {y, -3/2, 3/2, 0.15}]; 
  s[5] = Table[{y, y/2}, {y, -3, 3, 0.2}]; 
  s[6] = Table[{y, 2*y}, {y, -3/2, 3/2, 0.15}]; 
  s[7] = Table[{-y, y}, {y, -3, 3, 0.2}]; 
  s[8] = Table[{y, y}, {y, -3, 3, 0.2}];

sPlot[n_] := drawPoints[s[n], (8 - n)/10, 0.015]; 
  setPlot = Show[{Table[sPlot[n], {n, 8}]}, PlotLabel -> "Set S", 
    DisplayFunction -> $DisplayFunction];

Here is our domain of "test sets":

So that the image of the kernel will not be obscured by the coordinate axes, we revise our drawPoints function to show a coordinate frame instead of coordinate axes:

newDrawPoints[pointSet_, shade_, size_] := 
   ListPlot[pointSet, PlotStyle -> {GrayLevel[shade], PointSize[size]}, 
    DisplayFunction -> Identity, AspectRatio -> Automatic, 
    PlotRange -> {{-2, 2}, {-2, 2}}, Axes -> False, Frame -> True, 
    FrameTicks -> {None, Automatic}];

Now we apply the transformation T2 to the subsets of S, choosing a large point size so that we don't miss the single dot:

T2s[n_] := trans[T2, s[n]];

T2sPlot[n_] := newDrawPoints[T2s[n], (8 - n)/10, 0.08];

Show[GraphicsArray[{Table[T2sPlot[n], {n, 4}], 
     Table[T2sPlot[n], {n, 5, 8}]}], DisplayFunction -> $DisplayFunction];

For this transformation, all the points on the  set S[2] go to (0, 0). Now the transformation T5:

T5s[n_] := trans[T5, s[n]];

T5sPlot[n_] := newDrawPoints[T5s[n], (8 - n)/10, 0.08];

Show[GraphicsArray[{Table[T5sPlot[n], {n, 4}], 
     Table[T5sPlot[n], {n, 5, 8}]}], DisplayFunction -> $DisplayFunction];

For this transformation, all the points on the set S[1] go to (0, 0).Now the transformation T4:

T4s[n_] := trans[T4, s[n]];

T4sPlot[n_] := newDrawPoints[T4s[n], (8 - n)/10, 0.08];

Show[GraphicsArray[{Table[T4sPlot[n], {n, 4}], 
     Table[T4sPlot[n], {n, 5, 8}]}], DisplayFunction -> $DisplayFunction];

For this transformation, apparently only (0, 0) goes to (0, 0).

As it can be seen in the graphics, S1 is the kernel of the T5 and S2 is the kernel of T2.
However, we have obtained the kernels intuitively. How can we do it in an algebraic way?
Every point that belongs to the kernel is a solution of the equation T(x, y) = (0,0), so we can obtain it with the Solve command.

We define a function called ker, as follows:

ker[T_] := Solve[T[{x, y}] == {0, 0}, {x, y}]

And now we apply it to each transformation. 
[Note: Mathematica will give us a warning message:

ker[T2]

This answer must be interpreted: Ker (T2) = {(x, y) in (ℝ^2)/ x = -2 y}

ker[T3]

ker[T4]

So, Ker (T3) = Ker (T4) =  {(0, 0)}

ker[T5]

Then, Ker (T5) =  {(x, y) in (ℝ^2)/ x = 0}

An example in (ℝ^3)

We can now show students an example of  a linear transformation  T : (ℝ^3) → (ℝ^3)  .We choose the following linear transformation  to work with:

TR[{x_, y_, z_}] := {x + z, 2*x + 2*z, 3*x + 3*z}

Trying to plot the kernel in the same way as above will result in images difficult to read, so we first find the analytically. Once we have obtained its equation, we plot the kernel with Plot3D.

Solve[TR[{x, y, z}] == {0, 0, 0}, {x, y, z}]

So the kernel is: ker (TR) = {(x, y, z) / z = -x}

Plot3D[-x, {x, -2, 2}, {y, -2, 2}, PlotLabel -> "Kernel of TR"];

Conclusion

Our work is motivated by the necessity for modifying the teaching methods we are using, to enhance students' reasoning abilities. We believe this is a trend not only in emergent countries but also in the first world [Sipcic 1995]. Computers are a powerful tool, but it is dangerous to suppose that they will "think" for us. The questions raised in the debate on computers in education in the articles [Koblitz 1996] and [Dubinsky-Noss 1996] deserve consideration.

We have presented introductory examples for linear transformations. We believe that Mathematica allows the students to analyze theoretical concepts using only some basic commands, avoiding tedious calculus. We believe that used this way, Mathematica  also helps stimulate student´s intuition for abstract mathematical concepts.

Acknowledgments

We would like to thank Dr. Juan José Manfredi, University of Pittsburgh, for helpful discussion during the workshop "Cuadernos Interactivos de Mathematica" in CAECE University, Buenos Aires, July 1996.

References

DUBINSKY, ED and NOSS, RICHARD.
"Some Kinds of Computers for Some Kinds of Learning: A Reply to Koblitz",
The Mathematical Intelligencer 18 [1] (1996)

Halmos, P. R.
Finite Dimensional Vector Spaces. Van Nostrand, 1960.

KOBLITZ, NEAL.
"The Case Against Computers in K-13 Math Education",
The Mathematical Intelligencer 18 [1] (1996)

SIPCIC, SLOBODAN.
"What is Wrong in the Way  We Teach Mechanics and How to Fix It?",
Mathematica in Education and Research, 4 [4] (1995)

SMITH, CAMERON and BLACHMAN, NANCY.
The Mathematica Graphics Guidebook
Addison-Wesley Publishing Company.