Keywords

These keywords were added by machine and not by the authors. This process is experimental and the keywords may be updated as the learning algorithm improves.

A matrix is a two-dimensional array of numbers. Sometimes it is natural to classify data in two ways—for example, you might classify your music collection by media (MP3 or CD) or by type (folk, heavy metal, …); a realtor might classify her listings by area or by price. Matrices are useful for representing this type of data. Matrices arise in many parts of mathematics; usually they are studied as part of linear algebra.

There are many applications of matrices in discrete mathematics. They are particularly important in the study of relations and graphs, so we have included a section that briefly introduces those applications. Many other properties of graphs and relations can be deduced using further algebraic properties of matrices.

8.1 Vectors and Matrices

8.1.1 Vectors

A vector is an ordered finite set of numbers. We say real vector if all the elements are real numbers; we can also talk about integer vectors, and so on. If it is required that all elements belong to some number set, those numbers are called the scalars for those vectors.

The number of elements in a vector is called its dimension or length. The set of all real vectors of dimension n will be denoted ℝn. The set ℝ2 is familiar from geometry because the coordinates of points in the plane are just members of ℝ2. Similarly, ℝ3 is the set of coordinates of points in three-dimensional space.

When we talk about the elements of a vector and specify their positions we usually call them entries. The usual notation for a vector is to denote its ith entry by subscript i. The vector v has entries v 1,v 2,…, and we write v=(v 1,v 2,…). Two vectors are equal if and only if they are equal in every position (componentwise equal): u=v if and only if u i =v i for every i. It follows that equal vectors must be of the same dimension.

In physics or in geometry we encounter vectors as directed line segments. If you prefer to think of them in this way, then the vector (1,2,1) corresponds to the directed line from the origin to point (1,2,1) in three-dimensional space.

There are two standard operations on vectors: one may multiply by a scalar, and one may add vectors. They are defined as follows.

If v=(v 1,v 2,…,v n ), and k is any scalar, then k v=(kv 1,kv 2,…,kv n ). If u=(u 1,u 2,…,u n ), and v=(v 1,v 2,…,v n ), then

$$\boldsymbol{u}+ \boldsymbol{v}= \bigl((u_1 + v_1),\break (u_2 + v_2), \ldots, (u_n + v_n)\bigr).$$

If u and v are vectors of different lengths, then u+v is not defined.

It is easy to see that vector addition satisfies the commutative and associative laws: if u and v are any two vectors of the same length, then

$$\boldsymbol{u}+\boldsymbol{v}= \boldsymbol{v}+ \boldsymbol{u},$$

and any three vectors t,u, and v of equal length satisfy

$$\boldsymbol{t}+ (\boldsymbol{u}+ \boldsymbol{v}) = (\boldsymbol{t}+ \boldsymbol{u}) + \boldsymbol{v}.$$

We usually omit brackets when writing the sum of three or more vectors, so this common value is simply denoted t+u+v.

There are also two laws involving multiplication by a scalar. If a and b are any numbers and u and v are any two equal-length vectors, then

$$a(b\boldsymbol{u}) = (ab)\boldsymbol{u},$$

and

$$a(\boldsymbol{u}+ \boldsymbol{v}) = (a\boldsymbol{u}) + (a\boldsymbol{v}).$$

Again we follow the same convention as ordinary arithmetic and omit brackets, writing the last expression as simply a u+a v.

Sample Problem 8.1

Calculate 3(1,−1,3) and (2,2)+(−1,3).

Solution

3(1,−1,3)=(3,−3,9); (2,2)+(−1,3)=(1,5).

Practice Exercise

Calculate 4(2,0,−1)+(1,4,−3).

Subtraction is defined in the natural way: \(\boldsymbol{u}- \boldsymbol{v}= ((u_{1} - v_{1}), (u_{2} - v_{2}),\ldots, (u_{n} - v_{n}))\). If we write −v=(−v 1,−v 2,…,−v n ), then uv=u+(−v), and moreover −v=(−1)v.

It is natural to define a zero vector 0=(0,0,…,0) (in fact, a family of zero vectors, one for each possible dimension). Then v+(−v)=0, as one would expect.

8.1.2 Lines; the Scalar Product

The equation of a straight line in coordinate geometry can be written in the form

$$ax + by = c,$$

where a, b, and c are numbers and x,y are the usual variables. The equation involves two vectors, the vector (a,b) of coefficients and the vector (x,y) of variables. For this reason it is natural to associate ax+by with the two vectors (a,b) and (x,y).

We define the scalar product of two vectors u=(u 1,u 2,…,u n ) and v=(v 1,v 2,…,v n ) to be

$$\boldsymbol{u}\cdot \boldsymbol{v}= (u_1v_1 + u_2v_2 + \cdots + u_nv_n) = \sum_{k = 1}^n{u_kv_k}.$$

This is also called the dot product of the two vectors. In this notation a typical straight line in two-dimensional geometry has an equation of the form

$$\boldsymbol{a}\cdot \boldsymbol{x}= c,$$

where a is some vector of two real numbers, x is the vector of variables (x,y), and c is a constant. If a and x are of length three, then ax=c can be the equation of a plane in three-dimensional space.

Sample Problem 8.2

Suppose t=(1,2,3),u=(−1,3,0), and v=(2,−2,2). Calculate uv,(tu)⋅v, and 3(vt).

Solution

uv=−2−6+0=−8; \((\boldsymbol{t}- \boldsymbol{u})\cdot \boldsymbol{v}=(2,-1,3)\cdot(2, -2, 2) = 4+ 2+6 = 12 \); 3(vt)=3×8=24.

Practice Exercise

Calculate ut and (2u−3v)⋅t.

Sample Problem 8.3

Suppose (x,3)=(4,x+y). What are x and y?

Solution

Two vectors are equal if and only if their components are equal. So we have the two equations x=4 and 3=x+y. So x=4 and y=−1.

Practice Exercise

Suppose (2x,2)=(y,x). What are x and y?

It is not hard to see that the scalar product is commutative. There is no need to discuss the associative law because scalar products involving three vectors are not defined. For example, consider t⋅(uv). Since (uv) is a scalar, not a vector, we cannot calculate its dot product with anything.

8.1.3 Matrices

Just as one linear equation can be written as one vector equation, a set of linear equations can be written as a set of vector equations. For example, the equations

can be written as

$$\big( ( 2,1) \cdot (x,y) , (3, -2) \cdot (x,y) \big) = (3,1 ),$$

or, a little easier to read,

$$\left[\begin{array}{r}( 2,1) \cdot (x,y) \\(3, -2) \cdot (x,y) \end{array} \right] = \left[\begin{array}{l}3 \\1 \end{array} \right] .$$

This can be seen as the two-dimensional array of numbers

$$\left[\begin{array}{c@{\quad}c}2&1\\3&-2\end{array} \right],$$

acting on the vector (x,y) to produce the vector (3,1). We shall call this array a matrix. We usually denote matrices by capital letters, to distinguish them from scalars (numbers).

Just as a vector generalizes a number, a matrix generalizes a vector. A matrix is any rectangular (two-dimensional) array of numbers. A typical matrix is

$$M =\left[\begin{array}{c@{\quad}c@{\quad}c@{\quad}c}1 & -1 & 4 & 3 \\2 & 3 & -4 & 1 \\4 & -4 &4 & 8\end{array} \right] .$$

This example is a 3×4 real matrix (and it is, in fact, a 3×4 integer matrix). We call 3×4 the shape or size of the matrix, and the two numbers 3 and 4 are its dimensions.

A vector can be interpreted as a matrix with one of its dimensions 1. A 1×n matrix is called a row vector and an n×1 matrix is called a column vector. An m×n matrix can be viewed as a vertical stack of m row vectors, and those vectors are called the rows of the matrix. Alternatively, we can see it as a horizontal array of column vectors, called the columns of the matrix. Our example M can be viewed as

$$\left[\begin{array}{c@{\quad}c@{\quad}c@{\quad}c}(1 & -1 & 4 & 3) \\(2 & 3 & -4 & 1) \\(4 & -4 &4 & 8)\end{array} \right] \ \mbox{or}\ \left[ \left[ \begin{array}{r} 1 \\ 2\\ 4 \end{array} \right]\left[ \begin{array}{c}-1 \\ 3\\ -4 \end{array} \right]\left[ \begin{array}{c} 4 \\ -4\\ 4 \end{array} \right]\left[ \begin{array}{c} 3 \\ 1\\ 8 \end{array} \right] \right].$$

The element in the ith row and jth column is called the (i,j) element of the matrix. It is standard to denote the (i,j) element of a matrix A by a ij , and write A=(a ij ). This is particularly useful when a formula is given for a ij . For example, we might refer to the 3×3 matrix whose (i,j) element equals i+j, namely

$$\left[\begin{array}{c@{\quad}c@{\quad}c}2 & 3 & 4 \\3 & 4 & 5 \\4 & 5 & 6\end{array} \right] ,$$

as “the 3×3 matrix (i+j).”

8.1.4 Sums and Products

The sum of two matrices and the product of a scalar with a matrix are defined analogously to the vector case. We again define negatives by −A=(−1)A. Addition satisfies the commutative and associative laws, and the scalar product laws a(bC)=(ab)C and a(C+D)=aC+aD.

Sample Problem 8.4

Suppose A,B, and C are the matrices

$$A = \left[ \begin{array}{c@{\quad}c}1 & 3 \\ -1 & 2\end{array}\right],\qquad B = \left[ \begin{array}{c@{\quad}c}-2 & 0 \\ 1 & 4\end{array}\right],\qquad C = \left[ \begin{array}{c@{\quad}c@{\quad}c} -1 & 4 & 3 \\ -1 & -2 & -1 \end{array}\right].$$

Find A+B, 2A−3B, 3A+C, −C.

Solution

3A+C is not defined, as A and C are of different sizes.

Practice Exercise

Calculate −A, 3AB, B+C.

We define the product of two matrices as a generalization of the scalar product of vectors. Suppose the rows of the matrix A are a 1,a 2,…, and the columns of the matrix B are b 1,b 2,…. Then AB is the matrix with (i,j) entry a i b j . These entries will only exist if the number of columns of A equals the number of rows of A, so this is a necessary condition for the product AB to exist.

Sample Problem 8.5

Suppose

$$A = \left[\begin{array}{c@{\quad}c}1 & 2 \\1 & -1\end{array} \right] ,\qquad B = \left[\begin{array}{c@{\quad}c}-1 & 1 \\2 & 0\end{array} \right] .$$

Find AB and BA.

Solution

