Intro to Matrices

Systems of Equations:

A system of equations is a collection of equations that are all true simultaneously. For example:

```    y=3x-1
y=2x+3```

This is a system of equations with two variables. By the way, they are linear equations (they don't have squares and cubes in them), which are the easiest and most common equations. Both of these equations must hold simultaneously. y=3x-1 has infinitely many solutions, but the system of these two equations has one and only one solution. There are several ways to solve a system of equations. Here is one way (solving for x in one equation and then substituting that into the second):

```     y=3x-1
3x=y+1
x=(y+1)/3
y=2(y+1)/3+3  [substituting x=(y+1)/3 for x in the second equation of our system]
y=2y/3 + 3+2/3
y=2y/3 + 9/3 + 2/3
3y=2y+11
3y-2y=11
y=11
x=12/3=4```

You may not show all of those steps. We can also subtract equations:

```    2y=6x-2        [multiplying the first equation by 2]
3y=6x+9        [multiplying the second equation by 3]
y=11          [subtracting the first equation from the second]```

Once we have found y, we can go back and find x. Notice that subtracting -2 is the same as adding 2. We can also solve a system with two variables by graphing the two equations. We can normally tell exactly where the two lines intersect.

Solving a system of three or more equations is just as easy, but takes more steps. Here is a system of three equations:

```     x-2y+ z=-1
2x+ y-3z=3
3x+3y-2z=10```

We could subtract equations. First we might get rid of the x's by subtracting multiples of the first equation from the other two equations. This would give us two equations with two unknowns (y and z), which we could then solve by subtracting equations again. We will do something like that, below.

Matrices defined:

"Matrices" is the plural of "matrix." The above system of equations in three variables is represented by this matrix equation (a 3x3 matrix times a one dimensional matrix (vector) equals a one dimensional matrix):

A 3x4 matrix:

Let me solve this using subtractions, but without the x's, y's, and z's. I will do this with a 3x4 matrix:

```    1 -2  1 -1
2  1 -3  3
3  3 -2 10```

As these represent equations, I can subtract (or add) horizontal rows from other horizontal rows. Also I can multiply or divide a horizontal row by a number. I can also swap rows, can you tell why? See what I end up with.

```    1 -2  1 -1
2  1 -3  3
3  3 -2 10
3 -6  3 -3    [x3]
2  1 -3  3
3  3 -2 10
5 -5  0  0    [adding the first two rows]
4  2 -6  6    [x2]
9  9 -6 30    [x3]
1 -1  0  0    [/5]
5  7  0 24    [subtracting the last two rows]
3  3 -2 10    [/3]
7 -7  0  0    [x7]
5  7  0 24
3  3 -2 10
12  0  0 24    [adding the first two rows]
5  7  0 24
3  3 -2 10
1  0  0  2    [/12]
5  7  0 24
3  3 -2 10
1  0  0  2
0  7  0 14    [subtracting 5 times the first row from the second]
3  3 -2 10
1  0  0  2
0  1  0  2    [/7]
3  3 -2 10
1  0  0  2
0  1  0  2
0  3 -2  4    [subtracting 3 times the first row from the third]
1  0  0  2
0  1  0  2
0  0 -2 -2    [subtracting 3 times the second row from the third]
1  0  0  2
0  1  0  2
0  0  1  1    [times -2]```

This last matrix is what I was aiming at. It contains a special diagonal matrix, and gives us our answer: x=2, y=2, z=1. Do you see why? In matrix notation, we end up with this equation (with square brackets around the two vectors):

```    x   2
y = 2
z   1```

It is possible to do things between columns. But that can be confusing; it is limited and more complicated.

Another form of matrix is a determinant. In a later article, I will show how determinants make solving systems of equations even easier. And there are other uses for matrices.

Unsolvable systems:

Some systems cannot be solved. Here are two simple examples:

```    y=3x-1
2y=6x-2
and
y=3x-1
y=3x+3```

Question: Why can't these systems be solved? You might want to think about that, before reading further.

Answer: Well, the first is made up of two identical equations. Graphically, the two lines coincide, and have infinitely many solutions. Subtracting the two equations, you get 0=0, which is not very informative. Graphically, the second system represents two parallel lines, which have no points in common, and no solution. Subtracting the two equations gives 0=4, which is even less informative.