Enter the Matrix

I hate to disappoint you but this article has nothing to do with The Matrix movie franchise. That highly influential film series will come up at some point, but if you’re looking for “The Matrix“ I’ll refer you to Wikipedia. You may not find my article quite as entertaining as any one of The Matrix films, but I’ll do my best ;)

Eventually, we’ll be using a matrix to find the values of a few notorious variables. You may have heard of them, they’re called “x“, “y“ and “z“. I think that’s pretty exciting but I’m a little biased. How do we find values for these mysterious variables? Well, what we know so far is that x lives along a horizontal axis and y lives along a vertical axis that runs perpendicular to x. In my previous article, we used substitution to obtain a couple of constant values in a quadratic equation. In Enter the Matrix, we’ll learn other methods for obtaining the values of two variables in a linear system.

SOLVING FOR X AND Y USING A GRAPH

Sometimes the easiest way to find these values is to graph them. That’s why we think of possible x-values as living along a horizontal scale, or axis. Similarly, we put possible y-values along a vertical axis. Here’s an example…

Since we’re on the topic of movies, lets imagine we’re going to attend a local cinema and we want to buy tickets. I don’t know about you, but where I live the cinema is fancy. They like you to have a membership if you want to watch their films. In other words, if you have a membership with the theatre your ticket price is cheaper.

We can represent the ticket price for members as “x“ and the ticket price for non-members as “y“. Maybe your local cinema happens to be showing all the films in The Matrix series, and you’re not sure which movie you and your friends should start with. You decide to call the theatre to get their opinion. Once you get a real live cinema employee on the phone, you try giving her a series of explanations intricately paired with various queries about The Matrix films. At some point she interrupts you with a question of her own,

“Are any of your friends seniors?“

You decide to keep it simple, “No?“

She responds with an equation,

“2 member tickets and 3 non-member tickets are $62 total.“

You try asking another series of unique and interesting questions. This time she answers, “3 member tickets and 2 non-member tickets are a total of $58.“

By this point, you’re starting to feel it would be easiest to simply hang-up. You thank the kind woman for her time and say good-bye; still not really knowing which movie to start with but at least you’ve got the ticket prices, right?

Yep, you may not realize it but you do know the ticket prices. In fact if you wanted, you could graph these two equations (or lines) out and look at the x, y coordinates of where they intersect. Here’s a hint, I would graph these lines by finding the x and y intercepts (the points where the lines cross the axis for x and y). Where a line crosses the x-axis, y=0. Likewise, x=0 where a line crosses the y-axis. If you set y=0 in one of our equations, you can solve for x and obtain the x-intercept. If you set x=0 in the same equation and solve for y, you’ll obtain the y-intercept. Then you can draw a line connecting these two intercepts, and that represents the equation.

That’s how I graphed these lines in Sketch A.

Sketch A. shows the intersection point of two lines: 3x + 2y = 58, and 2x + 3y = 62.

Graphing the intersection of these two equations may not be the most precise method to obtain values for x and y, but it gets the job done. We find the member(x) and non-member(y) ticket prices represented as x, y coordinates for an intersection point. What if you don’t feel like drawing a graph? Is there an even easier way of finding those ticket prices? Yes, there is! It’s called, “elimination by addition“ and this is how it works.

SOLVING FOR X AND Y USING ELIMINATION BY ADDITION

We know that we can multiply both sides of an equation and obtain an equivalent expression. We can also add two equations that use the same variables, which will help us to eliminate one of our terms. With our example, we can choose to (temporarily) eliminate our y terms like this:

(3)(3x + 2y) = (58)(3)

(-2)(2x + 3y) = (62)(-2)

First we find the Least Common Multiple (linking to a Khan Academy article in case you need some LCM review) for our y-terms: 2y and 3y. The LCM here for 2 and 3, the coefficients of our y-terms, is 6. We need one equation to have a y-coefficient of +6, and the other equation to have a y-coefficient of -6 so that when we add the two equations the y-term is zeroed out.

9x +6y = 174

-4x -6y = -124

Once these two equations are added we’re left with:

5x = 50, then

x = 10

We can substitute that value for x into one of our original equations and obtain a value for y. Low and behold, we’ve got our ticket prices: $10 for members, and $14 for non-members.

