matrix operations
A matrix is an array, or a rectangular grid, of numbers. An matrix is one which has rows and columns. Examples ofmatrices include:
- •
The matrix
- •
The matrix
- •
The matrix
- •
The matrix
All of our example matrices (except the last one) have entries which areintegers. In general, matrices are allowed to have their entries takenfrom any ring . The set of all matrices with entries ina ring is denoted . If a matrix has exactly asmany rows as it has columns, we say it is a square matrix.
Addition of two matrices is allowed provided that both matrices have thesame number of rows and the same number of columns. The sum of two suchmatrices is obtained by adding their respective entries. For example,
Multiplication of two matrices is allowed provided that the number ofcolumns of the first matrix equals the number of rows of the secondmatrix. (For example, multiplication of a matrix with a is allowed, but multiplication of a matrix with a matrix is not allowed, since the first matrix has 3columns, and the second matrix has 2 rows, and 3 doesn’t equal 2.)In this case the matrix multiplication is defined by
We will describe how matrix multiplication works is with anexample. Let
be the two matrices that we used above as our very first two examples ofmatrices. Since is a matrix, and is a matrix, it is legal to multiply and , but it is not legal tomultiply and . The method for computing the product is toplace below and to the left of , as follows:
is always in the bottom left corner, is in the top right corner,and the product, , is always in the bottom right corner. We see fromthe picture that will be a matrix. (In general, has as many rows as , and as many columns as .)
Let us compute the top left entry of , denoted by in the abovepicture. The way to calculate this entry of (or any other entry) isto take the dot product of the stuff above it [which is ] andthe stuff to the left of it [which is ]. In this case, we have
Similarly, the top middle entry of (where the is in the abovepicture) is gotten by taking the dot product of the stuff above it:, and the stuff to the left of it: , which gives
Continuing in this way, we can compute every entry of one by one toget
and so
If one tries to compute the illegal product using thisprocedure, one winds up with
The top left entry of this illegal product (marked with a above)would have to be the dot product of the stuff above it: , and thestuff to the left of it: , but these vectors do not have the samelength, so it is impossible to take their dot product, and consequentlyit is impossible to take the product of the matrices .
Under the correspondence of matrices and linear transformations, one canshow that matrix multiplication is equivalent to composition
of lineartransformations, which explains why matrix multiplication isdefined in a manner which is so odd at first sight, and why this strangemanner of multiplication is so useful in mathematics.