# Chapter 3. Matrices

### Chapter Overview

In this chapter, you will learn to:

1. Do matrix operations.

2. Solve linear systems using the Gauss-Jordan method.

3. Solve linear systems using the matrix inverse method.

4. Do application problems.

### Introduction to Matrices

#### Section Overview

In this section you will learn to:

2. Multiply a matrix by a scalar.

3. Multiply two matrices.

A matrix is a rectangular array of numbers. Matrices are useful in organizing and manipulating large amounts of data. In order to get some idea of what matrices are all about, we will look at the following example.

Example 3.1

Fine Furniture Company makes chairs and tables at its San Jose, Hayward, and Oakland factories. The total production, in hundreds, from the three factories for the years 1994 and 1995 is listed in the table below.

Table 3.1.

 1994 1995 Chairs Tables Chairs Tables
San Jose30183620
Hayward20122418
Oakland16102012
1. Represent the production for the years 1994 and 1995 as the matrices A and B.

2. Find the difference in sales between the years 1994 and 1995.

3. The company predicts that in the year 2000 the production at these factories will double that of the year 1994. What will the production be for the year 2000?

1. The matrices are as follows:

2. We are looking for the matrix BA. When two matrices have the same number of rows and columns, the matrices can be added or subtracted entry by entry. Therefore, we get

(3.1)
3. We would like a matrix that is twice the matrix of 1994, i.e., 2A.

Whenever a matrix is multiplied by a number, each entry is multiplied by the number.

(3.2)

Before we go any further, we need to familiarize ourselves with some terms that are associated with matrices. The numbers in a matrix are called the entries or the elements of a matrix. Whenever we talk about a matrix, we need to know the size or the dimension of the matrix. The dimension of a matrix is the number of rows and columns it has. When we say a matrix is a 3 by 4 matrix, we are saying that it has 3 rows and 4 columns. The rows are always mentioned first and the columns second. This means that a 3×4 matrix does not have the same dimension as a 4×3 matrix. A matrix that has the same number of rows as columns is called a square matrix. A matrix with all entries zero is called a zero matrix. A square matrix with 1's along the main diagonal and zeros everywhere else, is called an identity matrix. When a square matrix is multiplied by an identity matrix of same size, the matrix remains the same. A matrix with only one row is called a row matrix or a row vector, and a matrix with only one column is called a column matrix or a column vector. Two matrices are equal if they have the same size and the corresponding entries are equal.

If two matrices have the same size, they can be added or subtracted. The operations are performed on corresponding entries.

Example 3.2

Given the matrices A, B, C and D, below

(3.3)

Find, if possible.

1. A+B

2. CD

3. A+D.

As we mentioned earlier, matrix addition and subtraction involves performing these operations entry by entry.

1. We add each element of A to the corresponding entry of B.

(3.4)
2. Just like the problem above, we perform the subtraction entry by entry.

(3.5)
3. The sum A+D cannot be found because the two matrices have different sizes.

Two matrices can only be added or subtracted if they have the same dimension.

Multiplying a Matrix by a Scalar

If a matrix is multiplied by a scalar (a constant number), each entry is multiplied by that scalar.

Example 3.3

Given the matrix A and C in Example 3.2, find 2A and −3C.

To find 2A, we multiply each entry of matrix A by 2, and to find −3C, we multiply each entry of C by −3. The results are given below.

1. We multiply each entry of A by 2.

(3.6)
2. We multiply each entry of C by −3.

(3.7)

Multiplication of Two Matrices

To multiply a matrix by another is not as easy as the addition, subtraction, or scalar multiplication of matrices. Because of its wide use in application problems, it is important that we learn it well. Therefore, we will try to learn the process in a step by step manner. We first begin by finding a product of a row matrix and a column matrix.

Example 3.4

Given and , find the product .

The product is a 1×1 matrix whose entry is obtained by multiplying the corresponding entries and then forming the sum.

(3.8)

Note that is a 1×1 matrix, and its only entry is 2a+3b+4c.

Example 3.5

Given and , find the product .

Again, we multiply the corresponding entries and add.

(3.9)

In order for a product of a row matrix and a column matrix to exist, the number of entries in the row matrix must be the same as the number of entries in the column matrix.

Example 3.6

Given and , find the product .

We already know how to multiply a row matrix by a column matrix. To find the product , in this example, we will be multiplying the row matrix A to both the first and second columns of matrix B, resulting in a 1×2 matrix.