First we find AB. The rows of A are a 1=(1,2) and a 2=(1,−1). The columns of B are b 1=(−1,2) and b 2=(1,0). (Since we are treating them as vectors, it does not matter whether we write them as row or column vectors.) Then a 1b 1=−1+4=3, and similarly a 1b 2=1, a 2b 1=−3 and a 2b 2=1. So

$$AB = \left[\begin{array}{c@{\quad}c}\boldsymbol{a}_1 \cdot \boldsymbol{b}_1 & \boldsymbol{a}_1 \cdot \boldsymbol{b}_2 \\\boldsymbol{a}_2 \cdot \boldsymbol{b}_1 & \boldsymbol{a}_2 \cdot \boldsymbol{b}_2\end{array} \right] =\left[\begin{array}{c@{\quad}c}3 & 1 \\-3 & 1\end{array} \right] .$$

Similarly we find

$$BA = \left[\begin{array}{c@{\quad}c}0 & -3 \\2 & 4\end{array} \right] .$$

The entries in AB will only exist if the number of columns in A equals the number of rows in B. For example, if A were 3×2 and B were 4×4, the product will not exist. In general, we can say the following.

Theorem 52

Suppose A is an m×n matrix and B is an r×s matrix. If n=r, then AB exists and is an n×s matrix. If nr, then AB does not exist.

If A were 2×3 and B were 3×4, then AB would be a 2×4 matrix but BA would not exist. It is also possible that AB and BA might both exist, but might be of different shapes. For example, if A and B have shapes 2×3 and 3×2, respectively, then AB is 2×2 and BA is 3×3. And we observe from the preceding example that, even when AB and BA both exist and are the same shape, they need not be equal. There is no commutative law for matrix multiplication.

We shall look at some more properties of matrix multiplication in the next section.

8.1.5 Transposition

If A is an m×n matrix, then we can form an n×m matrix whose (i,j) entry equals the (j,i) entry of A. This new matrix is called the transpose of A, and written A T. A matrix A is called symmetric if A=A T.

Sample Problem 8.6

What is the transpose of the matrix A from Sample Problem 8.5?

Solution

$$A^T = \left[\begin{array}{c@{\quad}c}1 & 1 \\2 & -1\end{array} \right] .$$

Practice Exercise

What is the transpose of the matrix B from Sample Problem 8.5?

The transposition symbol is applied only to the matrix nearest to it. For example, the expression AB T means A(B T), not (AB)T.

Exercises 8.1

  1. 1.

    Verify that real matrices satisfy the commutative and associative laws.

Carry out the vector computations in Exercises 2 to 23.

  1. 2.

    4(2,−2).

  2. 3.

    −(2,−2).

  3. 4.

    2(5,1,−1).

  4. 5.

    3(3,6,1).

  5. 6.

    (2,3)+(1,4).

  6. 7.

    3(2,3)−2(1,4).

  7. 8.

    (1,0,3)+3(4,4,4).

  8. 9.

    2(−1,−1,2)−2(2,−1,−1).

  9. 10.

    3(−1,2,3)+2(1,1,−1).

  10. 11.

    3(1,−2,2)+2(2,3,−1).

  11. 12.

    3(1,0,1,0)−4(2,0,−1,−1).

  12. 13.

    2(4,−1,2,3)−3(1,6,−2,−3).

  13. 14.

    (2,3)⋅(1,−1).

  14. 15.

    (1,−1)⋅(2,3).

  15. 16.

    (1,1,−1)⋅(2,0,3).

  16. 17.

    (1,3,3)⋅(1,0,−2).

  17. 18.

    (4,2,1)⋅(1,2,4).

  18. 19.

    (1,−1,−2)⋅(3,2,−1).

  19. 20.

    (0,2,1,1)⋅(3,4,2,1).

  20. 21.

    (−1,2,−1,3)⋅(2,4,−3,−1).

  21. 22.

    (3,−1,3,2)⋅(−1,−1,2,1).

  22. 23.

    (1,−2,5,2)⋅(2,2,3,1).

A is a 2×4 matrix; B is 2×4; C is 1×3; D is 4×2; E is 3×4; F is 4×3; G is 4×4. In Exercises 24 to 41, say whether the indicated matrix exists. If it does exist, what is its shape?

  1. 24.

    A+B.

  2. 25.

    2AB.

  3. 26.

    CE.

  4. 27.

    AD.

  5. 28.

    D(A+B).

  6. 29.

    CF.

  7. 30.

    F T.

  8. 31.

    CF T.

  9. 32.

    2FC.

  10. 33.

    DA.

  11. 34.

    AD+DA.

  12. 35.

    BFE.

  13. 36.

    GG.

  14. 37.

    FF.

  15. 38.

    DA+3G.

  16. 39.

    CEF.

  17. 40.

    CFE.

  18. 41.

    AGF.

  19. 42.

    Suppose a,b are any two real numbers and C,D are any two real matrices of the same shape. Prove the following equalities.

    1. (i)

      a(bC)=(ab)C.

    2. (ii)

      a(C+D)=aC+aD.

    3. (iii)

      (a+b)C=aC+bC.

In Exercises 43 to 48, carry out the matrix computations.

  1. 43.

    \(\left[\begin{array}{c@{\quad}c}4 & -1 \\-2 & 0\end{array} \right] + \left[\begin{array}{c@{\quad}c}3 & -1 \\-1 & 2\end{array} \right]\).

  2. 44.

    \(3\left[\begin{array}{c@{\quad}c@{\quad}c}1 & -1 & -1 \\-2 & 0 & 10\end{array} \right]\).

  3. 45.

    \(3\left[\begin{array}{c@{\quad}c}10 & -1 \\2 & 7\end{array} \right] - 2 \left[\begin{array}{c@{\quad}c}1 & -1 \\-1 & 1\end{array} \right]\).

  4. 46.

    \(\left[\begin{array}{c@{\quad}c}3 & -4 \\3 & 0\end{array} \right] \left[\begin{array}{c@{\quad}c}6 & -2 \\-7 & 4\end{array} \right]\).

  5. 47.

    \(\left[\begin{array}{c@{\quad}c@{\quad}c}2 & 0 & 1 \\3 & -1 & 1\end{array} \right] \left[\begin{array}{c@{\quad}c}2 & -1 \\1 & -1 \\-1 & 1\end{array} \right]\).

  6. 48.

    \(\left[\begin{array}{c@{\quad}c}2 & -1 \\1 & -1 \\-1 & 1\end{array} \right]\left[\begin{array}{c@{\quad}c@{\quad}c}2 & 0 & 1 \\3 & -1 & 1\end{array} \right]\).

In Exercises 49 to 64,

$$\begin{array}{rcl@{\qquad}rcl@{\qquad}rcl}A &=& \left[\begin{array}{c@{\quad}c}1 & -1 \\-2 & 3\end{array} \right], & B &=& \left[\begin{array}{c@{\quad}c@{\quad}c}3 & 0 & -1 \\-1 & 4 & 4\end{array} \right], & C &=& \left[\begin{array}{r}6 \\2\end{array} \right],\\[15pt]D &=& \left[\begin{array}{c@{\quad}c@{\quad}c}-1 & 1 & -1 \\1 & 3 & 3 \\-2 & 2 & 0\end{array} \right], & E &=& \left[\begin{array}{c@{\quad}c}1 & -1 \\1 & 0 \\2 & 2\end{array} \right], & F &=& \left[\begin{array}{r}2 \\-1 \\2\end{array} \right], \\[20pt]G &=& \left[\begin{array}{c@{\quad}c@{\quad}c}2 & 1 & -1\end{array} \right], & H &=& \left[\begin{array}{c@{\quad}c}2 &2\end{array} \right], & K &=& \left[\begin{array}{c@{\quad}c}-1 & 2\end{array} \right].\end{array}$$

Carry out the matrix computations, or explain why they are impossible.

  1. 49.

    2A.

  2. 50.

    BD.

  3. 51.

    AC.

  4. 52.

    EF.

  5. 53.

    BF.

  6. 54.

    B T.

  7. 55.

    2H−3K.

  8. 56.

    HA+2K.

  9. 57.

    CF.

  10. 58.

    DEB.

  11. 59.

    BG.

  12. 60.

    KB.

  13. 61.

    GD.

  14. 62.

    CE T.

  15. 63.

    EK+KB.

  16. 64.

    2F+G.

  17. 65.

    Suppose

    $$\left[\begin{array}{c@{\quad}c}x & -1 \\-1 & 2\end{array} \right] = \left[\begin{array}{c@{\quad}c}y+1 & -1 \\-1 & x\end{array} \right] .$$

    What are the values of x and y?

  18. 66.

    Find x,y, and z so that

    $$\left[\begin{array}{c@{\quad}c@{\quad}c}x-2 & 3 & z \\y & x & 2y\end{array} \right] =\left[\begin{array}{c@{\quad}c@{\quad}c}y & z & 3 \\3z & y+2&6z\end{array} \right] .$$
  19. 67.

    A and B are any two matrices such that AB exists. Prove that B T A T exists and that

    $$B^TA^T = (AB)^T.$$

8.2 Properties of the Matrix Product

8.2.1 Identity Elements

Suppose A is an r×s matrix. Adding 0 to every entry will not change A. So the r×s matrix with every entry 0 will act like a zero element, or additive identity, for A. We shall denote this matrix by O r,s and call it a zero matrix. Usually the subscripts can be omitted because the shape can be deduced from the context. For any matrix A, the appropriate zero matrix satisfies

$$A + O = O + A = A \quad \mbox{and}\quad A + (-A) = (-A) + A = O.$$

Writing −A for (−1)A is an extension of the notation we used for zero vectors, and is consistent with the usual arithmetical notations for zero and negatives.

The zero matrix also behaves under multiplication the way you would expect: provided zero matrices of appropriate size are used,

$$OA = O \quad \mbox{and}\quad AO = O.$$

This is not just one rule, but an infinite set of rules. If we write in the subscripts, then the full statement is as follows.

If A is any r×s matrix, then O m,r A=O m,s for any positive integer m, and AO s,n =O r,n for any positive integer n.

There are also multiplicative identity elements. We define I n to be the n×n matrix with its (1,1),(2,2),…,(n,n) entries 1 and all other entries 0. For example,

$$I_3 = \left[\begin{array}{c@{\quad}c@{\quad}c}1 & 0 & 0 \\0 & 1 & 0 \\0 & 0 & 1\end{array} \right].$$

If A is any r×s matrix, then I r A=A=AI s .

We call I n an identity matrix of order n.

8.2.2 Commutativity

We saw that the commutative law does not hold for matrices in general. Even if AB and BA are both defined and are the same size, it is possible for the two products to be different (see Sample Problem 8.5). On the other hand, some pairs of matrices have the same product in either order. If AB=BA we say that A and B commute, or A commutes with B. For example, any 3×3 matrix commutes with I 3. There are many other examples.

