. While this example has two rows
and two columns, you can build matrices with any number of rows and
columns. If a matrix has n rows and k columns, we say the shape of
the matrix is n´k. We will stick to the
2´2 case for the next day or two. The rules for
manipulating 2´2 matrices are as follows.
Addition:
.
Multiplication:
.
We can check that with these rules, 2´2
matrices satisfy field laws 1-4, 5, 7, and 9. Laws 1-4 concern addition
and since matrix multiplication is the same as regular addition in each
position, it is easy to check that it satisfies the same rules. The
associative law of multiplication isn't as obvious, but multiplying things
out shows that law 5 is satisfied as well. The commutative law of
multiplication, law 6, fails for matrices. For example
but
. There is an identity matrix,
, so law 7 is satisfied. The
rule for multiplicative inverses is
.
This only makes sense for matrices such that
, and if
then the matrix doesn't have an
inverse, so law 8 fails. Finally, we can check the distributive law works.
Since the commutative law fails, we want to check two different
situations. If A, B, and C are matrices, then
A(B + C) = AB + AC and
(B + C)A = BA + CA.
An application of matrix algebra is in the solution of simultaneous linear
equations. Suppose we want to solve the system of equations
3x + y = 5, x - 3y = 7. We can rewrite these two
equations as a single matrix equation
. We solve this equation by
multiplying both sides of the equation on the left by
which gives
so the solution to
the system of equations is x = 2.2 and
y = -1.6.
In solving linear equations as in the example above, we will find a unique solution if we have an inverse, and we will have either 0 or many (in this case infinitely many) solutions if our matrix doesn't have an inverse. This is exactly the same situation as we encountered with Zn. But where Zn is a commutative ring with identity, the ring of all 2´2 matrices is a non-commutative ring with identity. For the example of linear equation above, the only change having a non-commutative ring makes is that we need to be certain not just to multiply both sides of the equation by the same matrix, we must also multiply both sides on the same side by the same matrix. In the next lecture we will encounter a different example of a non-commutative ring, where we will see how losing the commutative law affects factoring.