(3.10)

We have just multiplied a 1×3 matrix by a matrix whose size is 3×2. So unlike addition and subtraction, it is possible to multiply two matrices with different dimensions as long as the number of entries in the rows of the first matrix are the same as the number of entries in columns of the second matrix.

Example 3.7

Given and , find the product .

This time we are multiplying two rows of the matrix A with two columns of the matrix B. Since the number of entries in each row of A are the same as the number of entries in each column of B, the product is possible. We do exactly what we did in Example 3.6. The only difference is that the matrix A has one more row.

We multiply the first row of the matrix A with the two columns of B, one at a time, and then repeat the process with the second row of A. We get

(3.11)
Example 3.8

Given the matrices E, F, G and H, below

(3.12)

Find, if possible.

1. To find , we multiply the first row of E with the columns and of the matrix F, and then repeat the process by multiplying the other two rows of E with these columns of F. The result is as follows:

(3.13)
2. The product is not possible because the matrix F has two entries in each row, while the matrix E has three entries in each column. In other words, the matrix F has two columns, while the matrix E has three rows.

We summarize matrix multiplication as follows:

In order for product to exist, the number of columns of A, must equal the number of rows of B. If matrix A is of dimension m×n and B of dimension n×p, the product will have the dimension m×p. Furthermore, matrix multiplication is not commutative.

Example 3.9

Given the matrices R, S, and T below.

(3.14)

Find .

We multiply the matrices R and S.

(3.15)
(3.16)
(3.17)
(3.18)
(3.19)

In this chapter, we will be using matrices to solve linear systems. In the section called “Inverse Matrices”, we will be asked to express linear systems as the matrix equation , where A, X, and B are matrices. The matrix A is called the coefficient matrix.

Example 3.10

Verify that the system of two linear equations with two unknowns:

(3.20)
(3.21)

can be written as , where

If we multiply the matrices A and X, we get

(3.22)

If then

(3.23)

If two matrices are equal, then their corresponding entries are equal. Therefore, it follows that

(3.24)
(3.25)
Example 3.11

Express the following system as .

(3.26)2x+3y–4z=5
(3.27)3x+4y−5z=6
(3.28)5x−6z=7

The above system of equations can be expressed in the form as shown below.

(3.29)

### Systems of Linear Equations; Gauss-Jordan Method

In this section, we learn to solve systems of linear equations using a process called the Gauss-Jordan method. The process begins by first expressing the system as a matrix, and then reducing it to an equivalent system by simple row operations. The process is continued until the solution is obvious from the matrix. The matrix that represents the system is called the augmented matrix, and the arithmetic manipulation that is used to move from a system to a reduced equivalent system is called a row operation.

Example 3.12

Write the following system as an augmented matrix.

(3.30)2x+3y−4z=5
(3.31)3x+4y−5z=−6
(3.32)4x+5y−6z=7

We express the above information in matrix form. Since a system is entirely determined by its coefficient matrix and by its matrix of constant terms, the augmented matrix will include only the coefficient matrix and the constant matrix. So the augmented matrix we get is as follows:

(3.33)

In the the section called “Introduction to Matrices ”, we expressed the system of equations as , where A represented the coefficient matrix, and B the matrix of constant terms. As an augmented matrix, we write the matrix as [AB]. It is clear that all of the information is maintained in this matrix form, and only the letters x, y and z are missing. A student may choose to write x, y and z on top of the first three columns to help ease the transition.

Example 3.13

For the following augmented matrix, write the system of equations it represents.

(3.34)

The system is readily obtained as below.

(3.35)x+3y−5z=2
(3.36)2x−3z=−5
(3.37)3x+2y−3z=−1

Once a system is expressed as an augmented matrix, the Gauss-Jordan method reduces the system into a series of equivalent systems by employing the row operations. This row reduction continues until the system is expressed in what is called the reduced row echelon form. The reduced row echelon form of the coefficient matrix has 1's along the main diagonal and zeros elsewhere. The solution is readily obtained from this form.

The method is not much different form the algebraic operations we employed in the elimination method in the first chapter. The basic difference is that it is algorithmic in nature, and, therefore, can easily be programmed on a computer.

We will next solve a system of two equations with two unknowns, using the elimination method, and then show that the method is analogous to the Gauss-Jordan method.

Example 3.14

Solve the following system by the elimination method.