Sample Problem 8.7

Show that the following matrices commute.

$$A = \left[\begin{array}{c@{\quad}c}1 &-2 \\1 &-1\end{array} \right],\qquad B = \left[\begin{array}{c@{\quad}c}1 & 2 \\-1 & 3\end{array} \right].$$

Solution

$$AB = BA = \left[\begin{array}{c@{\quad}c}3 & -4 \\2 & -1\end{array} \right].$$

Practice Exercise

Show that the following matrices commute.

$$C = \left[\begin{array}{c@{\quad}c}3 & 1 \\-1 & 1\end{array} \right],\qquad D = \left[\begin{array}{c@{\quad}c}2 & 1 \\-1 & 0\end{array} \right].$$

Suppose A has shape m×n and B is r×s. If both AB and BA exist, then necessarily n=r and m=s; then AB is m×m and BA is n×n. In order for A and B to commute, we must have m=n. Both A and B must have the same number of rows as columns. Such a matrix is called square, and the common dimension is called its order.

If A is square, we can evaluate the product AA. We call this A squared, and write it as A 2, just as with powers of numbers. We define other positive integer powers similarly: A 3=AAA=AA 2, and in general A n+1=AA n.

8.2.3 Inverses

If the matrices A and B satisfy AB=BA=I, we say that B is an inverse of A.

In the real numbers, everything but 0 has an inverse. In the integers, only 1 and −1 have integer inverses, but we know that we can obtain inverses of other nonzero integers by going to the rational numbers. The situation is obviously more complicated for matrices because only a square matrix can have an inverse. Moreover, there are nonzero square matrices without inverses, even if we restrict our attention to the 2×2 case.

Sample Problem 8.8

Show that the matrix

$$A = \left[\begin{array}{c@{\quad}c}2 & 1 \\2 & 1\end{array} \right]$$

has no inverse.

Solution

Suppose A has inverse

$$B = \left[\begin{array}{c@{\quad}c}x & y \\z & t\end{array} \right] .$$

Then AB=I, so

$$\left[\begin{array}{c@{\quad}c}2 & 1 \\2 & 1\end{array} \right] \left[\begin{array}{c@{\quad}c}x & y \\z & t\end{array} \right] = \left[\begin{array}{c@{\quad}c}2x+z & 2y+t \\2x+z & 2y+t\end{array} \right] = \left[\begin{array}{c@{\quad}c}1 & 0 \\0 & 1\end{array} \right] .$$

The (1,1) entries of the two matrices must be equal, so 2x+z=1; but the (2,1) entries must also be equal, so 2x+z=0. This is impossible.

Practice Exercise

Show that the matrices

$$C = \left[\begin{array}{c@{\quad}c}1 & 0 \\0 & 0\end{array} \right] \quad \mbox{and}\quad D = \left[\begin{array}{c@{\quad}c}0 & 1 \\0 & 0\end{array} \right]$$

have no inverses.

A matrix that has an inverse will be called invertible or nonsingular; a square matrix without an inverse is called singular.

We used the phrase “an inverse” above. However, we shall prove that, if a matrix has an inverse, it is unique.

Theorem 53

If matrices A, B, C satisfy AB=BA=I and AC=CA=I, then B=C.

Proof

Suppose A,B, and C satisfy the given equations. Then

$$C = CI = C(AB) = (CA)B = IB = B,$$

so B and C are equal.  □

In fact, it can be shown that either of the conditions AB=I or BA=I is enough to determine that B is the inverse of A. However, this requires more algebra than we shall cover in this book.

Sample Problem 8.9

Suppose

$$A = \left[\begin{array}{c@{\quad}c}3 & 2 \\4 & 3\end{array} \right],\qquad B = \left[\begin{array}{c@{\quad}c}2 & 1 \\1 & 1\end{array} \right].$$

What is the inverse of A if it exists?

Solution

Suppose the inverse is

$$C = \left[\begin{array}{c@{\quad}c}x & z \\y & t\end{array} \right] .$$

Then AC=I means

$$\left[\begin{array}{c@{\quad}c}3 & 2 \\4 & 3\end{array} \right] \left[\begin{array}{c@{\quad}c}x & z \\y & t\end{array} \right] = \left[\begin{array}{c@{\quad}c}1 & 0 \\0 & 1\end{array} \right],$$

which is equivalent to the four equations

$$\begin{array}{rcl@{\quad}rcl}3x + 2y & = & 1, & 3z + 2t & = & 0, \\4x + 3y & = & 0, & 4z + 3t & = & 1.\end{array}$$

The left-hand pair of equations is easily solved to give x=3 and y=−4, while the right-hand pair gives z=−2 and t=3. So the inverse exists, and is

$$A^{-1} = C = \left[\begin{array}{c@{\quad}c}3 & -2 \\-4 & 3\end{array} \right].$$

Practice Exercise

What is the inverse of B if it exists?

The above procedure can be used to invert square matrices of any order; if there is no inverse, then the equations will have no solution. In the next section we shall show how to reduce the number of computations required.

The usual notation for the inverse of A, if it exists, is A −1. If we define A 0=I whenever A is square, then the powers of matrices satisfy the usual index laws

$$A^m A^n = A^{m+n},\qquad \bigl(A^m\bigr)^n = A^{mn},$$

for all nonnegative integers m and n, and for negative values also provided that A −1 exists. If x and y are nonzero reals, then (xy)−1=x −1 y −1. The fact that matrices do not necessarily commute means that we have to be a little more careful.

Theorem 54

If A and B are invertible matrices of the same order, then AB is invertible, and

$$(AB)^{-1} =B^{-1}A^{-1}.$$

Proof

We need to show that both (B −1 A −1)(AB) and (AB)(B −1 A −1) equal the identity. But (B −1 A −1)(AB)=B −1(A −1 A)B=B −1 IB=B −1 B=I=AA −1=AIA −1=A(BB −1)A −1=(AB)(B −1 A −1).  □

There are two cancellation laws for matrix multiplication. If A is an invertible r×r matrix and B and C are r×s matrices such that AB=AC, then

so B=C. Similarly, if A is an invertible s×s matrix and B and C are r×s matrices such that BA=CA, then B=C.

The requirement that A be invertible is necessary. We can find matrices A, B, and C such that AB and AC are the same size, A is nonzero, and AB=AC, but B and C are different. One very easy example is

$$\left[\begin{array}{c@{\quad}c}1 & 0 \\0 & 0\end{array} \right]\left[\begin{array}{c@{\quad}c}1 & -1 \\2 & 3\end{array} \right]= \left[\begin{array}{c@{\quad}c}1 & 0 \\0 & 0\end{array} \right]\left[\begin{array}{c@{\quad}c}1 & -1 \\1 & 4\end{array} \right].$$

Some other examples are given in the exercises.

Moreover we can only cancel on one side of an equation; we cannot mix the two sides. Even if A is invertible it is possible that AB=CA but BC (see Exercises 8.2.21 and 8.2.22).

Exercises 8.2

  1. 1.

    Is it correct to say that, for any matrix A, AO=O=OA? Why or why not?

  2. 2.

    Prove the following: if A is an invertible s×s matrix and B and C are r×s matrices such that BA=CA, then B=C.

In Exercises 3 to 8, find the products AB and BA. Do the two matrices commute?

  1. 3.

    \(A = \left[\begin{array}{c@{\quad}c}0 & 1 \\2 & 3\end{array} \right],\ B = \left[\begin{array}{c@{\quad}c}1 & 2 \\-1 & 1\end{array} \right]\).

  2. 4.

    \(A = \left[\begin{array}{c@{\quad}c}1 &-1 \\1 &1\end{array} \right],\ B = \left[\begin{array}{c@{\quad}c}2 & 1 \\-1 & 2\end{array} \right]\).

  3. 5.

    \(A = \left[\begin{array}{c@{\quad}c}2 & 0 \\1 & -1\end{array} \right],\ B = \left[\begin{array}{c@{\quad}c}-2 & 4 \\3 & 2\end{array} \right]\).

  4. 6.

    \(A = \left[\begin{array}{c@{\quad}c}1 & 2 \\3 &4\end{array} \right],\ B = \left[\begin{array}{c@{\quad}c}4 & 3 \\2 & 1\end{array} \right]\).

  5. 7.

    \(A = \left[\begin{array}{c@{\quad}c}3 & 1 \\-1 & 3\end{array} \right],\ B = \left[\begin{array}{c@{\quad}c}1 & 3 \\-3 & 1\end{array} \right]\).

  6. 8.

    \(A = \left[\begin{array}{c@{\quad}c@{\quad}c}3 & 1 &-2 \\1 & 2 &-1 \\-1 & -1 & 3\end{array} \right],\ B = \left[\begin{array}{c@{\quad}c@{\quad}c}2 & 0 & 1 \\-1 & 3 & 0 \\0 & 1 & 2\end{array} \right]\).

In Exercises 9 to 14, A is given. Find A 2 and A 3 .

  1. 9.

    \(\left[\begin{array}{c@{\quad}c}1 & 1 \\-1 & 1\end{array} \right]\).

  2. 10.

    \(\left[\begin{array}{c@{\quad}c}2 & -1 \\-1 & 0\end{array} \right]\).

  3. 11.

    \(\left[\begin{array}{c@{\quad}c}-1 & -1 \\-1 & -1\end{array} \right]\).

  4. 12.

    \(\left[\begin{array}{c@{\quad}c}1 & 3 \\-1 & 1\end{array} \right]\).

  5. 13.

    \(\left[\begin{array}{c@{\quad}c@{\quad}c}2 & 0 &3 \\0 & 3 &-1 \\-1 & -1 & 1\end{array} \right]\).

  6. 14.

    \(\left[\begin{array}{c@{\quad}c@{\quad}c}1 &2 & 1 \\0 & -1 & 1 \\0 & 0 & -2\end{array} \right]\).

  7. 15.

    Consider the matrix

    \(A = \left[\begin{array}{c@{\quad}c}1 & 3 \\5 & 3\end{array} \right]\).

    1. (i)

      Find A 2 and A 3.

    2. (ii)

      Evaluate A 3−2AI.

    3. (iii)

      Show that A 2−4A−12I=O.