As you can see, these tools (graphing, elimination, and substitution) work fine for linear problems with two variables like x and y, but what happens when we’ve got 3 or more variables? If we want to graph out a third variable then we have to add another axis (call it the z-axis) that’s perpendicular to both x and y. You can think of this axis as extending off into the distance from where both x and y are zero. The z-axis goes behind the x and y axis in one direction, and in front of the x and y axis in the opposite direction so that it’s headed straight towards you!

Is that difficult to imagine? Yes, indeed. It’s even more difficult to draw. Unfortunately, our new method, “elimination by addition“ becomes increasingly complex the more variables we add. Once there’s 3 or more variables we can’t just eliminate one of the terms, and solve the rest through substitution. It sounds like we might need another tool. I think it’s time to...

ENTER THE MATRIX

Returning to our cinema tickets, you may recall that our friendly, neighbourhood cinema employee asked if you needed any tickets for seniors. This is because there’s a third ticket price just for anyone who’s aged 65 and older. Maybe we should try calling back to find out the ticket price for seniors? Once again, you provide the cinema employee with numerous explanations and questions about The Matrix. You even inform her that your mother will be attending a show along with 4 of her senior-aged friends. The very patient cinema employee replies with a new equation:

2 member tickets, 3 non-member tickets, and 5 senior tickets add up to a total of $117.

You attempt another set of questions about The Matrix and she interrupts you with another equation:

4 member tickets, 2 non-member tickets, and 4 senior tickets total $112.

Once again, you try some questions regarding which movie to start with and this time she gives a barely audible sigh before replying:

5 member tickets, 2 non-member tickets, and 3 senior tickets add up to a total of $111.

Then she gently hangs up on you.

Uh-oh, your friendly neighbourhood cinema employee seems a little exasperated with you. Lets see if we can figure out the price of a senior’s ticket on our own. Well, we won’t exactly be on our own. As much as I’d like to take credit for the idea of using a matrix to solve variables in a linear system of equations, the truth is that this idea goes way back to the 1800s. A couple of Germans, Carl Friedrich Gauss (mathematician extraordinaire) and Wilhelm Jordan (geodesist), came up with an algorithm that was eventually named after them: Gauss-Jordan elimination. Though determining exactly who’s responsible for which part of the algorithm may be a little complicated, it is the case that this algorithm requires the use of a matrix.

Alright I’ve been hyping up the matrix quite a bit, but what is it? You can think of a matrix as a list of values that are organized into rows and columns. The values in each row correspond to coefficients of the variables you’re attempting to determine. These values are placed in a column that represents a particular variable. The number of rows that a matrix has is determined by the number of equations describing the system.

Here’s what the latest version of our ticket example looks like when we enter the coefficient values into a matrix:

xyz
235
424
523

OK, so we’ve got all the coefficients from our equations entered into matching variable columns. Are we missing anything? Yes, we’re missing the right side of each equation (the sum of each expression on the left). This is pretty important if we want to solve for our x,y,z variables. When we add a column to represent the right side of each equation, we give our matrix a special new name: augmented coefficient matrix. This is because we’ve augmented (or added to) the original matrix of coefficients. Here’s what it looks like:

xyz
235117
424112
523111

Well, we’ve now entered the matrix and you’re probably tired from all that gabbing to your local cinema employee. We still haven’t solved the great mystery of your local cinema’s price for senior’s tickets… but I’m going to leave you with a cliff-hanger!

With all the info you’ve got so far (you already know the values for x and y) you can probably solve for z. If you do, then you can compare the value you get with our result in the next article, where we’ll be pretending that we haven’t yet obtained values for x and y. We’ll learn another type of elimination that allows us to solve for all 3 variables. You may be thinking, what’s the point of learning another method of elimination if I can get values for x and y then use those to obtain z? In a way, the next method of elimination we’re about to learn does just that. Furthermore, this elimination algorithm allows us to solve for more than 3 variables. If you still have some energy take a look at this wonderful article from Wikipedia about Gaussian elimination, as that’s the method we’ll be using.

Until then stay smart, be kind, and try not to spend too much time bugging your friendly, neighbourhood cinema employee.

TO BE CONTINUED…

I may not have a franchise, but I do have a sequel!! :)

Christine Nicole