(3.38)x+3y=7
(3.39)3x+4y=11

We multiply the first equation by – 3, and add it to the second equation.

(3.40)

By doing this we have transformed our original system into an equivalent system as follows.

(3.41)x+3y=7
(3.42)−5y=−10

We divide the second equation by – 5, and we get the next equivalent system.

(3.43)x+3y=7
(3.44)y=2

Now we multiply the second equation by – 3 and add to the first, we get

(3.45)x=1
(3.46)y=2
Example 3.15

Solve the following system from Example 3.14 by the Gauss-Jordan method, and show the similarities in both methods by writing the equations next to the matrices.

(3.47)x+3y=7
(3.48)3x+4y=11

The augmented matrix for the system is as follows.

(3.49)

We multiply the first row by – 3, and add to the second row.

(3.50)

We divide the second row by – 5, we get,

(3.51)

Finally, we multiply the second row by – 3 and add to the first row, and we get,

(3.52)

Now we list the three row operations the Gauss-Jordan method employs.

Example 3.16Row Operations
1. Any two rows in the augmented matrix may be interchanged.

2. Any row may be multiplied by a non-zero constant.

3. A constant multiple of a row may be added to another row.

One can easily see that these three row operation may make the system look different, but they do not change the solution of the system.

The first row operation states that if any two rows of a system are interchanged, the new system obtained has the same solution as the old one. Let us look at an example in two equations with two unknowns. Consider the system

(3.53)x+3y=7
(3.54)3x+4y=11

We interchange the rows, and we get,

(3.55)3x+4y=11
(3.56)x+3y=7

Clearly, this system has the same solution as the one above.

The second operation states that if a row is multiplied by any non-zero constant, the new system obtained has the same solution as the old one. Consider the above system again,

(3.57)x+3y=7
(3.58)3x+4y=11

We multiply the first row by –3, we get,

(3.59) – 3 x – 9 y = – 21
(3.60)3x+4y=11

Again, it is obvious that this new system has the same solution as the original.

The third row operation states that any constant multiple of one row added to another preserves the solution. Consider our system,

(3.61)x+3y=7
(3.62)3x+4y=11

If we multiply the first row by – 3, and add it to the second row, we get,

(3.63)x+3y=7
(3.64)−5y=−10

And once again, the same solution is maintained.

Now that we understand how the three row operations work, it is time to introduce the Gauss-Jordan method to solve systems of linear equations.

As mentioned earlier, the Gauss-Jordan method starts out with an augmented matrix, and by a series of row operations ends up with a matrix that is in the reduced row echelon form. A matrix is in the reduced row echelon form if the first nonzero entry in each row is a 1, and the columns containing these 1's have all other entries as zeros. The reduced row echelon form also requires that the leading entry in each row be to the right of the leading entry in the row above it, and the rows containing all zeros be moved down to the bottom.

We state the Gauss-Jordan method as follows.

Example 3.17Gauss-Jordan Method
1. Write the augmented matrix.

2. Interchange rows if necessary to obtain a non-zero number in the first row, first column.

3. Use a row operation to make the entry in the first row, first column, a 1.

4. Use row operations to make all other entries as zeros in column one.

5. Interchange rows if necessary to obtain a nonzero number in the second row, second column. Use a row operation to make this entry 1. Use row operations to make all other entries as zeros in column two.

6. Repeat step 5 for row 3, column 3. Continue moving along the main diagonal until you reach the last row, or until the number is zero. The final matrix is called the reduced row-echelon form.

Example 3.18

Solve the following system by the Gauss-Jordan method.

(3.65)2x+y+2z=10
(3.66)x+2y+z=8
(3.67)3x+yz=2

We write the augmented matrix.

(3.68)

We want a 1 in row one, column one. This can be obtained by dividing the first row by 2, or interchanging the second row with the first. Interchanging the rows is a better choice because that way we avoid fractions.

(3.69)

we interchanged row 1(R1) and row 2(R2)

We need to make all other entries zeros in column 1. To make the entry (2) a zero in row 2, column 1, we multiply row 1 by - 2 and add it to the second row. We get,

(3.70)

To make the entry (3) a zero in row 3, column 1, we multiply row 1 by –3 and add it to the third row. We get,

(3.71)