In Exercises 16 to 19, show that the matrices are inverses.

  1. 16.

    \(\left[\begin{array}{c@{\quad}c}2 & 5 \\1 & 3\end{array} \right] \mbox{ and }\left[\begin{array}{c@{\quad}c}3 & -5 \\-1 & 2\end{array} \right]\).

  2. 17.

    \(\left[\begin{array}{c@{\quad}c}{\textstyle \frac{3}{2}} & -1 \\0 & 1\end{array} \right] \mbox{ and }\left[\begin{array}{c@{\quad}c}{\textstyle \frac{2}{3}} & {\textstyle \frac{2}{3}} \\0 & 1\end{array} \right]\).

  3. 18.

    \(\left[\begin{array}{c@{\quad}c}\frac{1}{2}& -1 \\1 & -1\end{array} \right] \mbox{ and }\left[\begin{array}{c@{\quad}c}-2 & 2 \\-2 & 1\end{array} \right]\).

  4. 19.

    \(\left[\begin{array}{c@{\quad}c}2 & -3 \\-1 & 2\end{array} \right] \mbox{ and }\left[\begin{array}{c@{\quad}c}2 & 3 \\1 & 2\end{array} \right]\).

  5. 20.

    Find a matrix A such that

    $$A\left[\begin{array}{c@{\quad}c}2 & 1 \\3 & 2\end{array} \right]\ = \left[\begin{array}{c@{\quad}c}1 & -1 \\1 & 4\end{array} \right].$$

In Exercises 21 and 22, show that AB=AC.

  1. 21.

    \(A = \left[\begin{array}{c@{\quad}c}1 & -1 \\2 & -2\end{array} \right],\ B = \left[\begin{array}{c@{\quad}c}2 & 1 \\1 & 4\end{array} \right],\ C = \left[\begin{array}{c@{\quad}c}4 & 0 \\3 & 3\end{array} \right]\).

  2. 22.

    \(A = \left[\begin{array}{c@{\quad}c@{\quad}c}1 & 0 & 1 \\1 & 1 & 1 \\1 & 2 & 1\end{array} \right],\ B = \left[\begin{array}{c@{\quad}c@{\quad}c}1 & 1 & 2 \\1 & 1 & 0 \\1 & 2 & 2\end{array} \right],\ C = \left[\begin{array}{c@{\quad}c@{\quad}c}2 & 2 & 1 \\1 & 1 & 0 \\0 & 1 & 3\end{array} \right]\).

In Exercises 23 and 24, show that A −1 exists, but AB=CA, even though BC.

  1. 23.

    \(A = \left[\begin{array}{c@{\quad}c}-1 & 3 \\1 & -2\end{array} \right],\ B = \left[\begin{array}{c@{\quad}c}1 & 2 \\1 & 1\end{array} \right],\ C = \left[\begin{array}{c@{\quad}c}5 & 7 \\-2 & -3\end{array} \right]\).

  2. 24.

    \(A = \left[\begin{array}{c@{\quad}c}2 & -1 \\1 & 1\end{array} \right],\ B = \left[\begin{array}{c@{\quad}c}3 & 0 \\4 & 1\end{array} \right],\ C = \left[\begin{array}{c@{\quad}c}1 & 0 \\2 & 3\end{array} \right]\).

  3. 25.

    The (leading) diagonal of a matrix is the set of entries in positions (1,1), (2,2),(3,3),…. A diagonal matrix is a square matrix with all of its elements zero except those on the diagonal. Prove that any two diagonal matrices of the same order commute.

  4. 26.

    Suppose M x denotes the 2×2 matrix

    $$\left[\begin{array}{c@{\quad}c}1 & x \\0 & 1\end{array} \right],$$

    where x may be any real number.

    1. 1)

      Compute M x M y , and show that the matrices M x and M y commute for any real numbers x and y.

    2. 2)

      Find M x 2, M x 3, and M x 4.

    3. 3)

      Find a formula for M x n, where n is any positive integer.

    4. 4)

      What is M x −1?

  5. 27.

    A square matrix A is called idempotent if it satisfies A 2=A.

    1. (i)

      Which of the following matrices are idempotent?

      $$\left[\begin{array}{c@{\quad}c@{\quad}c}1 & 0 & 0 \\0 & 1 & 0 \\0 & 0 & 0 \end{array} \right],\ \left[\begin{array}{c@{\quad}c@{\quad}c}1 & -1 & 0 \\0 & 0 & -2 \\-2 & 1 & 1 \end{array} \right],\ \left[\begin{array}{c@{\quad}c@{\quad}c}2 & -2 & -4 \\-1 & 3 & 4 \\1 & -2 & -3 \end{array} \right].$$
    2. (ii)

      Prove that, if A is an idempotent matrix, then IA is idempotent.

8.3 Systems of Linear Equations

8.3.1 Matrix Representation of Equations

The solution set of a system of equations such as

is the set of all assignments of values to the variables that make all the equations true. For example, the above system has solution x=3,y=1,z=2. We often write the solutions as vectors with the variables taken in standard (alphabetical) order, and would say the solution set is {(3,1,2)}. Other systems have infinite solution sets, or the set could be empty, in which case we say the system is inconsistent.

We introduced matrices in Section 8.1 by pointing out their relationship to sets of linear equations. The above system of equations can be written as

$$\left[\begin{array}{c}( 2,4,-4) \cdot (x,y,z) \\(0,-2,4) \cdot (x,y,z) \\(1,-1,4) \cdot (x,y,z) \end{array} \right] = \left[\begin{array}{c}4 \\6 \\10 \end{array} \right],$$

which can be seen as the matrix

$$\left[\begin{array}{c@{\quad}c@{\quad}c}2&4&-4 \\0&-2&4 \\1&-1&4\end{array} \right],$$

acting on the vector (x,y,z) to produce the vector (4,6,10)

$$\left[\begin{array}{c@{\quad}c@{\quad}c}2&4&-4 \\0&-2&4 \\1&-1&4\end{array} \right] \hspace{.1in}\left[\begin{array}{r}x \\y \\z\end{array} \right] = \left[\begin{array}{c}4 \\6 \\10 \end{array} \right].$$

The typical set of m linear equations in n unknowns can be written

$$A \boldsymbol{x}= \boldsymbol{b},$$

where A is an m×n matrix of coefficients, x is an n×1 matrix (column vector) of unknowns, and b is the m×1 matrix (column vector) of the right-hand sides of the equations.

The usual way of solving such a system of equations is to use one equation to express one variable in terms of the other variables and substitute for that variable in other equations. Repeat this process in the new set of m−1 equations. Continue until only one equation remains. This equation is used to evaluate one variable (either as a constant, or in terms of those other variables not yet eliminated), and the remaining variables are evaluated from the equations used earlier. If this process fails (for example, if two contradictory equations result), the equations were inconsistent and there are no solutions.

We shall formalize this process. We define the augmented matrix of the system A x=b to be the matrix [Ab] formed by adjoining the vector of constants b to the matrix A of coefficients. The vertical line indicates the division between the two types of element. The augmented matrix of the system given above is

$$\left[\begin{array}{c@{\quad}c@{\quad}c@{\ }|@{\ }c}2&4&-3&4 \\0&-2&4&6 \\1&-1&4&10 \end{array} \right].$$

The first step is to select a variable to eliminate. This is equivalent to choosing a column in the augmented matrix and selecting a row—an equation—to use for substitution. The only requirement is that the matrix has a nonzero entry in that row and column. Let us choose row 3, column 1, representing variable x in the first equation. It will be convenient to interchange rows 1 and 3, so that we are operating on the (1,1) entry. This is equivalent to rewriting the equations in a different order. The matrix is now

$$\left[\begin{array}{c@{\quad}c@{\quad}c@{\ }|@{\ }c}1&-1&4&10 \\0&-2&4&6 \\2&4&-3&4\end{array} \right]\quad \begin{array}{l}R1 \gets R3 \\\\R3 \gets R1,\end{array}$$

where the annotations mean the new row 1 is the old row 3 and the new row 3 is the old row 1.

Now substitute for x in the other equations. No action is required in the second equation, but x must be eliminated from the third. So we subtract twice the first row from the third row. This yields precisely the equation we would get if we used equation 1 to substitute for x in equation 3, but for consistency we have kept all the variables on the left-hand side of the equation. The augmented matrix becomes

$$\left[\begin{array}{c@{\quad}c@{\quad}c@{\ }|@{\ }c}1&-1&4&10 \\0&-2&4&6 \\0&6&-11&-16\end{array} \right]\quad \begin{array}{l}\\\\R3 \gets R3 - 2R1,\end{array}$$

where the legend means the new row 3 is (the old row 3) −2(the old row 1). (When we say old we are referring to the preceding augmented matrix, not to the original one.)

Now multiply row 2 by \(- \frac{1}{2}\). Then eliminate the 6y from the third equation. The result is

$$\left[\begin{array}{c@{\quad}c@{\quad}c@{\ }|@{\ }c}1&-1&4&10 \\0&1&-2&-3 \\0&0&1&2 \end{array} \right]\quad \begin{array}{l}\\R2 \gets \displaystyle \frac{1}{2}R2 \\\displaystyle R3 \gets R3 - 6\biggl(\frac{1}{2}R2\biggr) .\end{array}$$

This could have been broken into two steps.

So far we have done the equivalent of substituting in the later equations. Now we substitute back to find the values. We know from the third equation that z=3. To substitute this in the earlier equations, we add twice row 3 to row 2 and subtract four times row 3 from row 1:

$$\left[\begin{array}{c@{\quad}c@{\quad}c@{\ }|@{\ }c}1&-1&0& 2 \\0& 1&0& 1 \\0& 0&1& 2 \end{array} \right]\quad \begin{array}{c}R1 \gets R1 - 4 R3 \\R2 \gets R2 + 2 R3. \\\end{array}$$

Next add row 2 to row 1:

$$\left[\begin{array}{c@{\quad}c@{\quad}c@{\ }|@{\ }c}1& 0&0& 3 \\0& 1&0& 1 \\0& 0&1& 2 \end{array} \right]\quad \begin{array}{l}R1 \gets R1 + R2.\\\\\end{array}$$

The resulting array can be translated into the equations

$$x = 3,\qquad y = 1,\qquad z = 2.$$

8.3.2 Elementary Operations

In our example, we used three operations:

  1. E1:

    permute the rows of the matrix;

  2. E2:

    multiply a row by a (nonzero) constant;

  3. E3:

    add a multiple of one row to another row.

We shall call them elementary row operations. Their importance comes from the following theorem.

Theorem 55

Suppose P is the augmented matrix of a system of linear equations and Q is obtained from P by a sequence of elementary row operations. Then the system of equations corresponding to Q has the same solutions as the system corresponding to P.

Proof

Operation E1 does not change the system.

The equations ax=b and k ax=kb have the same solutions when k is nonzero. So E2 does not change the solution set.

