Lines the Linear Algebra Way

Let’s continue with the idea of reinterpreting some high school algebra concepts in the light of linear algebra. For example, we learn even before high school in some cases that a line on a coordinate plane can be defined by two points or it can be defined by a point and the slope of the line.

When we have two points, \(\mathtt{(x_1, y_1)}\) and \(\mathtt{(x_2, y_2)}\), we can determine the slope with \[\mathtt{\frac{y_2 – y_1}{x_2 – x_1}}\]

and then do some substitutions to work out the y-intercept.

The linear algebra way uses vectors, of course. And all we need is a point and a vector to define a line. Or, really, two vectors, since the point can be described as a position vector and the slope is also a vector.

We have the line here defined as a vector plus a scaled vector—scaled by k. (See here for adding vectors and here for scaling them.) \[\color{brown}{\begin{bmatrix}\mathtt{1}\\\mathtt{3}\end{bmatrix}} + \color{blue}{\begin{bmatrix}\mathtt{\,\,\,\,1}\\\mathtt{-1}\end{bmatrix}\mathtt{k}}\] That second, scaled, vector looks like it could do the job of defining the line all by itself, but free vectors like that don’t have a fixed location, so we need a position vector to “fix” that. In general terms, thinking about the free vector as extending from \(\mathtt{(x_1, y_1)}\) to \(\mathtt{(x_2, y_2)}\), we can write the equation for a line as \[\mathtt{l(k) = }\begin{bmatrix}\mathtt{x_1}\\\mathtt{y_1}\end{bmatrix} + \begin{bmatrix}\mathtt{x_2 – x_1}\\\mathtt{y_2 – y_1}\end{bmatrix}\mathtt{k}\] That form is called the parametric form of an equation and can be written as \(\mathtt{l(k) = p + kv}\), where p is a point (or position vector), v is the free vector, and k is a scalar value—the parameter that we change to get different points on the line.

Let’s put this into the context of a (reworded) word problem:

In 2014, County X had 783 miles of paved roads. Starting in 2015, the county has been building 8 miles of new paved roads each year. At this rate, if n is the number of years after 2014, what function gives the number of miles of paved road there will be in County X? (Assume that no paved roads go out of service.)

The equation we’re after is \(\mathtt{f(n) = 783 + 8n}\). As a vector function this can be written as \[\mathtt{f(n) = }\begin{bmatrix}\mathtt{0}\\\mathtt{783}\end{bmatrix} + \begin{bmatrix}\mathtt{1}\\\mathtt{8}\end{bmatrix}\mathtt{n}\] We can see here, perhaps a little more clearly with the vector representation, that our domain is restricted by the situation. Our parameter n is, at the very least, a positive real number, and really a positive integer.

It seems to me that here is at least one other example of a close relationship between linear algebra and current high school algebra instruction that would make absorbing linear algebra into some high school material feasible.

If you’d like to practice with some items related to this post, visit Linear Algebra Exercises I.

Zukei and Dot Products

Zukei puzzles that ask students to find right triangles seem to rely on an understanding of perpendicularity that is situated more comfortably in linear algebra than in Euclidean geometry. Consider the following, which has a hidden isosceles right triangle in it. Your job is to find the vertices of that isosceles right triangle.

zukei

High school students would be expected to look at perpendicularity either intuitively—searching for square corners—or using the slope criteria, that perpendicular lines have slopes which are negative reciprocals of each other. But it seems a bit much to start treating this puzzle as a coordinate plane and determining equations of lines.

The Dot Product

In all fairness, the dot product is a bit much too. Instead, we can operationalize slopes with negative reciprocals by, for example, starting from any point, counting 1, 2, . . . n to the left or right and then 1, 2, . . . n up or down to get to the next point. From that point, we have to count left-rights in the way we previously counted up-downs and up-downs in the way we counted left-rights, and we have to reverse one of those directions. For the puzzle above, we count 1, 2 to the right from a point and then 1, 2 up to the next point. From that second point, it’s 1, 2 right and then 1, 2 down. It’s a little harder to see our counting and direction-switching rule at work when the slopes are 1 and –1, but, in the Zukei context at least, the slopes have to be 1 and –1, I think, to get an isosceles right triangle if we’re not talking about square corners.

This kind of counting is really treating the possible triangle sides as vectors. And, with perpendicular vectors, we can see that we can get something like one of these two pairs (though perpendicular vectors don’t have to look like this): \[\mathtt{\begin{bmatrix} x_1\\x_2 \end{bmatrix} \textrm{and} \begin{bmatrix} -x_2\\ \,\,\,\,x_1 \end{bmatrix} \textrm{or} \begin{bmatrix} x_1\\x_2 \end{bmatrix} \textrm{and} \begin{bmatrix} \,\,\,\,x_2\\-x_1 \end{bmatrix}}\]

The dot product is defined as the sum of the element-wise products of the vector components. In the case of perpendicular vectors, the dot product is 0. Here is the dot product of our vectors: \[\mathtt{(x_1 \cdot -x_2) + (x_2 \cdot x_1) = 0}\]

Some Programming

One reason why this way of defining perpendicularity (with a single value) is helpful is that we avoid nasty zero denominators and, therefore, undefined slopes. With the two vectors at the right, we get \[\mathtt{\begin{bmatrix}0\\5\end{bmatrix} \cdot \begin{bmatrix}4\\0\end{bmatrix} = (0)(4) + (5)(0) = 0}\]

We can take all of the points and run them through a program to find all the connected perpendicular vectors. The result ((0, 1), (1, 0)), ((0, 1), (2, 3)) below means that the vector connecting (0, 1) and (1, 0) and the vector connecting (0, 1) and (2, 3) are perpendicular.

This gives us all the perpendicular vector pairs, though it doesn’t filter out those vectors with unequal magnitudes, which we wanted in order to identify the isosceles right triangle.

There are some Zukei solvers available, though I confess I haven’t looked at any of them. No doubt, one or all of them use linear algebra rather than ordinary coordinate plane geometry to do their magic. It’s about time, I think, we start weaving linear algebra into high school algebra and geometry standards.

Solving Zukei puzzles is not the best justification for bringing linear algebra down into high school, of course. But I hope it can be a salient example of how connected linear algebra can be to a lot of high school content standards.