So far we have made a 1 in the left corner and all other entries zeros in that column. Now we move to the next diagonal entry, row 2, column 2. We need to make this entry(–3) a 1 and make all other entries in this column zeros. To make row 2, column 2 entry a 1, we divide the entire second row by –3.

(3.72)

Next, we make all other entries zeros in the second column.

(3.73)

We make the last diagonal entry a 1, by dividing row 3 by – 4.

(3.74)

Finally, we make all other entries zeros in column 3.

(3.75)

Clearly, the solution reads x=1, y=2 , and z=3.

Before we leave this section, we mention some terms we may need in the fourth chapter. The process of obtaining a 1 in a location, and then making all other entries zeros in that column, is called pivoting. The number that is made a 1 is called the pivot element, and the row that contains the pivot element is called the pivot row. We often multiply the pivot row by a number and add it to another row to obtain a zero in the latter. The row to which a multiple of pivot row is added is called the target row.

### Systems of Linear Equations – Special Cases

#### Section Overview

In this section you will learn to:

1. Determine the linear systems that have no solution.

2. Solve the linear systems that have infinitely many solutions.

If we consider the intersection of two lines in a plane, three things can happen.

1. The lines intersect in exactly one point. This is called an independent system.

2. The lines are parallel, so they do not intersect. This is called an inconsistent system.

3. The lines coincide, so they intersect at infinitely many points. This is a dependent system.

The figures below shows all three cases.

Every system of equations has either one solution, no solution, or infinitely many solutions.

In the the section called “Systems of Linear Equations; Gauss-Jordan Method”, we used the Gauss-Jordan method to solve systems that had exactly one solution. In this section, we will determine the systems that have no solution, and solve the systems that have infinitely many solutions.

Example 3.19

Solve the following system of equations.

(3.76)x+y=7
(3.77)x+y=9

Let us use the Gauss-Jordan method to solve this system. The augmented matrix is as follows.

(3.78)

If we multiply the first row by – 1 and add to the second row, we get

(3.79)

Since 0 cannot equal 2, the last equation cannot be true for any choices of x and y.

Alternatively, it is clear that the two lines are parallel; therefore, they do not intersect.

At this stage, we are going to start using a calculator to row reduce the augmented matrix.

Example 3.20

Solve the following system of equations.

(3.80)2x+3y−4z=7
(3.81)3x+4y−2z=9
(3.82)5x+7y−6z=20

We enter the following augmented matrix in the calculator.

(3.83)

Now by pressing the key to obtain the reduced row-echelon form, we get

(3.84)

The last row indicates that the system is inconsistent; therefore, there is no solution.

Example 3.21

Solve the following system of equations.

(3.85)x+y=7
(3.86)x+y=7

The problem clearly asks for the intersection of two lines that are the same; that is, the lines coincide. This means the lines intersect at an infinite number of points.

A few intersection points are listed as follows: (3, 4), (5, 2), (–1, 8), (–6, 13) etc. However, when a system has an infinite number of solutions, the solution is often expressed in the parametric form. This can be accomplished by assigning an arbitrary constant, t, to one of the variables, and then solving for the remaining variables. Therefore, if we let y=t, then x=7−t. Or we can say all ordered pairs of the form ( 7−t, t) satisfy the given system of equations.

Alternatively, while solving the Gauss-Jordan method, we will get the reduced row-echelon form given below.

(3.87)

The row of all zeros, can simply be discarded in a manner that it never existed. This leaves us with only one equation but two variables. And whenever there are more variables than the equations, the solution must be expressed in terms of an arbitrary constant, as above. That is, x=7−t, y=t.

Example 3.22

Solve the following system of equations.

(3.88)x+y+z=2
(3.89)2x+yz=3
(3.90)3x+2y=5

The augmented matrix and the reduced row-echelon form are given below.

(3.91)
(3.92)

Since the last equation dropped out, we are left with two equations and three variables. This means the system has infinite number of solutions. We express those solutions in the parametric form by letting the last variable z equal the parameter t.

The first equation reads x−2z=1, therefore, x=1+2z.

The second equation reads y+3z=1, therefore, y=1−3z.

And now if we let z=t, the solution is expressed as follows:

(3.93)x=1+2t, y=1−3t, z=t.

The reader should note that particular solutions to the system can be obtained by assigning values to the parameter t. For example, if we let t=2, we have the solution (5, –5, 2).

Example 3.23

Solve the following system of equations.

(3.94)x+2y−3z=5
(3.95)2x+4y−6z=10
(3.96)3x+6y−9z=15