Finally, suppose x 0 is a solution of the system of two equations ax=b, a′⋅x=b′. Then ax 0=b and a′⋅x 0=b′, so (a+k a′)⋅x 0=b+kb′, and x 0 is a solution of the system ax=b, a+k a′⋅x=b+kb′; conversely, any solution of the second system is a solution of the first set. If the same further set of equations is appended to each system, the two resulting systems still have the same solutions, so E3 does not change the solution set.  □

8.3.3 The Solution Algorithm

It is clear that the repeated application of the three steps to the augmented matrix will provide a solution. The algorithm for solving systems of linear equations works as follows.

8.3.4 Stage 1

  1. 1.

    Find the leftmost column in the matrix of coefficients that contains a nonzero element, say column j. Use E1 to make the row containing this element into the first row, and E2 to convert its leftmost nonzero element to 1. This is called a leading 1. Then use E3 to change all entries below the leading 1 to zero. That is, if the (i,j) entry is a ij , then subtract a ij ×(row 1) from row j.

    At this stage we say column j is processed. Processed rows are not disturbed in the first stage.

  2. 2.

    Find the leftmost unprocessed column in the augmented matrix that contains a nonzero element, say column k. Use E1 to make this row the first row under the processed row(s), and E2 to convert its leftmost nonzero element to 1, another leading 1. Use E3 to change all entries below the leading 1 to zero (but do not change the processed row or rows). Now column k is also processed.

  3. 3.

    If you have not either reached the last column of coefficients (the vertical line) or the bottom of the matrix, go back to step 2, make another leading 1, and proceed from there.

8.3.5 Stage 2

  1. 4.

    Choose the bottommost leading 1 and eliminate all elements above it in its column by use of E3. Do the same to the next leading 1 up, then the next, until you reach the top.

The process is now finished. We shall illustrate the interpretation of the results with an example.

Sample Problem 8.10

Solve the system

by row operations.

Solution

The augmented matrix is

$$\left[\begin{array}{c@{\quad}c@{\quad}c@{\ }|@{\ }c}2& 2&4& 0 \\3& -1&2& 1 \\8&0 &8& 2 \end{array} \right].$$

At step 1 we choose the element in the (1,1) position and divide row 1 by 2:

$$\left[\begin{array}{c@{\quad}c@{\quad}c@{\ }|@{\ }c}1& 1&2& 0 \\3& -1&2& 1 \\8&0 &8& 2 \end{array} \right]\quad \begin{array}{l}\displaystyle R1 \gets \frac{1}{2}R1\quad \mbox{(using E2).} \\\\\end{array}$$

Then we eliminate the rest of column 1:

$$\left[\begin{array}{c@{\quad}c@{\quad}c@{\ }|@{\ }c}1& 1&2& 0 \\0& -4&-4& 1 \\0&-8&-8& 2 \end{array} \right]\quad \begin{array}{l}\\\displaystyle R2 \gets R2 - 3 \times R1 \quad \mbox{(using E3)} \\\displaystyle R3 \gets R3 - 8 \times R1 \quad \mbox{(using E3)}. \\\end{array}$$

In step 2 we choose the (2,2) position and divide by −4, then eliminate the entries below the (2,2) position, obtaining successively

There are no further numbers available for leading 1’s, so we move to step 4. We use the (2,2) element:

$$\left[\begin{array}{c@{\quad}c@{\quad}c@{\ }|@{\ }c}1& 0&1& {{\frac{1}{4}} }\\0& 1&1& -{{\frac{1}{4}} }\\0&0&0& 0 \end{array} \right]\quad \begin{array}{l}R1 \gets R1 - R2 \quad \mbox{(using E3)}. \\\\\ \end{array}$$

The process is finished. There is no restriction on z. The final augmented matrix converts to the system

(the third equation can be ignored) and the final solution can be expressed as

$$x = {{\frac{1}{4}} }- z, \qquad y = -{{\frac{1}{4}} }- z, \quad \mbox{any real number } z.$$

It is important to notice that the sequence of calculations is completely determined by the matrix of coefficients, the left-hand part of the augmented matrix.

If the column corresponding to a variable receives a leading 1, we shall call that variable dependent; the others are independent. One standard way of recording the answer is to give an equation for each dependent variable, with a constant and the independent variables on the right; the independent variables take any real number value. Another way to express the above solution would be to use set notation

$$\biggl\{\biggl({{\frac{1}{4}} }- z, -{{\frac{1}{4}} }- z,z\biggr) \Bigm{|} z \in \mathbb{R}\biggr\},$$

or perhaps

$$\biggl\{\biggl(t + {{\frac{1}{4}} }, t, -{{\frac{1}{4}} }, - t\biggr) \Bigm{|} t \in \mathbb{R}\biggr\}.$$

In this case t is a parameter.

Sometimes there will be no solution to a system of equations. As we said above, the equations are then inconsistent.

Sample Problem 8.11

Solve the system

Solution

The augmented matrix is

$$\left[\begin{array}{c@{\quad}c@{\quad}c@{\ }|@{\ }c}2& 2&4& 0 \\[-1pt]3& -1&2& 1 \\[-1pt]8&0&8& 3 \end{array} \right].$$

The left-hand part of this equation is the same as in Sample Problem 8.10, so we go through the same steps, making the appropriate changes to the right-hand column. At the end of Stage 1, we have

$$\left[\begin{array}{c@{\quad}c@{\quad}c@{\ }|@{\ }c}1& 1&2& 0 \\[-1pt]0& 1&1& -{{\frac{1}{4}} }\\[-1pt]0&0&0& 1 \end{array} \right].$$

When we convert back to equations, the third row gives the equation

$$0 = 1,$$

which is impossible. No values of x, y, and z make this true, so the equations are inconsistent. There is no need to implement Stage 2.

In set-theoretic terms, we can report that the solution set is ∅.

Exercises 8.3

In Exercises 1 to 14, the augmented matrix of a system of equations is shown. Assuming the variables are x,y,z, what is the solution of the system?

  1. 1.

    \(\left[\begin{array}{c@{\quad}c@{\quad}c@{\ }|@{\ }c}1& 0&0& 3 \\0& 1&0& 1 \\0&0&0& 0 \end{array} \right]\).

  2. 2.

    \(\left[\begin{array}{c@{\quad}c@{\quad}c@{\ }|@{\ }c}1& 0&0& -1 \\0& 1&0& -1 \\0&0&1& -1 \end{array} \right]\).

  3. 3.

    \(\left[\begin{array}{c@{\quad}c@{\quad}c@{\ }|@{\ }c}1& 0&1& 2 \\0& 1&-1& 1 \\0&0&0& 0 \end{array} \right]\).

  4. 4.

    \(\left[\begin{array}{c@{\quad}c@{\quad}c@{\ }|@{\ }c}1& 1&0& 2 \\0& 0&1&-1 \\0& 0&0& 0 \\0&0&0& 0\end{array} \right]\).

  5. 5.

    \(\left[\begin{array}{c@{\quad}c@{\quad}c@{\ }|@{\ }c}1& 0&1& 2 \\0& 1&2& 1 \\0&0&0& 2 \end{array} \right]\).

  6. 6.

    \(\left[\begin{array}{c@{\quad}c@{\quad}c@{\ }|@{\ }c}1& 0&0& 3 \\0& 1&0& 1 \\0&0&1& 2 \end{array} \right]\).

  7. 7.

    \(\left[\begin{array}{c@{\quad}c@{\quad}c@{\ }|@{\ }c}1& 0&1& 2 \\0& 1&1& 1 \\0&0&0& 1\end{array} \right]\).

  8. 8.

    \(\left[\begin{array}{c@{\quad}c@{\quad}c@{\ }|@{\ }c}1& 0&0& 2 \\0& 1&0& 1 \\0& 0&1& 1 \\0&0&0& 1\end{array} \right]\).

  9. 9.

    \(\left[\begin{array}{c@{\quad}c@{\quad}c@{\ }|@{\ }c}1& 1&1& 4 \\-1&2&1& -1 \\3&2&4& 6 \end{array} \right]\).

  10. 10.

    \(\left[\begin{array}{c@{\quad}c@{\quad}c@{\ }|@{\ }c}4& 2&-3& 1 \\3& -1&-1& 1 \\1&-7&3& 1 \end{array} \right]\).

  11. 11.

    \(\left[\begin{array}{c@{\quad}c@{\quad}c@{\ }|@{\ }c}4& 3& 1&11 \\2&-2& 4& 2 \\1& 3&-2& 5 \end{array} \right]\).

  12. 12.

    \(\left[\begin{array}{c@{\quad}c@{\quad}c@{\ }|@{\ }c}0& 1&-1& -1 \\1& 0&1& 1 \\1&2&-1 & 0 \end{array} \right]\).

  13. 13.

    \(\left[\begin{array}{c@{\quad}c@{\quad}c@{\ }|@{\ }c}2& -1& 1& -2 \\3& 2&3& 8 \\1&-1&-1& 0 \end{array} \right]\).

  14. 14.

    \(\left[\begin{array}{c@{\quad}c@{\quad}c@{\ }|@{\ }c}2& 3&1& -1 \\1& 2&1& 0 \\3&2&-1& -4\end{array} \right]\).

