Wednesday, August 26, 2026

Forty Years of Teaching Math, Computer Science and Engineering Science at a Community College- Part XIII- Linear Algebra




From 2001 until the time I retired I taught Linear Algebra every spring. In the 1970's Linear Algebra was a gateway to higher math for math majors and was taught in a very abstract fashion.  Through the years Linear Algebra became more applied, catering more to engineers and computer scientists.  A second course in Linear Algebra includes all the theory that was previously taught in the first course, and then some.  My course changed with the times.

I was pleasantly surprised in my last few years to have a fine group of computer science students. Some of them came into the class with a list of topics they wanted to learn. These bright students were well read in their field.  There was this barrier that they could not cross, and it was mostly Linear Algebra. Linear Algebra had emerged as a central course for AI in general, and specifically for machine learning.  Linear Algebra is also central for computer vision, computer graphics, gaming and robotics. Suffice it to say, Linear Algebra is a very important course, and its importance is growing as we speak. 

A simple problem in Linear Algebra is to take a bunch of points that represent a surface in 3D, multiply each point by an appropriate matrix, and surprise, the new set of points is the original surface rotated about a given axis.  Encoded in the rotational matrix is the axis of rotation and the number of degrees of the rotation. Humans see by viewing two 2D images - one rotated a fixed number of degrees from the other - and constructing a 3D image in our brain.  In Linear Algebra we can replicate this for a machine. 

Linear Algebra is also useful in just about every engineering course.  It is not required in engineering because there is already 150+ hours required by ABET.  Engineering students are faced with taking 153+ hours or learning the subject on the fly while they are taking 4 or 5 engineering courses in their junior year.  A handful of engineering students ended up in Linear Algebra, although they were not as curious about the subject matter, mostly because they were curious about how they would survive Dynamics, Mechanics of Materials, Circuits and Differential Equations, along with Linear Algebra, all in the same semester!

In my next-to-last semester I had one particular student who, on the first day, asked me if we were going to learn how to factor matrices using QR Decomposition, and I think one other method.  There are several different types of factoring, all with specific uses, and multiple algorithms for each type of factorization.   

Factoring matrices is particularly useful with machine learning. Specifically, it is important in determining what variables are not important in a set of data.  Humans are particularly good at this as we go through life. When we round a corner, for instance, we decide the color of a nearby house has nothing to do with how fast we should go.  Matrix factorization and Linear Algebra in general helps us replicate that process with machines while they learn. 

Anyway,  a student asked me about a specific kind of matrix factoring, so I told him I would oblige.  Weeks later, he asked again, and I said not yet. I can't remember how many times it was brought up, but I stalled until the end of the semester.  

When I did finally show the class how to do QR factorization, the algorithm I used was easily and fully understood by the whole class, because various elements were based on all they had learned throughout the whole semester. During Week 1 of the class, I would have lost them 5 minutes in. By week 15 the class not only understood how to do the procedure, but they fully understood why the procedure worked, because of all the theory that was covered previously in the class.  A topic that was once an impenetrable barrier was now a joy to learn!

I explained how pretty much anything else these students needed to know in Linear Algebra, at least applied to machine learning, AI and any other Comp. Sci. subject, could likely be self taught and fully understood. The course I put together made it so.  It was a great meta-lesson, brought about by the students' curiosity.  I had heard numerous times that our computer science students were ill-prepared and slow.  I certainly did not see this with the dozen or so students I worked with each spring in Linear Algebra. 

The above picture is from one of many short courses available for students entering various fields that require Linear Algebra.  I used to pass one or two of these out, allowing students to follow along as we developed the course. My course always covered about 95% of each of these short courses, plus a lot of theory and practice that gave students a deeper understanding of such things.  In robotics, one of these constituted a beginning graduate-level course. I told students they were welcome to ask any question about Linear Algebra that pertained to any other field, if they chose.  Sometimes they would take me up on that offer, successfully.  Through the years I got all sorts of crazy questions.  It was a very simple and efficient way to use my students' curiosity to keep myself up to date in such matters.  Looking back, it is ironic how I let my students teach me, and then I in turn was able to teach them in a more up-to-date fashion. 

On a humorous note, I would always reserve the last day of class to "attack Canada." There was always a build up to this point, where I would promise to give them enough tools to launch an attack.  The students, of course, knew I was not serious.  It was very funny because it was such a preposterous idea. 

It is easy to formulate such a problem where we are adding soldiers by breeding, and subtracting them due to combat loss and natural deaths. Since it is an easy problem to visualize, it is a good problem. The usual solution requires solving a linear, first order system of differential equations. Using eigenvectors (part of Linear Algebra,) the whole solution can be solved very simply, without using any calculus.  

Since our population is about 10 times that of Canada, we needed to make Canadians great lovers and even better fighters to win a war.  Canadian beer would enter the picture, at least on one side of the equation. We had a lot of fun with that!  

Eigenvectors are a central topic for all the various subjects listed above, and a subject that is often given little attention at universities. Eigenvectors are usually in a college or university Linear Algebra syllabus, but quite often disinterested professors don't organize their courses well enough to give it due attention at the end of the semester. At the end of the semester we would bring to bear all the theory we learned, to give students a great understanding of such things.