The reduced row-echelon form is given below.

(3.97)

This time the last two equations drop out, and we are left with one equation and three variables. Again, there are infinite number of solutions. But this time the answer must be expressed in terms of two arbitrary constants.

If we let z=t and let y=s, then the first equation x+2y−3z=5 results in x=5−2s+3t.

We rewrite the solution as: x=5−2s+3t, y=s, z=t.

We summarize our discussion in the following table.

1. If any row of the reduced row-echelon form of the matrix gives a false statement such as 0 = 1, the system is inconsistent and has no solution.

2. If the reduced row echelon form has fewer equations than the variables and the system is consistent, then the system has an infinite number of solutions. Remember the rows that contain all zeros are dropped.

1. If a system has an infinite number of solutions, the solution must be expressed in the parametric form.

2. The number of arbitrary parameters equals the number of variables minus the number of equations.

### Inverse Matrices

#### Section Overview

In this section you will learn to:

1. Find the inverse of a matrix, if it exists.

2. Use inverses to solve linear systems.

In this section, we will learn to find the inverse of a matrix, if it exists. Later, we will use matrix inverses to solve linear systems.

Definition of an Inverse: An n×n matrix has an inverse if there exists a matrix B such that , where In is an n×n identity matrix. The inverse of a matrix A, if it exists, is denoted by the symbol A−1.

Example 3.24

Given matrices A and B below, verify that they are inverses.

(3.98)

The matrices are inverses if the product and both equal I2 , the identity matrix of dimension 2×2.

(3.99)

Clearly that is the case; therefore, the matrices A and B are inverses of each other.

Example 3.25

Find the inverse of the following matrix.

(3.100)

Suppose A has an inverse, and it is

()

Then AB=I

(3.101)

After multiplying the two matrices on the left side, we get

(3.102)

Equating the corresponding entries, we get four equations with four unknowns as follows:

(3.103)3a+c=1     3b+d=0
(3.104)5a+2c=0      5b+2d=1

Solving this system, we get

(3.105)a=2     b=−1     c=−5     d=3

Therefore, the inverse of the matrix A is

(3.106)

In this problem, finding the inverse of matrix A amounted to solving the system of equations:

(3.107)3a+c=1      3b+d=0
(3.108)5a+2c=0      5b+2d=1

Actually, it can be written as two systems, one with variables a and c, and the other with b and d. The augmented matrices for both are given below.

()

As we look at the two augmented matrices, we notice that the coefficient matrix for both the matrices is the same. Which implies the row operations of the Gauss-Jordan method will also be the same. A great deal of work can be saved if the two right hand columns are grouped together to form one augmented matrix as below.

(3.109)

And solving this system, we get

(3.110)

The matrix on the right side of the vertical line is the A−1 matrix.

What you just witnessed is no coincidence. This is the method that is often employed in finding the inverse of a matrix.

We list the steps, as follows:

Example 3.26The Method for Finding the Inverse of a Matrix
1. Write the augmented matrix [AIn].

2. Write the augmented matrix in step 1 in reduced row echelon form.

3. If the reduced row echelon form in 2 is , then B is the inverse of A.

4. If the left side of the row reduced echelon is not an identity matrix, the inverse does not exist.

Example 3.27

Given the matrix A below, find its inverse.

(3.111)

We write the augmented matrix as follows.

(3.112)

We reduce this matrix using the Gauss-Jordan method.

Multiplying the first row by –2 and adding it to the second row, we get

(3.113)

If we swap the second and third rows, we get

(3.114)

Divide the second row by –2. The result is

(3.115)

Let us do two operations here. 1) Add the second row to first, 2) Add -5 times the second row to the third. And we get

(3.116)

Multiplication of the third row by 2 results in

(3.117)

Multiply the third row by 1/2 and add it to the second. Also, multiply the third row by −1/2 and add it to the first. We get

(3.118)

Therefore, the inverse of matrix A is

(3.119)

One should verify the result by multiplying the two matrices to see if the product does, indeed, equal the identity matrix.

Now that we know how to find the inverse of a matrix, we will use inverses to solve systems of equations. The method is analogous to solving a simple equation like the one below.

(3.120)
Example 3.28

Solve the following equation .

(3.121)

To solve the above equation, we multiply both sides of the equation by the multiplicative inverse of which happens to be . We get

(3.122)
(3.123)x=6