In Exercises 15 to 36, solve the system of equations.

  1. 15.

    \(\begin{array}[t]{rcl} 2x + 6y & = & 6, \\4x + 11y & = &10. \end{array}\)

  2. 16.

    \(\begin{array}[t]{rcl} 3x - 2y & = & 4, \\-6x + 4y & = & 2. \end{array}\)

  3. 17.

    \(\begin{array}[t]{rcl} 2x + 3y & = & 5, \\4x + 6y & = &10. \end{array}\)

  4. 18.

    \(\begin{array}[t]{rcl} x - y & = & 3, \\2x + y & = & 3. \end{array}\)

  5. 19.

    \(\begin{array}[t]{rcl} 3x - y & = & 4, \\6x - 2y & = & 2. \end{array}\)

  6. 20.

    \(\begin{array}[t]{rcl} 3x - 2y & = &-1, \\-6x + 4y & = & 2 . \end{array}\)

  7. 21.

    \(\begin{array}[t]{rcl} x - 2y & = & 4, \\-3x - 4y & = &-2, \\2x + 3y & = & 1. \end{array}\)

  8. 22.

    \(\begin{array}[t]{rcl} 3x + 2y & = & 4, \\2x + 3y & = & 1, \\5x - 4y & = & 14. \end{array}\)

  9. 23.

    \(\begin{array}[t]{rcl} x + 2y + z & = & 3, \\x + y - 2z & = & 2. \end{array}\)

  10. 24.

    \(\begin{array}[t]{rcl} x + y + 3z & = & 2, \\4x + 2y + 2z & = &10. \end{array}\)

  11. 25.

    \(\begin{array}[t]{rcl} x + y + z & = & 3, \\x + 2y + 2z & = & 3, \\x + y + 2z & = & 1. \end{array}\)

  12. 26.

    \(\begin{array}[t]{rcl} 2x + 4z & = & 6, \\2x + y + 5z & = & 7, \\x - y + z & = & 2. \end{array}\)

  13. 27.

    \(\begin{array}[t]{rcl} 2x + 2z & = & 2, \\x + 2y + 6z & = & 3, \\2x - 2y & = & 1. \end{array}\)

  14. 28.

    \(\begin{array}[t]{rcl} x + z & = & 4, \\x + 4y + z & = & 7, \\x - 2y + z & = & 3. \end{array}\)

  15. 29.

    \(\begin{array}[t]{rcl} x + 2y + z & = & -1, \\2x + 3y - 2z & = & 7, \\-2x + 2y - 3z & = & -2. \end{array}\)

  16. 30.

    \(\begin{array}[t]{rcl} x + y - z & = & 4, \\3x + 4y - 7z & = & 8, \\- y + 4z & = & 4. \end{array}\)

  17. 31.

    \(\begin{array}[t]{rcl} x + y & = & 2, \\x - y + 5z & = & 3, \\-3x - 3y + 2z & = & -6. \end{array}\)

  18. 32.

    \(\begin{array}[t]{rcl} x + 2y + 3z & = & 4 ,\\4x + 5y + 6z & = & 16, \\7x + 8y + 9z & = & 28. \end{array}\)

  19. 33.

    \(\begin{array}[t]{rcl} 3x - 2y - 8z + 7t & = & 1, \\x + y - z - t & = & 3, \\x - y - 3z + 3t & = & -1. \end{array}\)

  20. 34.

    \(\begin{array}[t]{rcl} 2x - y + z - 3t & = & 2, \\-4x - 3y + t & = & 1, \\2x - 6y + 3z - 8t & = & 4. \end{array}\)

  21. 35.

    \(\begin{array}[t]{rcl} x + 2y + 3z + 4t & = & 8, \\x - 3y + 4z + 4t & = & 8, \\2x - 2y - z + t & = & -3, \\x - 7y - 7z - 3t & = & -11. \end{array}\)

  22. 36.

    \(\begin{array}[t]{rcl} 2x + 2y - 2z + 3t & = & 2, \\4x - 2y - z + t & = & -4, \\6x - 3z + 4 t & = & -2, \\2x + 8y - 5z + 8t & = & 10. \end{array}\)

8.4 More About Linear Systems and Inverses

8.4.1 Classification of Systems of Equations

We say that a matrix is in reduced row echelon form if it has the following properties:

  • All rows with every element zero lie at the bottom of the matrix;

  • The leftmost nonzero element of each row is a 1 (called a leading 1);

  • Every other entry in the same column as a leading 1 is zero;

  • Each leading 1 is to the right of the leading 1 in the preceding row.

So the process of solving a system of equations consists of converting its augmented matrix to reduced row echelon form. For this reason we often speak of reducing the matrix (or reducing the system).

The system is inconsistent when the reduction process results in a leading 1 in the right-hand column of the augmented matrix. In this case there is no need to complete the algorithm.

Suppose the system is consistent. There are two possibilities.

Sometimes the reduced matrix will have a leading 1 in each column so that it is an identity matrix, possibly with some zero rows appended. In this case there will be exactly one solution.

Alternatively, there will be some columns that contain no leading 1. The corresponding variables are independent, and can take any real value, so the system has infinitely many solutions.

To illustrate these possibilities, consider the following three sets of equations:

$$\begin{array}{rcl@{\qquad}rcl@{\qquad}rcl}x + y & = & 2, & x + y & = & 2, & x + y & = & 2, \\3x + 3y & = & 5, & 2x + 3y & = & 5, &2x + 2y & = & 4.\end{array}$$

The matrix forms are as follows:

$$\left[ \begin{array}{c@{\quad}c@{\ }|@{\ }c}1 & 1 & 2 \\3 & 3 & 5\end{array} \right],\qquad \left[ \begin{array}{c@{\quad}c@{\ }|@{\ }c}1 & 1 & 2 \\2 & 3 & 5\end{array} \right],\qquad \left[ \begin{array}{c@{\quad}c@{\ }|@{\ }c}1 & 1 & 2 \\2 & 2 & 4\end{array} \right].$$

In each case subtract twice row 1 from row 2, obtaining

$$\left[ \begin{array}{c@{\quad}c@{\ }|@{\ }c}1 & 1 & 2 \\0 & 0 & 1\end{array} \right],\qquad \left[ \begin{array}{c@{\quad}c@{\ }|@{\ }c}1 & 1 & 2 \\0 & 1 & 1\end{array} \right],\qquad \left[ \begin{array}{c@{\quad}c@{\ }|@{\ }c}1 & 1 & 2 \\0 & 0 & 0\end{array} \right].$$

The first system is inconsistent and there are no solutions. The second system can be reduced further; subtracting row 2 from row 1, we get

$$\left[ \begin{array}{c@{\quad}c@{\ }|@{\ }c}1 & 0 & 1 \\0 & 1 & 1\end{array} \right],$$

and the solution is x=1,y=1. In the third system, y can take any value, and correspondingly x=2−y.

So we have a classification of systems of equations into three classes. A system can have no solutions, exactly one solution, or infinitely many solutions. Alternatively, we can say that the solution set is empty, a singleton set, or infinite. There can be no system whose solution set is finite but has more than one member.

8.4.2 Calculating the Inverse

The inverse of a square matrix can be calculated by the algorithm used for solving equations. Suppose A is an n×n matrix with inverse B. Write b 1,b 2,…,b n for the columns of B, and write u 1,u 2,…,u n for the columns of the identity matrix of order n. Consider the equation AB=I. Column j of the left-hand side is A b j . So the equation is equivalent to the set of n systems

$$A\boldsymbol{b}_1 = \boldsymbol{u}_1, \qquad A\boldsymbol{b}_2 = \boldsymbol{u}_2,\qquad \ldots ,\qquad A\boldsymbol{b}_n = \boldsymbol{u}_n.$$

If all these systems have solutions, then the inverse is formed by putting the solution vectors next to each other in order. If any system has no solution, there is no inverse.

To solve A b j =u j , we reduce the augmented matrix [Au j ] to reduced row echelon form. The same steps will produce this result, no matter what vector is on the right-hand side. It follows that we can carry out the reduction simultaneously for all n systems of equations. So we have the following technique for inverting an n×n matrix A.

Row reduce the matrix [AI n ]. If the resulting matrix has form [I n B] then A is invertible, and B is A −1 . Otherwise, A is singular.

It follows from this that if a matrix has a row with every entry zero, it must be singular. This is also true if the matrix has a column with every entry zero. For example, if A has every entry of its first column zero, then BA has every element zero in its first column for any choice of B, so the equation A −1 A=I cannot possibly be true—it must fail in the (1,1) position.

Sample Problem 8.12

For the following matrices, find the inverse or show that the matrix is singular:

$$A = \left[\begin{array}{c@{\quad}c@{\quad}c}1& 2& -1 \\0& -2& 1 \\1& 1& -1 \end{array} \right],\qquad B = \left[\begin{array}{c@{\quad}c@{\quad}c}2& 3& 2 \\3& -1& 2 \\1& 7& 2 \end{array} \right].$$

Solution

For A, we have

So A has inverse

$$\left[\begin{array}{c@{\quad}c@{\quad}c}1 & 1 & 0 \\1 & 0 & -1 \\2 & 1 & -2 \end{array} \right].$$

For B, we get

and the zero row on the left tells us that B is singular.

Practice Exercise

In the above calculations, identify the steps that have been taken at each stage. (For example, for A, the first step was R3←R3−R1.)

This method can be used to get a general solution for the inverse of a 2×2 matrix.

Theorem 56

The matrix

$$A = \left[\begin{array}{c@{\quad}c}a & b \\c & d \end{array} \right],$$

is singular if adbc=0. Otherwise it is invertible, with inverse

$$\frac{1}{(ad-bc)}\left[\begin{array}{c@{\quad}c} d & -b \\-c & a \end{array} \right]. $$
(8.1)

Proof

If a=c=0, then adbc=0, and A has no inverse.

First, suppose a and c are both nonzero. The inverse procedure is

If adbc=0, then we are finished and there is no inverse. Otherwise, notice that

$${ 1+\frac{bc}{ad-bc} =\frac{ad-bc+bc}{ad-bc} =\frac{ad}{ad-bc}},$$

so we have

as required.

If a≠0 and c=0 the calculations are simpler. We obtain the inverse

$$\left[\begin{array}{c@{\quad}c}\frac{1}{a}&-\frac{b}{ad} \\[5pt]0 &\frac{1}{d} \end{array} \right],$$

and this is the form taken by (8.1) when c=0.

The case where a=0, c≠0 is left as an exercise.  □

The number adbc is called the determinant of the matrix A, written det(A). Determinants may be defined for square matrices of any order, and it is a general theorem that a matrix is invertible if and only if its determinant is nonzero. For more details, see books on linear algebra.

Sample Problem 8.13

Find the determinants of the following matrices and use them to find their inverses, if possible:

$$A = \left[\begin{array}{c@{\quad}c}3& 1 \\2& 2 \end{array} \right],\qquad B = \left[\begin{array}{c@{\quad}c}2& -2 \\-1& 1 \end{array} \right].$$

Solution

det(A)=3⋅2−1⋅2=4, so

$$A^{-1} = \frac{1}{4} \left[\begin{array}{c@{\quad}c}2& -1 \\-2& 3 \end{array} \right]= \left[\begin{array}{c@{\quad}c}\frac{1}{2}& -\frac{1}{4} \\-\frac{1}{2}& \frac{3}{4} \end{array} \right].$$

det(B)=2⋅1−(−2)⋅(−1)=0, so B has no inverse.

Practice Exercise

Repeat for

$$C = \left[\begin{array}{c@{\quad}c}1& 1 \\3& 4 \end{array} \right],\qquad D = \left[\begin{array}{c@{\quad}c}2& 4 \\1& 2 \end{array} \right].$$

8.4.3 Using the Inverse

Consider the system of equations A x=b, where A is an invertible matrix. Multiplying by A −1, x=A −1 A x=A −1 b, so the equations have the unique solution A −1 b. This can be used to solve the equations. This technique is not usually helpful in practical situations because the process of finding the inverse takes at least as long as solving the equations, but it is useful when there are several sets of equations with the same left-hand sides, or when the inverse is already known. It is also important in theoretical studies.

Sample Problem 8.14

Solve the following systems:

