Introduction and Basic Operations
Introduction and Basic Operations
Matrices, though they may appear weird objects at first, are a very important tool in
expressing and discussing problems which arise from real life cases.
Our first example deals with economics. Indeed, consider two families A and B
(though we may easily take more than two). Every month, the two families have
expenses such as: utilities, health, entertainment, food, etc... Let us restrict ourselves
to: food, utilities, and health. How would one represent the data collected? Many ways
are available but one of them has an advantage of combining the data so that it is easy
to manipulate them. Indeed, we will write the data as follows:
If we have no problem confusing the names and what the expenses are, then we may
write
This is what we call a Matrix. The size of the matrix, as a block, is defined by the
number of Rows and the number of Columns. In this case, the above matrix has 2
rows and 3 columns. You may easily come up with a matrix which has m rows and n
columns. In this case, we say that the matrix is a (mxn) matrix (pronounce m-by-n
matrix). Keep in mind that the first entry (meaning m) is the number of rows while the
second entry (n) is the number of columns. Our above matrix is a (2x3) matrix.
When the numbers of rows and columns are equal, we call the matrix a square
matrix. A square matrix of order n, is a (nxn) matrix.
Back to our example, let us assume, for example, that the matrices for the months of
January, February, and March are
To make sure that the reader knows what these numbers mean, you should be able to
give the Health-expenses for family A and Food-expenses for family B during the
month of February. The answers are 250 and 600. The next question may sound easy
to answer, but requires a new concept in the matrix context. Indeed, what is the
matrix-expense for the two families for the first quarter? The idea is to add the three
matrices above. It is easy to determine the total expenses for each family and each
item, then the answer is
So how do we add matrices? An approach is given by the above example. The answer
is to add entries one by one. For example, we have
Clearly, if you want to double a matrix, it is enough to add the matrix to itself. So we
have
which implies
Addition of Matrices: In order to add two matrices, we add the entries one by
one.
Note: Matrices involved in the addition operation must have the same size.
Multiplication of a Matrix by a Number: In order to multiply a matrix by a
number, you multiply every entry by the given number.
Keep in mind that we always write numbers to the left and matrices to the right (in the
case of multiplication).
M-N = M + (-1)N
So first, you multiply the matrix N by -1, and then add the result to the matrix M.
Answer. We have
and since
we get
To compute J-M, we note first that
And finally, for J-F+2M, we have a choice. Here we would like to emphasize the fact
that addition of matrices may involve more than one matrix. In this case, you may
perform the calculations in any order. This is called associativity of the operations.
So first we will take care of -F and 2M to get
and
What about multiplying two matrices? Such operation exists but the calculations
involved are complicated. On the next page, we will discuss matrix multiplication.
Multiplication of Matrices
Before we give the formal definition of how to multiply two matrices, we will discuss
an example from a real life situation. Consider a city with two kinds of population: the
inner city population and the suburb population. We assume that every year 40% of
the inner city population moves to the suburbs, while 30% of the suburb population
moves to the inner part of the city. Let I (resp. S) be the initial population of the inner
city (resp. the suburban area). So after one year, the population of the inner part is
0.6 I + 0.3 S
So after one year the table which gives the two populations is
then the populations after one year are given by the formula
Remember that though we were able to perform the above multiplication, it is not
possible to perform the multiplication
We have
and
So what is the conclusion behind this example? The matrix multiplication is not
commutative, the order in which matrices are multiplied is important. In fact, this little
setback is a major problem in playing around with matrices. This is something that
you must always be careful with. Let us show you another setback. We have
In this page, we give some general results about the three operations: addition,
multiplication, and multiplication with numbers, called scalar multiplication.
1.
A+B = B+A
2.
(A+B)+C = A + (B+C)
3.
where is the mxn zero-matrix (all its entries are equal to 0);
4.
1.
Let A, B, and C be three matrices. If you can perform the products AB,
(AB)C, BC, and A(BC), then we have
(AB)C = A (BC)
Note, for example, that if A is 2x3, B is 3x3, and C is 3x1, then the above
products are possible (in this case, (AB)C is 2x1 matrix).
2.
3.
If is a number, and A and B are two matrices such that the product is
possible, then we have
4.
If A is an nxm matrix and the mxk zero-matrix, then
Note that is the nxk zero-matrix. So if n is different from m, the two zero-
matrices are different.
1.
Let A, B, and C be three matrices. If you can perform the appropriate products,
then we have
(A+B)C = AC + BC
and
A(B+C) = AB + AC
2.
Answer. We have
so
so
and
These two formulas are called linear combinations. More on linear combinations will
be discussed on a different page.
In particular, we have
The matrix In has similar behavior as the number 1. Indeed, for any nxn matrix A, we
have
A In = In A = A
The identity matrix behaves like the number 1 not only among the matrices of the
form nxn. Indeed, for any nxm matrix A, we have
In particular, we have
Invertible Matrices
Invertible matrices are very important in many areas of science. For example,
decrypting a coded message uses invertible matrices (see the coding page). The
problem of finding the inverse of a matrix will be discussed in a different page
(click here).
Definition. An matrix A is called nonsingular or invertible iff there exists
Example. Let
Write
Since
we get
or
The inverse matrix is unique when it exists. So if A is invertible, then A-1 is also
invertible and
We have seen that a matrix is a block of entries or two dimensional data. The size of
the matrix is given by the number of rows and the number of columns. If the two
numbers are the same, we called such matrix a square matrix.
its diagonal consists of a, e, and k. In general, if A is a square matrix of order n and
if aij is the number in the ith-row and jth-colum, then the diagonal is given by the
numbers aii, for i=1,..,n.
The matrices A and B are triangular. But there is something special about these two
matrices. Indeed, as you can see if you reflect the matrix A about the diagonal, you get
the matrix B. This operation is called the transpose operation. Indeed, let A be a nxm
matrix defined by the numbers aij, then the transpose of A, denoted AT is the mxn
matrix defined by the numbers bij where bij = aji. For example, for the matrix
we have
1.
(X+Y)T = XT + YT
2.
(XZ)T = ZT XT
3.
(XT)T = X
A diagonal matrix is a symmetric matrix with all of its entries equal to zero except
may be the ones on the diagonal. So a diagonal matrix has at most n different
numbers. For example, the matrices
are diagonal matrices. Identity matrices are examples of diagonal matrices. Diagonal
matrices play a crucial role in matrix theory. We will see this later on.
for n=1,2,....
Answer. We have
and
for n=1,2,..
In particular, we have
XTX = (a2 + b2 + c2). This is a 1 x 1 matrix .
Elementary operations for matrices play a crucial role in finding the inverse or solving
linear systems. They may also be used for other calculations. On this page, we will
discuss these type of operations. Before we define an elementary operation, recall that
to an nxm matrix A, we can associate n rows and m columns. For example, consider
the matrix
As we can see, the transpose of the columns of A are the rows of AT. So the transpose
operation interchanges the rows and the columns of a matrix. Therefore many
techniques which are developed for rows may be easily translated to columns via the
transpose operation. Thus, we will only discuss elementary row operations, but the
reader may easily adapt these to columns.
1.
Interchange two rows.
2.
Multiply a row with a nonzero number.
3.
Add a row to another one multiplied by a number.
Definition. Two matrices are row equivalent if and only if one may be obtained from
the other one via elementary row operations.
Answer. We start with A. If we keep the second row and add the first to the second,
we get
We keep the first row. Then we subtract the first row from the second one multiplied
by 3. We get
We keep the first row and subtract the first row from the second one. We get
First we will transform the first column via elementary row operations into one with
the top number equal to 1 and the bottom ones equal 0. Indeed, if we interchange the
first row with the last one, we get
Next, we keep the first and last rows. And we subtract the first one multiplied by 2
from the second one. We get
We are almost there. Looking at this matrix, we see that we can still take care of the 1
(from the last row) under the -2. Indeed, if we keep the first two rows and add the
second one to the last one multiplied by 2, we get
We can't do more. Indeed, we stop the process whenever we have a matrix which
satisfies the following conditions
1.
any row consisting of zeros is below any row that contains at least one nonzero
number;
2.
the first (from left to right) nonzero entry of any row is to the left of the first
nonzero entry of any lower row.
Now if we make sure that the first nonzero entry of every row is 1, we get a matrix
in row echelon form. For example, the matrix above is not in echelon form. But if we
divide the second row by -2, we get
Matrix Exponential
The matrix exponential plays an important role in solving system of linear differential
equations. On this page, we will define such an object and show its most important
properties. The natural way of defining the exponential of a matrix is to go back to the
exponential function ex and find a definition which is easy to extend to matrices.
Indeed, we know that the Taylor polynomials
When n gets large, this sequence of matrices get closer and closer to a certain matrix.
This is not easy to show; it relies on the conclusion on ex above. We write this limit
matrix as eA. This notation is natural due to the properties of this matrix. Thus we have
the formula
At this point, the reader may feel a little lost about the definition above. To make this
stuff clearer, let us discuss an easy case: diagonal matrices.
Moreover, we have
Bn = P-1AnP
eB = P-1eAP.
This matrix is upper-triangular. Note that all the entries on the diagonal are 0. These
types of matrices have a nice property. Let us discuss this for this example. First, note
that
In general, let A be a square upper-triangular matrix of order n. Assume that all its
entries on the diagonal are equal to 0. Then we have
1.
;
2.
if A and B commute, meaning AB = BA, then we have
eA+B = eAeB;
3.
for any matrix A, eA is invertible and