We use the above example as an analogy to show how linear systems of the form are solved.

To solve a linear system, we first write the system in the matrix equation , where A is the coefficient matrix, X the matrix of variables, and B the matrix of constant terms. We then multiply both sides of this equation by the multiplicative inverse of the matrix A.

Consider the following example.

Example 3.29

Solve the following system

(3.124)3x+y=3
(3.125)5x+2y=4

To solve the above equation, first we express the system as

(3.126)

where A is the coefficient matrix, and B is the matrix of constant terms. We get

(3.127)

To solve this system, we multiply both sides of the matrix equation by A−1. Since the matrix A is the same matrix A whose inverse we found in Example 3.25,

(3.128)

Multiplying both sides by A−1, we get

(3.129)
(3.130)
(3.131)

Therefore, x=2 , and y=−3.

Example 3.30

Solve the following system

(3.132)xy+z=6
(3.133)2x+3y=1
(3.134)−2y+z=5

To solve the above equation, we write the system in the matrix form as follows:

To solve this system, we need inverse of A. From Example 3.27, we have

We multiply both sides of the matrix equation , by A−1, we get

After multiplying the matrices, we get

Once again, we remind the reader that not every system of equations can be solved by the matrix inverse method. Although the Gauss-Jordan method works for every situation, the matrix inverse method works only in cases where the inverse of the square matrix exists. In such cases the system has a unique solution.

We summarize our discussion in the following table.

The Method for Finding the Inverse of a Matrix
1. Write the augmented matrix .

2. Write the augmented matrix in step 1 in reduced row echelon form.

3. If the reduced row echelon form in 2 is , then B is the inverse of A.

4. If the left side of the row reduced echelon is not an identity matrix, the inverse does not exist.

The Method for Solving a System of Equations When a Unique Solution Exists
1. Express the system in the matrix equation .

2. To solve the equation , we multiply on both sides by A−1.

### Application of Matrices in Cryptography

In this section, we see a use of matrices in encoding and decoding secret messages. There are many techniques used, but we will use a method that first converts the secret message into a string of numbers by arbitrarily assigning a number to each letter of the message. Next we convert this string of numbers into a new set of numbers by multiplying the string by a square matrix of our choice that has an inverse. This new set of numbers represents the coded message. To decode the message, we take the string of coded numbers and multiply it by the inverse of the matrix to get the original string of numbers. Finally, by associating the numbers with their corresponding letters, we obtain the original message.

In this section, we will use the correspondence where the letters A to Z correspond to the numbers 1 to 26, as shown below, and a space is represented by the number 27, and all punctuation is ignored.

 A B C D E F G H I J K L M 1 2 3 4 5 6 7 8 9 10 11 12 13 N O P Q R S T U V W X Y Z 14 15 16 17 18 19 20 21 22 23 24 25 26
Example 3.31

Use the matrix to encode the message: ATTACK NOW!

We divide the letters of the message into groups of two.

AT TA CK –N OW

We assign the numbers to these letters from the above table, and convert each pair of numbers into 2×1 matrices. In the case where a single letter is left over on the end, a space is added to make it into a pair.

(3.135)

So at this stage, our message expressed as 2×1 matrices is as follows.

(3.136)

Now to encode, we multiply, on the left, each matrix of our message by the matrix A. For example, the product of A with our first matrix is

(3.137)

By multiplying each of the matrices in ( I ) by the matrix A, we get the desired coded message given below.

(3.138)
Example 3.32

Decode the following message that was encoded using matrix .

(3.139)

Since this message was encoded by multiplying by the matrix A in Example 3.31, we decode this message by first multiplying each matrix, on the left, by the inverse of matrix A given below.

(3.140)

For example,

(3.141)

By multiplying each of the matrices in ( II ) by the matrix A−1, we get the following.

(3.142)

Finally, by associating the numbers with their corresponding letters, we obtain the following.

(3.143)

And the message reads: KEEP IT UP.

Now suppose we wanted to use a 3×3 matrix to encode a message, then instead of dividing the letters into groups of two, we would divide them into groups of three.

Example 3.33

Using the matrix , encode the message: ATTACK NOW!

We divide the letters of the message into groups of three.

ATT ACK –NO W––

Note that since the single letter "W" was left over on the end, we added two spaces to make it into a triplet.

Now we assign the numbers their corresponding letters from the table, and convert each triplet of numbers into 3×1 matrices. We get