$$\begin{array}{rcl@{\qquad}rcl}x + 2y - z & = & 3, & x + 2y - z & = & -1, \\- 2y + z & = & 1, & - 2y + z & = & -2, \\x + y - z & = & 0, & x + y - z & = & 2.\end{array}$$

Solution

We saw in Sample Problem 8.12 that the matrix of coefficients has inverse

$$\left[\begin{array}{c@{\quad}c@{\quad}c}1 & 1 & 0 \\1 & 0 & -1 \\2 & 1 & -2 \end{array}\right].$$

Now

$$\left[\begin{array}{c@{\quad}c@{\quad}c}1 & 1 & 0 \\1 & 0 & -1 \\2 & 1 & -2 \end{array} \right] \left[\begin{array}{r}3 \\1 \\0 \end{array}\right]= \left[\begin{array}{r}4 \\3 \\7 \end{array}\right], $$

so the first system has solution x=4, y=3, z=7.

$$\left[\begin{array}{c@{\quad}c@{\quad}c}1 & 1 & 0 \\1 & 0 & -1 \\2 & 1 & -2 \end{array} \right] \left[\begin{array}{r}-1 \\-2 \\2 \end{array}\right]= \left[\begin{array}{c}-3 \\-3 \\-8 \end{array}\right],$$

and the second has solution x=−3,y=−3,z=−8.

Practice Exercise

Solve the following systems:

$$\begin{array}{rcl@{\qquad}rcl}x + 2y - z & = & 2, & x + 2y - z & = & 4, \\- 2y + z & = & 2, & - 2y + z & = & -1, \\x + y - z & = & 1, & x + y - z & = & 3.\end{array}$$

Exercises 8.4

In Exercises 1 to 6, the reduced row echelon form of an augmented system is shown. Say whether its solution set is empty, singleton, or infinite.

  1. 1.

    \(\left[\begin{array}{c@{\quad}c@{\quad}c@{\ }|@{\ }c}1 & 0 & 3 & 1 \\0 & 1 & 1 & 1 \\0 & 0 & 0 & 1 \end{array}\right]\).

  2. 2.

    \(\left[\begin{array}{c@{\quad}c@{\quad}c@{\ }|@{\ }c}1 & 0 & 0 & 2 \\0 & 1 & 0 & 1 \\0 & 0 & 1 & -1 \end{array}\right]\).

  3. 3.

    \(\left[\begin{array}{c@{\quad}c@{\quad}c@{\ }|@{\ }c}1 & 0 & 0 & 1 \\0 & 1 & 0 & 2 \\0 & 0 & 0 & 0 \end{array}\right]\).

  4. 4.

    \(\left[\begin{array}{c@{\quad}c@{\quad}c@{\ }|@{\ }c}1 & 1 & 3 & 1 \\0 & 0 & 0 & 2 \\0 & 0 & 0 & 0 \end{array}\right]\).

  5. 5.

    \(\left[\begin{array}{c@{\quad}c@{\quad}c@{\ }|@{\ }c}1 & 0 & 0 & 0 \\0 & 1 & 0 & 0 \\0 & 0 & 1 & 0 \end{array}\right]\).

  6. 6.

    \(\left[\begin{array}{c@{\quad}c@{\quad}c@{\ }|@{\ }c}1 & 0 & 2 & 3 \\0 & 1 & 1 & 3 \\0 & 0 & 0 & 0 \end{array}\right]\).

In Exercises 7 to 24, use row reduction either to find the inverse of the given matrix or to show that the matrix is singular.

  1. 7.

    \(\left[\begin{array}{c@{\quad}c}2 &-2 \\4 & 0 \end{array}\right]\).

  2. 8.

    \(\left[\begin{array}{c@{\quad}c}2 &-2 \\3 & -3 \end{array}\right]\).

  3. 9.

    \(\left[\begin{array}{c@{\quad}c}3 &7 \\2 & 5 \end{array}\right]\).

  4. 10.

    \(\left[\begin{array}{c@{\quad}c}1 &1 \\1 & 0.5 \end{array}\right]\).

  5. 11.

    \(\left[\begin{array}{c@{\quad}c}4 &2 \\2 & 1 \end{array}\right]\).

  6. 12.

    \(\left[\begin{array}{c@{\quad}c}3 &1 \\-4 & -2 \end{array}\right]\).

  7. 13.

    \(\left[\begin{array}{c@{\quad}c@{\quad}c}0 & 0 & 1 \\0 & 1 & 0 \\1 & 0 & 1 \end{array}\right]\).

  8. 14.

    \(\left[\begin{array}{c@{\quad}c@{\quad}c}0 & 1 & 0 \\0 & 0 & 1 \\1 & 0 & 0 \end{array}\right]\).

  9. 15.

    \(\left[\begin{array}{c@{\quad}c@{\quad}c}2 & 3 & 2 \\1 & 2 & 2 \\3 & 1 & 3 \end{array}\right]\).

  10. 16.

    \(\left[\begin{array}{c@{\quad}c@{\quad}c}9 & 8 & 7 \\6 & 5 & 4 \\3 & 2 & 1 \end{array}\right]\).

  11. 17.

    \(\left[\begin{array}{c@{\quad}c@{\quad}c}0 & 1 & 1 \\5 & 1 & -2 \\2 & -3 & -3 \end{array}\right]\).

  12. 18.

    \(\left[\begin{array}{c@{\quad}c@{\quad}c}1 & -2 & 3 \\3 & 5 & 1 \\6 & 4 & 2 \end{array}\right]\).

  13. 19.

    \(\left[\begin{array}{c@{\quad}c@{\quad}c}1 & 3 & 3 \\1 & 4 & 3 \\1 & 3 & 4 \end{array}\right]\).

  14. 20.

    \(\left[\begin{array}{c@{\quad}c@{\quad}c}2 & 3 & -1 \\4 & 2 & 3 \\2 & 7 &-6 \end{array}\right]\).

  15. 21.

    \(\left[\begin{array}{c@{\quad}c@{\quad}c}1 & 1& -1 \\-2 & -1 & 7 \\3 & 2 &-8 \end{array}\right]\).

  16. 22.

    \(\left[\begin{array}{c@{\quad}c@{\quad}c}1 & 0 & 2 \\2 & -1 & 3 \\4 & 1 & 8 \end{array}\right]\).

  17. 23.

    \(\left[\begin{array}{c@{\quad}c@{\quad}c}1 & 2 & 3 \\2 & 5 & 1 \\3 & 7 & 4 \end{array}\right]\).

  18. 24.

    \(\left[\begin{array}{c@{\quad}c@{\quad}c}1 & 2 & 3 \\2 & 5 & 5 \\3 & 8 & 8 \end{array}\right]\).

In Exercises 25 to 30, find the determinant, and use it to invert the matrix or show that it is singular.

  1. 25.

    \(\left[\begin{array}{c@{\quad}c}7 & 4 \\2 & 3 \end{array}\right]\).

  2. 26.

    \(\left[\begin{array}{c@{\quad}c}6 & 4 \\3 & 2 \end{array}\right]\).

  3. 27.

    \(\left[\begin{array}{c@{\quad}c}-2 & 2 \\2 & 3 \end{array}\right]\).

  4. 28.

    \(\left[\begin{array}{c@{\quad}c}3 & 5 \\1 & 4 \end{array}\right]\).

  5. 29.

    \(\left[\begin{array}{c@{\quad}c}4 & 2 \\8 & 4 \end{array}\right]\).

  6. 30.

    \(\left[\begin{array}{c@{\quad}c}6 & 4 \\7 & 5 \end{array}\right]\).

  7. 31.
    1. (i)

      Prove that the following matrices are inverses:

      $$\left[\begin{array}{c@{\quad}c}3& 2 \\1& 1 \end{array} \right],\ \left[\begin{array}{c@{\quad}c}1& -2 \\-1& 3 \end{array} \right].$$
    2. (ii)

      Use part (i) to solve the following systems:

      $$\begin{array}{lrcl@{\qquad}lrcl}\mbox{(a)} & 3x + 2y & = & 4, & \mbox{(b)} & x - 2y & = & -1, \\& x + y & = & 1; & & -x + 3y & = & 2.\end{array}$$
  8. 32.
    1. (i)

      Prove that the following matrices are inverses:

      $$\left[\begin{array}{c@{\quad}c@{\quad}c}2& -2& 1 \\1& 0& 1 \\1& -3& 0 \end{array} \right],\ \left[\begin{array}{c@{\quad}c@{\quad}c}3& -3& -2 \\1& -1& -1 \\-3& 4& 2 \end{array} \right].$$
    2. (ii)

      Use part (i) to solve the following systems:

      $$\begin{array}{lrcl@{\qquad}lrcl}\mbox{(a)} & 2x - 2y + z & = & 3, & \mbox{(b)} & 3x - 3y - 2z & = & 2, \\& x + z & = & 2, & & x - y - z & = &-1, \\& x - 3y & = & 1; & &-3x + 4y + 2z & = & 2.\end{array}$$
  9. 33.

    Suppose a system of equations has 0 for every right-hand side. Can it be inconsistent?

  10. 34.

    Prove Theorem 56 in the case where a=0 (and c≠0).

8.5 Adjacency Matrices

8.5.1 Representing a Relation by a Matrix

Suppose A={a 1,…,a m } and B={b 1,…,b n } are two finite sets, and let α be a relation from A to B. We define the adjacency matrix of α to be the m×n matrix M α with (i,j) entry