(3.144)

So far we have,

(3.145)

We multiply, on the left, each matrix of our message by the matrix B. For example,

(3.146)

By multiplying each of the matrices in ( III ) by the matrix B, we get the desired coded message as follows:

(3.147)

If we need to decode this message, we simply multiply the coded message by B−1, and associate the numbers with the corresponding letters of the alphabet.

Example 3.34

Decode the following message that was encoded using matrix .

(3.148)

Since this message was encoded by multiplying by the matrix B. We first determine inverse of B.

(3.149)

To decode the message, we multiply each matrix, on the left, by B−1. For example,

(3.150)

By multiplying each of the matrices in ( IV ) by the matrix B−1, we get the following.

(3.151)

Finally, by associating the numbers with their corresponding letters, we obtain the following.

(3.152)

And the message reads: HOLD FIRE.

We summarize.

Example 3.35
TO ENCODE A MESSAGE
1. Divide the letters of the message into groups of two or three.

2. Convert each group into a string of numbers by assigning a number to each letter of the message. Remember to assign letters to blank spaces.

3. Convert each group of numbers into column matrices.

4. Convert these column matrices into a new set of column matrices by multiplying them with a compatible square matrix of your choice that has an inverse. This new set of numbers or matrices represents the coded message.

TO DECODE A MESSAGE
1. Take the string of coded numbers and multiply it by the inverse of the matrix that was used to encode the message.

2. Associate the numbers with their corresponding letters.

### Applications – Leontief Models

In the 1930's, Wassily Leontief used matrices to model economic systems. His models, often referred to as the input-output models, divide the economy into sectors where each sector produces goods and services not only for itself but also for other sectors. These sectors are dependent on each other and the total input always equals the total output. In 1973, he won the Nobel Prize in Economics for his work in this field. In this section we look at both the closed and the open models that he developed.

The Closed Model

As an example of the closed model, we look at a very simple economy, where there are only three sectors: food, shelter, and clothing.

Example 3.36

We assume that in a village there is a farmer, carpenter, and a tailor, who provide the three essential goods: food, shelter, and clothing. Suppose the farmer himself consumes 40% of the food he produces, and gives 40% to the carpenter, and 20% to the tailor. Thirty percent of the carpenter's production is consumed by himself, 40% by the farmer, and 30% by the carpenter. Fifty percent of the tailor's production is used by himself, 30% by the farmer, and 20% by the tailor. Write the matrix that describes this closed model.

The table below describes the above information.

 The proportion produced by the farmer The propotion produced by the carpenter The proportion produced by the tailor The proportion used by the farmer .40 .40 .30 The proportion used by the carpenter .40 .30 .20 The proportion used by the tailor .20 .30 .50

In a matrix form it can be written as follows.

(3.153)

This matrix is called the input-output matrix. It is important that we read the matrix correctly. For example the entry A23, the entry in row 2 and column 3, represents the following.

A23=20% of the tailor's production is used by the carpenter.

A33=50%of the tailor's production is used by the tailor.

Example 3.37

In Example 3.36 above, how much should each person get for his efforts?

We choose the following variables.

(3.154)x=Farmer's pay
(3.155)y= Carpenter's pay
(3.156)z= Tailor's pay

As we said earlier, in this model input must equal output. That is, the amount paid by each equals the amount received by each.

Let us say the farmer gets paid x dollars. Let us now look at the farmer's expenses. The farmer uses up 40% of his own production, that is, of the x dollars he gets paid, he pays himself .40x dollars, he pays .40y dollars to the carpenter, and .30z to the tailor. Since the expenses equal the wages, we get the following equation.

(3.157)x=.40x+.40y+.30z

In the same manner, we get

(3.158)y=.40x+.30y+.20z
(3.159)z=.20x+.30y+.50z

The above system can be written as

(3.160)

This system is often referred to as

(3.161)

Simplification results in

(3.162).60x−.40y−.30z=0
(3.163)−.40x+.70y−.20z=0
(3.164)−.20x−.30y+.50z=0

Solving for x, y, and z using the Gauss-Jordan method, we get

(3.165)