$$\alpha_{ij}= \left\{ \begin{array}{l@{\quad}l}1 &\mbox{if } a_i \,{\alpha}\, b_j , \\0 &\mbox{otherwise.}\end{array} \right.$$

Obviously this definition depends on the order in which we take the elements of the two sets. If you change the order of the elements of A, this will reorder the rows of M α , while changing the order of the elements of B will reorder the columns of the matrix.

Sample Problem 8.15

Suppose A={1,2}, B={1,2,3} and α is the relation from A to B defined by

$$\alpha = \bigl\{(1,1),(1,3),(2,2),(2,3)\bigr\}.$$

What is the adjacency matrix of α?

Solution

$$M_\alpha = \left[ \begin{array}{c@{\quad}c@{\quad}c}1& 0 &1 \\0 &1 &1\end{array} \right] .$$

Practice Exercise

For the same sets A and B, what is the adjacency matrix of the relation

$$\pi =\bigl\{(1,2), (1,3), (2,1), (2,2)\bigr\}?$$

8.5.2 Conjunction of Adjacency Matrices

Again suppose A={a 1,…,a m } and B={b 1,…,b n }, and consider also a third set C={c 1,c 2,…,c p }. Suppose α is a relation from A to B and β is a relation from B to C. Then M β is an n×p matrix with (i,j) entry

$$\beta_{ij}= \left\{ \begin{array}{l@{\quad}l}1 & \mbox{if } b_i \beta c_j , \\0 & \mbox{otherwise.}\end{array} \right.$$

We define the conjunction of M α and M β , written M α M β , to be the m×p array with (i,j) entry

$$\gamma_{ij}= \left\{ \begin{array}{l@{\quad}l}1 &\mbox{if } \sum_{i=1}^n \alpha_{ik}\beta_{kj} \ge 1, \\0 &\mbox{otherwise.}\end{array} \right. $$
(8.2)

(If M α is m×n and M β is n′×p, where nn′, then M α M β is not defined.)

Sample Problem 8.16

Let A, B, and α be as in Sample Problem 8.15. Further define C={1,2,3,4} and

$$\beta = \bigl\{(1,2),(1,3),(2,1),(2,4),(3,3)\bigr\}.$$

Find M α M β .

Solution

The matrix of β is

$$M_\beta = \left[ \begin{array}{c@{\quad}c@{\quad}c@{\quad}c}0&1&1&0 \\1&0&0&1 \\0&0&1&0\end{array} \right] .$$

To find M α M β it suffices to find the ordinary matrix product M α M β and replace any non-zero element by 1

$$M_\alpha M_\beta = \left[ \begin{array}{c@{\quad}c@{\quad}c@{\quad}c}0&1&2&0 \\1&0&1&1\end{array} \right]\quad \mbox{and}\quad M_\alpha \vee M_\beta = \left[ \begin{array}{c@{\quad}c@{\quad}c@{\quad}c}0&1&1&0 \\1&0&1&1\end{array} \right] . $$

Practice Exercise

If A, B, C, and α are as stated and

$$\tau = \bigl\{(1,1),(1,3),(2,2),(3,1),(3,4)\bigr\},$$

find M α M τ .

Notice that αβ={(1,2),(1,3),(2,1),(2,3),(2,4)} and M α M β =M αβ . We prove that this happens in general.

Theorem 57

Let A,B,C,α, and β be as before. Then

  1. (i)

    M αβ =M α M β ,

  2. (ii)

    \(M_{\alpha^{-1}} = M^{T}_{\alpha}\), the transpose of M α ,

  3. (iii)

    \(M^{T}_{\alpha \beta} = M^{T}_{\beta}\vee M^{T}_{\alpha}\).

Proof

(i) Let μ=αβ, so that M μ =M αβ is the m×p array (σ ij ), where

$$\sigma_{ij}= \left\{ \begin{array}{l@{\quad}l}1 &\mbox{if } a_i \mu c_j , \\0 &\mbox{otherwise.}\end{array} \right.$$

We see that the conjunction M α M β is also an m×p array. Suppose its (i,j) entry is defined by γ, as in (8.2). Now γ i,j =1 if and only if

$$\sum_{i=1}^n \alpha_{ik}\beta_{kj} \ge 1,$$

that is, if and only if α ik β kj =1 for at least one value of k. This is true if and only if α ik =1=β kj for at least one k, or equivalently if and only if a i αb k and b k βc j for at least one k. But this is just the statement that a i αβc j , so σ i,j =1.

Conversely, σ i,j =1 if and only if a i αβc j , which is equivalent to the existence of at least one b k such that a i αb k and b k βc j . But now α ik =1=β kj , so γ i,j =1.

Hence M α M β =M αβ .

(ii) Let M T=(ϵ ij ) n×m , where ϵ ij =α ji . Then M α is the correct size array for α −1:BA, as \(M_{\alpha^{-1}}\) is n×m. Suppose the (i,j) element of \(M_{\alpha^{-1}}\) is δ ij ; then δ ij =1 if and only if b i α −1 a j , or equivalently a j αb i , so δ ij =1 if and only if ϵ ij =1, which implies \(M^{T} = M_{\alpha^{-1}}\).

(iii) \(\begin{array}[t]{rcl}M^{T}_{\alpha \beta} & = & \mbox{ by (ii)} \\& = & M_{\beta^{-1} \alpha^{-1}} \quad \mbox{by Theorem 22} \\& = & M_{\beta^{-1}} \vee M_{\alpha^{-1}} \quad \mbox{by (i)} \\& = & M^{T}_{\beta}\vee M^{T}_{\alpha}\quad \mbox{by (ii)}.\end{array}\)

 □

We observe some of the properties of these matrices. If α is a relation on a set A with m elements, then M α is m×m. If α is reflexive, then M α has 1’s down its diagonal; if α is symmetric, then M α is symmetric in the usual matrix sense (a ij =a ji ); if α is transitive and M αα =M α M α has 1 in the (i,j) position, then so does M α .

8.5.3 Adjacency Matrices of Graphs

If the relation α is represented both by the adjacency matrix M α and by a graph G, then M α is also called the adjacency matrix of the graph G. This is such a fundamental idea that we define it separately.

Suppose G is a graph with v vertices {x 1,x 2,…,x v }. Then the adjacency matrix M G of G is the v×v matrix M G with (i,j) entry

$$m_{ij} = \left \{\begin{array}{l@{\quad}l}1 & \mbox{if } x_i \sim x_j, \\0 & \mbox{otherwise. }\end{array} \right.$$

The adjacency matrix depends on the order in which the vertices are taken. However, changing the order of the vertices results in a matrix that can be derived from the original by carrying out a reordering of the rows, and then carrying out an identical reordering of the columns. Many properties of matrices are left unchanged by operations like this.

The adjacency matrix of a graph is necessarily symmetric.

If G has e edges {y 1,y 2,…,y e }, then the incidence matrix N G of G is the v×e matrix with (i,j) entry

$$n_{ij} = \left \{\begin{array}{l@{\quad}l}1 & \mbox{if vertex } x_i \mbox{ is incident with edge } a_j ,\\0 & \mbox{otherwise.}\end{array}\right.$$

Sample Problem 8.17

What are the adjacency and incidence matrices of K 2,3?

Solution

We take the vertices of K 2,3 to be the sets {1,2} and {3,4,5}. Taking the vertices in numerical order, the adjacency matrix is

$$\left[ \begin{array}{c@{\quad}c@{\quad}c@{\quad}c@{\quad}c}0&0&1&1&1 \\0&0&1&1&1 \\1&1&0&0&0 \\1&1&0&0&0 \\1&1&0&0&0 \end{array} \right] .$$

If we take the edges in order (1,3), (1,4), (1,5), (2,3), (2,4), (2,5), the incidence matrix is

$$\left[ \begin{array}{c@{\quad}c@{\quad}c@{\quad}c@{\quad}c@{\quad}c}1&1&1&0&0&0 \\0&0&0&1&1&1 \\1&0&0&1&0&0 \\0&1&0&0&1&0 \\0&0&1&0&0&1 \end{array} \right] .$$

Practice Exercise

What are the adjacency and incidence matrices of K 4?

The powers of the adjacency matrix of a graph G give information about G. Suppose M G =(m ij ). Write x 1,x 2,… for the vertices of G, and assume ij. If m ik =m kj =1, this means there are edges x i x k and x k x j , so there is a path from x i to x j passing through x k . The number of two-edge paths from x i to x j equals the number of vertices x k for which this is true. The adjacency matrix has entries 0 and 1, so we have actually observed that m ik m kj =1 when there is an x i x k x j path and 0 otherwise. So ∑m ik m kj equals the number of different two-edge paths from x i to x j . The ith diagonal entry is \(\sum m_{ik}m_{ki} = \sum m_{ik}^{2}\). As m ik =1 or 0, \(m_{ik}^{2} = m_{ik}\), so ∑m ik m ki equals the number of times m ik =1, the degree of x i .

Theorem 58

\(M_{G}^{2}\) has the degrees of the vertices on the diagonal, and the number of paths of length 2 joining the relevant vertices in its other positions.

For n larger than 2, the off-diagonal entries of \(M_{G}^{n}\) give the number of walks between the relevant vertices (not necessarily paths; for larger n, repeated vertices can occur). The situation with the diagonal entries is more complicated (see, for example, Exercise 8.5.23).

Exercises 8.5

In Exercises 1 to 7, write down the adjacency matrix of the relations. These relations were all defined in exercises in Section 4.1.

  1. 1.

    Exercises 4.1.1 and 4.1.2, relations α,β.

  2. 2.

    Exercises 4.1.3 and 4.1.4, relations γ,δ.

  3. 3.

    Exercises 4.1.5 and 4.1.6, relations ϵ,φ.

  4. 4.

    Exercise 4.1.7, relations α,β.

  5. 5.

    Exercise 4.1.8, relations ρ,σ.

  6. 6.

    Exercises 4.1.1 and 4.1.2, relations αβ,βγ.

  7. 7.

    Exercise 4.1.8, relations ρσ,σρ.

  8. 8.

    Suppose α is a relation between finite sets A and B. What is the relationship between M α and \(M_{\not\alpha}\)?

  9. 9.

    Let A={a 1,a 2,…,a m }, B={b 1,b 2,…,b n }, C={c 1,c 2,…,c p } and D={d 1,d 2,…,d q } be finite sets and α, β and γ be relations from A to B, B to C, and C to D, respectively. Show that M α ∨(M β M γ )=(M α M β )∨M γ

    1. (i)

      using the fact that composition of relations is associative;

    2. (ii)

      working directly from the definition of matrix conjunction.

  10. 10.

    Let α and β be relations from A to B. What can you say about M α and M β if βα?

  11. 11.

    Suppose α is a relation from A to itself. What can you say about M α if α is

    1. (i)

      irreflexive?

    2. (ii)

      antisymmetric?

    3. (iii)

      atransitive?

In Exercises 12 to 18, write down the adjacency matrix and the incidence matrix of the graph.

  1. 12.

    The complete graph K 5.

  2. 13.

    The cycle C 6.

  3. 14.

    The path P 5.

  4. 15.

    The wheel W 5.

  5. 16.

    The union C 3C 3.

  6. 17.

    The star K 1,5.

  7. 18.

    The Petersen graph.

In Exercises 19 and 20, use the adjacency matrix to answer the question.

  1. 19.

    Find the number of paths of length 2 joining two vertices in the complete graph K 6.

  2. 20.

    Find the number of paths of length 2 joining two vertices in the wheel W 6. (You will need to consider separately the various types of pairs of vertices.)

  3. 21.

    Suppose G is a regular graph. What does this tell you about M G ?

  4. 22.

    Suppose G is any graph. What is the relationship between M G and \(M_{\overline{G}}\)? Compare your answer to Exercise 8.

  5. 23.

    What information do the diagonal elements of \(M_{G}^{2}\) give about the graph G?