Since we are only trying to determine the proportions of the pay, we can choose t to be any value. Suppose we let t=$2600, then we get (3.166) The use of a calculator in solving these problems is strongly recommended. Although we at De Anza College use TI-85 calculators, any calculator that handles matrices will do. The Open Model The open model is more realistic, as it deals with the economy where sectors of the economy not only satisfy each others needs, but they also satisfy some outside demands. In this case, the outside demands are put on by the consumer. But the basic assumption is still the same; that is, whatever is produced is consumed. Let us again look at a very simple scenario. Suppose the economy consists of three people, the farmer F, the carpenter C, and the tailor T. A part of the farmer's production is used by all three, and the rest is used by the consumer. In the same manner, a part of the carpenter's and the tailor's production is used by all three, and rest is used by the consumer. Let us assume that whatever the farmer produces, 20% is used by him, 15% by the carpenter, 10% by the tailor, and the consumer uses the other 40 billion dollars worth of the food. Ten percent of the carpenter's production is used by him, 25% by the farmer, 5% by the tailor, and 50 billion dollars worth by the consumer. Fifteen percent of the clothing is used by the tailor, 10% by the farmer, 5% by the carpenter, and the remaining 60 billion dollars worth by the consumer. We write the internal consumption in the following table, and express the demand as the matrix D.  F produces C produces T produces F uses .20 .25 .10 C uses .15 .10 .05 T uses .10 .05 .15 The consumer demand for each industry in billions of dollars is given below. (3.167) Example 3.38 In Example 3.37, what should be, in billions of dollars, the required output by each industry to meet the demand given by the matrix D? We choose the following variables. (3.168)x=Farmer's output (3.169)y= Carpenter's output (3.170)z= Tailor's output In the closed model, our equation was , that is, the total input equals the total output. This time our equation is similar with the exception of the demand by the consumer. So our equation for the open model should be , where D represents the demand matrix. We express it as follows: (3.171) (3.172) To solve this system, we write it as (3.173) (3.174)(IA)X=D where I is a 3 by 3 identity matrix (3.175)X=(IA)−1D (3.176) (3.177) (3.178) (3.179) Therefore, the three industries must produce the following amount of goods in billions of dollars. (3.180)Farmer=$83.7999      Carpenter=$74.2341 Tailor=$84.813

We will do one more problem like the one above, except this time we give the amount of internal and external consumption in dollars and ask for the proportion of the amounts consumed by each of the industries. In other words, we ask for the matrix A.

Example 3.39

Suppose an economy consists of three industries F, C, and T. Again, each of the industries produces for internal consumption among themselves, as well as, the external demand by the consumer. The following table gives information about the use of each industry's production in dollars.

 F C T Demand Total F 40 50 60 100 250 C 30 40 40 110 220 T 20 30 30 120 200

The first row says that of the $250 dollars worth of production by the industry F,$40 is used by F, $50 is used by C,$60 is used by T, and the remainder of \$100 is used by the consumer. The other rows are described in a similar manner.

Find the proportion of the amounts consumed by each of the industries. In other words, find the matrix A.

Once again, the total input equals the total output.

We are being asked to determine the following:

How much of the production of each of the three industries, F, C, and T is required to produce one unit of F? In the same way, how much of the production of each of the three industries, F, C, and T is required to produce one unit of C? And finally, how much of the production of each of the three industries, F, C, and T is required to produce one unit of T?

Since we are looking for proportions, we need to divide the production of each industry by the total production for each industry.

We analyze as follows:

To produce 250 units of F, we need to use 40 units of F, 30 units of C, and 20 units of T.

Therefore, to produce 1 unit of F, we need to use 40/250 units of F, 30/250 units of C, and 20/250 units of T.

To produce 220 units of C, we need to use 50 units of F, 40 units of C, and 30 units of T.

Therefore, to produce 1 unit of C, we need to use 50/220 units of F, 40/220 units of C, and 30/220 units of T.

To produce 200 units of T, we need to use 60 units of F, 40 units of C, and 30 units of T.

Therefore, to produce 1 unit of T, we need to use 60/200 units of F, 40/200 units of C, and 30/200 units of T.

We obtain the following matrix.

(3.181)

or

(3.182)

Clearly

(3.183)
(3.184)

We summarize as follows:

Example 3.40LEONTIEF'S MODELS
THE CLOSED MODEL
1. All consumption is within the industries. There is no external demand.

2. (3.185) Input = Output

3. or (IA)X=0

THE OPEN MODEL
1. In addition to internal consumption, there is an outside demand by the consumer.

2. (3.186) Input = Output

3. or X=(IA)−1D

Solutions