week 8 systems of equations matrix solutions to linear systems

25
WEEK 8 SYSTEMS OF EQUATIONS MATRIX SOLUTIONS TO LINEAR SYSTEMS

Upload: scott-harry-fletcher

Post on 27-Dec-2015

217 views

Category:

Documents


1 download

TRANSCRIPT

Page 1: WEEK 8 SYSTEMS OF EQUATIONS MATRIX SOLUTIONS TO LINEAR SYSTEMS

WEEK 8

SYSTEMS OF EQUATIONS•MATRIX SOLUTIONS TO LINEAR

SYSTEMS

Page 2: WEEK 8 SYSTEMS OF EQUATIONS MATRIX SOLUTIONS TO LINEAR SYSTEMS

OBJECTIVES

At the end of this session , you will be able to: Write an augmented matrix for a system of linear equations. Perform matrix row operations. Use matrices and Gaussian elimination to solve systems of linear equations. Use matrices and Gauss-Jordan elimination to solve systems of linear equations..

Page 3: WEEK 8 SYSTEMS OF EQUATIONS MATRIX SOLUTIONS TO LINEAR SYSTEMS

INDEX1. Matrices2. Solving Linear Systems by using Matrices.3. Matrix row-operations4. Gauss - Elimination Method5. Gauss – Jordan Method6. Summary

Page 4: WEEK 8 SYSTEMS OF EQUATIONS MATRIX SOLUTIONS TO LINEAR SYSTEMS

1. MATRICESMatrices are used to display information and to solve systems of linear equations. This week we shall learn about matrices and determinants. We shall confine ourselves to the study of elementary concepts of matrices and determinants and application of these concepts in solving a system of linear equations.

Suppose we want to express that John has 10 books. We may express it as [10] with the understanding that the number inside [ ] is the number of books John has.

Next suppose we want to express that John has 10 books and 5 pencils. We may express it as [10 5] with the understanding that first number inside [ ] is the number of books while the second number is the number of pencils.

Let us now suppose that there are three students – John, Mario, and Peter. John has 10 books and 5 pencils, Mario has 7 books and 3 pencils, and Peter has 5 books and 4 pencils. How can we express this information? We can express it in tabular form as follows:

Name Books Pencils

John 10 5

Mario 7 3

Peter 5 4

Page 5: WEEK 8 SYSTEMS OF EQUATIONS MATRIX SOLUTIONS TO LINEAR SYSTEMS

1. MATRICES(Cont…)We can also briefly write this as follows:

First Row

Second Row

Third Row

Implied in the above is the following information:

i. The entries in the first, second and the third rows represent the number of objects (books and pencils) possessed by John, Mario, and Peter respectively.

ii. The entries in the first and second columns represents the number of books and the number of pencils respectively.

Thus, the entry in the second row and second column represent the number of pencils possessed by Mario. Similarly, each entry in the above display can be interpreted.

An arrangement or display of the above kind is called a matrix. Formally, we have the following definition of a matrix:

A Matrix (plural: Matrices) is an ordered rectangular array/arrangement of numbers arranged in rows and columns and enclosed in brackets. Each number in the matrix is called an element or an entry of the matrix.

First Column

Second Column

10 5

7 3

5 4

Page 6: WEEK 8 SYSTEMS OF EQUATIONS MATRIX SOLUTIONS TO LINEAR SYSTEMS

1. MATRICES(Cont…)The following are some example of matrices:

NOTE: A matrix is always inside a square brackets. Do not use absolute value bars: “||”, as they

have a different meaning in this context. Do not use parentheses or curly brackets (“{ }”) or some other grouping symbol (or no grouping symbol at all) , as these have no meaning at all.

Matrices are usually denoted by capital letters, such as “A” or “B”.Order of a matrix: Matrices are often referred to by their sizes. The size of a matrix is given in the form of a dimension just as a room might be referred to as “a ten by twelve room”. The dimensions of a matrix are given by its rows and columns rather than its length and width.

For instance, in the above example as matrix A has two rows and two columns, the order matrix A is 2 X 2 (Read as “two-by-two”) and it has 4 elements.

Similarly, matrix B has 3 rows and 4 columns, so its order is 3 X 4 (Read as three-by-four) and it has 12 elements.

A matrix having m rows and n columns is called a matrix of order m X n (Read “m-by-n matrix”). In general an m X n matrix has the form

NOTE: “Row” and “Column” are technical terms and are not interchangeable. Order of a matrix is always given by number of rows first followed by the number of columns.

4 25 7A

9 2 1 41 3 5 3

8 7 2 6B

11 12 1

21 22 2

1 2

...

...... ... ... ...

...

n

n

m m mn

a a aa a aA

a a a

Page 7: WEEK 8 SYSTEMS OF EQUATIONS MATRIX SOLUTIONS TO LINEAR SYSTEMS

1. MATRICES(Cont…)Elements of a matrix: In order to locate the position of a particular element of a matrix, we have to specify the number of the row and that of the column in which the element occurs.

An element occurring in the i th row and the j th column of a matrix A will be called the (i, j)th element of A, to be denoted by aij.

Example: Consider the matrix Clearly, the element in the first row and second column is –2. So, we write a12 = -2

Similarly, a11 = 3; a12 = -2; a13 = 5; a21 = 6; a22 = 9 and a23 = 1.Types of Matrices:

Row matrix: A matrix having only one row is known as a row matrix.Example: (i) A = [5 8] is a row matrix of order 1 X 2.

(ii) B = [1 9 2 5] is a row matrix of order 1 X 4. Column matrix: A matrix having only one column is known as a column matrix.

Example: (i) is a column matrix of order 2 X 1.

(ii) is a column matrix of order 3 X 1.

Square matrix: A matrix having the same number of rows and columns is called a square matrix.

A matrix of order n X n is called a square matrix of order n or an n-rowed square matrix.Example: Matrix is a square matrix of order 2.

3 2 56 9 1A

64A 52

9B

2 51 8

Page 8: WEEK 8 SYSTEMS OF EQUATIONS MATRIX SOLUTIONS TO LINEAR SYSTEMS

2. SOLVING LINEAR SYSTEMS BY USING MATRICES

A system of linear equations in two equations and two variables can be easily solved using addition or substitution methods, our focus will be on finding matrix solutions to system of linear equations in three or more variables.Converting Systems of Linear Equations to Matrices

Each equation in the system becomes a row. Each variable in the system becomes a column. The variables are dropped and the coefficients are placed into a matrix. If the right hand side of the equation is included, it is called an augmented matrix. If the right hand side is not included, it is called a coefficient matrix.

An augmented matrix has a vertical bar separating the columns of the matrix into groups. The coefficients of each variable are placed to the left of the vertical line, and the constants are placed to the right of the vertical bar.

Example: System of linear equations Coefficient Matrix Augmented Matrix

x + 2y - 3z = 15 3x - y = 6 4x + y + 2z = 4

Each row of the augmented matrix represents one equation of the system. In each row, the coefficient of x is in the first column, the coefficient of y is in the second column, the coefficient of z is in the third column, and the constant is in the fourth column.Notice that if there is a missing term, as the “z" term in the second equation, a zero represents its coefficient in the augmented matrix.

1 2 3 15

3 1 0 6

4 1 2 4

1 2 33 1 04 1 2

Page 9: WEEK 8 SYSTEMS OF EQUATIONS MATRIX SOLUTIONS TO LINEAR SYSTEMS

In the previous example we went from a linear system to augmented matrix, now we will find the solution set for a system of equations represented by matrix

The system represented by the given matrix is x – y + z = 8

0x + y – 12z = -15 0x + 0y + z = 1 This system can be simplified as x – y + z = 8 (1) y – 12z = -15 (2) z = 1 (3)

Now the value of z is known from equation 3. We substitute this value in equation 2 to find the value of y. y – 12z = -15 (Equation 2) y – 12(1) = -15 (Substitute the value of z ) y – 12 = -15 (Simplify) y = -3

2. SOLVING LINEAR SYSTEMS BY USING MATRICES(Cont…)

1 1 1 8

0 1 12 15

0 0 1 1

Page 10: WEEK 8 SYSTEMS OF EQUATIONS MATRIX SOLUTIONS TO LINEAR SYSTEMS

Now we have the values of y and z and we can find the value of x by substituting these values in equation 1.

x – y + z = 8 (Equation 1) x – (-3) + 1 = 8 (Substitute the values of y and z) x + 4 = 8 x = 4 Thus, the solution set for the system is {(1, -3, 4)}.

We were able to solve the given system quickly as the system was “triangular”, this refers to the equations having the form of a triangle, because of the lower equations containing only the later variables.

x – y + z = 8 y – 12z = -15 z = 1

Our aim in solving a system of linear equations in three variables using matrices is to reduce the given matrix similar to the one in the above example. Thus, to solve a given system of linear equations using matrices, we need to reduce any given matrix to the general form,

known as matrix in row-echelon form, where a through f represent real numbers. Not all augmented matrices are in the row-echelon form . In such cases the available augmented matrix has to be first converted to the row-echelon form and to produce a matrix in row-echelon form we perform certain row operations on the augmented matrix.

2. SOLVING LINEAR SYSTEMS BY USING MATRICES(Cont…)

1

0 1

0 0 1

a b c

d e

f

1 1 1 8

0 1 12 15

0 0 1 1

This augmented matrix is in row-echelon form

Page 11: WEEK 8 SYSTEMS OF EQUATIONS MATRIX SOLUTIONS TO LINEAR SYSTEMS

3. MATRIX ROW OPERATIONSRow Operations are operations that can be performed on a matrix that will produce a row-equivalent matrix. If the matrix is an augmented matrix, constructed from a system of linear equations, then the row-equivalent matrix will have the same solution set as the original matrix. For any augmented matrix of a system of linear equations, the following row transformations will result in the matrix of an equivalent system:

1. Any two rows may be interchanged.

Example: Given matrix

We interchange row one (R1)and row two(R2). Symbolically represented as .This results in the row equivalent matrix

This was row 2; now it is row 1. This was row 1; Now it is row 2.

2. The elements of any row may be multiplied by the same non-zero number.We cam multiply each element in a particular row by a non-zero number. Notation means multiply each element of row 3 by ½. This results in a row equivalent matrix

=

1 2R R

1 3 2 0

3 1 1 7

2 2 4 8

3 1 1 7

1 3 2 0

2 2 4 8

3 3

1

2R R

1 3 2 0

3 1 1 7

1 1 2 4

1 1 1 1

2 2 2

1 3 2 0

3 1 1 7

2 2 4 82

Page 12: WEEK 8 SYSTEMS OF EQUATIONS MATRIX SOLUTIONS TO LINEAR SYSTEMS

3. MATRIX ROW OPERATIONS(Cont…)

3. The elements in any row may be multiplied by a non-zero number, and these products maybe added to corresponding elements in any row. Notation means first multiply each element of row 1 by –3 and then add it to the corresponding elements of row 2. We replace the elements of row 2 by these new elements.

Note: Elements of row 1 remain unchanged. It is elements in row 2 that change. We copy the rest of the entries in the matrix as they are.

When a sequence of elementary row operations is performed on an augmented matrix, the linear system that corresponds to the resulting augmented matrix is equivalent to the original system. That is, the resulting system has the same solution set as the original system. Our strategy in solving linear systems, therefore, is to take an augmented matrix for a system and carry it by means of elementary row operations to an equivalent augmented matrix from which the solutions of the system are easily obtained.

NOTE: While performing row transformations we have to include the row we are performing the row-operation on. For instance we cannot perform an operation like

2 1 23R R R

1 3 2 0 1 3 2 0

3 1 ( 1) 7 0 10 7 7

2 2 4 8

3(1) 3( 3) 3(2) 3(0)

2 2 4 8

3 22R R

Page 13: WEEK 8 SYSTEMS OF EQUATIONS MATRIX SOLUTIONS TO LINEAR SYSTEMS

4. GAUSSIAN ELIMINATION METHODThe process used to solve systems of linear equations using matrix row operations is called Gaussian Elimination, after the German mathematician Carl Friedrich Gauss.The steps used in Gaussian Elimination Method are as follows:STEP 1: Write a system of linear equations as an augmented matrix. STEP 2: Perform the elementary row operations to put the matrix into row-echelon form. STEP 3: Convert the matrix back into a system of linear equations. STEP 4: Use back substitution to obtain all the answers.

Let us understand this process with the help of an example:Consider the system of equations 2x + y + 2z = 18 (1)

x – y + 2z = 9 (2) x + 2y – z = 6 (3)

STEP 1: Write a system of linear equations as an augmented matrix.System of equations Augmented Matrix

2x + y + 2z = 18 x – y + 2z = 9

x + 2y – z = 6

2 1 2 18

1 1 2 9

1 2 1 6

A

Page 14: WEEK 8 SYSTEMS OF EQUATIONS MATRIX SOLUTIONS TO LINEAR SYSTEMS

4. GAUSSIAN ELIMINATION METHOD(Cont…)

STEP 2: Perform the elementary row operations to put the matrix into row-echelon form.

Our aim is to reduce the augmented matrix to the row-echelon form

We need to get 1 at the position a11.

We want 1 at this position.

For this we interchange row 1 and row 2. that is perform the row operation This was row 2; now it is row 1.

This was row 1; now it is row 2.

(We could also interchange row 1 and row 3)

1

0 1

0 0 1

a b c

d e

f

1 2R R

1 2 18

1 1 2 9

1 2 1 6

2

1 1 2 9

2 1 2 18

1 2 1 6

Page 15: WEEK 8 SYSTEMS OF EQUATIONS MATRIX SOLUTIONS TO LINEAR SYSTEMS

4. GAUSSIAN ELIMINATION METHOD(Cont…)

Next we want a 0 at the position a21.

We want 0 at this position.

For this we perform the row operation , that is multiply each element of row 1 by –2 and add the product to corresponding elements of row 2.

Now we want a ‘0’ in a32 .

We want ‘0’ in this position

1 1 2 9

1 2 18

1 2 6

2

1

2 1 22R R R

1 1 2 9

0 3 2 0

2 11 6

1 1 2 9 1 1 2 9

1 2 18

1 2 1

2(1) 2 2( 1) 2(2) 2(9) 0

6 1 2 1

3 2 0

6

Page 16: WEEK 8 SYSTEMS OF EQUATIONS MATRIX SOLUTIONS TO LINEAR SYSTEMS

4. GAUSSIAN ELIMINATION METHOD(Cont…)

For this we perform the row operation , that is, multiply each element of row 1 by –1 and add the product to the corresponding elements of row 3.

Next, we want 1 at a22.

To obtain a 1 in second row second column, we multiply each element of row 2 by 1/3, that is perform row operation

3 1 3( 1)R R R

1 1 2 9

0 2 0

0 3 3 3

3

2 2

1

3R R

1(1) 1( 1) 1(2) ( 1)9

1 1 2 9 1 1 2 9

0 3 2 0 0

0

3 2 0

1 2 ) 3( 1 3 36

1 1 2 9 1 1 2 9

(0) (3) ( 2) (0)

0 3

1 1 1 1 20 1 0

3 3 3 3 33 3 0 3 3 3

Page 17: WEEK 8 SYSTEMS OF EQUATIONS MATRIX SOLUTIONS TO LINEAR SYSTEMS

4. GAUSSIAN ELIMINATION METHOD(Cont…)

Now we want ‘0’ at the position a32.

We want ‘0’ in this position.

We multiply the second row by –3 and add the product to corresponding elements of row 3, that is, we perform the row operation,

1 1 2 9

20 1 0

30 3 33

2 0 0 1 33(0) 3(1)

1 1

3( ) 3(0)3

2 9 1 1 2 9

2 20 1 0 0 1 0

3 3

0 3 3 ( 3)

3 2 33R R R

Page 18: WEEK 8 SYSTEMS OF EQUATIONS MATRIX SOLUTIONS TO LINEAR SYSTEMS

4. GAUSSIAN ELIMINATION METHOD(Cont…)

Lastly, we want ‘1’ in the position a33.

We want ‘1’ at this position.

We multiply each element of row 3 by by –1, that is perform the row operation .

3 3( 1)R R

1

1 1 2 9

20 1 0

30 0 3

This is the matrix in row-echelon form.

( 1) ( 1) ( 1) ( 1) 0

1 1 2 9 1 1 2 9

2 20 1 0 0 1 0

3 30 0 1 ( 3) 0 1 3

Page 19: WEEK 8 SYSTEMS OF EQUATIONS MATRIX SOLUTIONS TO LINEAR SYSTEMS

4. GAUSSIAN ELIMINATION METHOD(Cont…)

STEP 3: Convert the matrix back into a system of linear equations.The system represented by the matrix is x – y + 2z = 9 (4)

y – (2/3)z = 0 (5) z = 3 (6) STEP 4: Use back substitution to obtain all the answers.

From equation 6, we have z = 3We use this value of z to find the value of y from equation 5.

y – (2/3)z = 0 (Equation 5) y – (2/3)(3) = 0 (Substitute z = 3 ) y – 2 = 0 (Simplify) y = 2

Next we substitute the values of y and z in equation 4 to find the value of x. x – y + 2z = 9 (Equation 4)

x – 2 + 2(3) = 9 (Substitute y = 2 and z = 3) x – 2 + 6 = 9 (Simplify) x = 5

Thus, the solution set for the original system is {(5, 2, 3)}.We can check this solution by substituting the values in the original system of equations.

Page 20: WEEK 8 SYSTEMS OF EQUATIONS MATRIX SOLUTIONS TO LINEAR SYSTEMS

5. GAUSS-JORDAN ELIMINATIONThere is another method of solving a system of linear equations using matrices called the Gauss-Jordan elimination method, after Carl Friedrich Gauss and Wilhelm Jordan.

This method is actually an extension of the Gaussian-elimination method. In Gaussian –elimination method we reduce the given augmented matrix using row operations to row-echelon form. In Gauss-Jordan elimination method we reduce the matrix obtained in row-echelon form further using row-operations to a reduced row-echelon form

where a, b, and c are real numbers.

Converting the above matrix back to the system of linear equations, we have

x = a; y = b; z = c.

Steps used in Gauss-Jordan elimination method are as follows: STEP 1: Write a system of linear equations as an augmented matrix. STEP 2: Perform the elementary row operations to put the matrix into reduced row-

echelon form. STEP 3: Convert the matrix back into a system of linear equations to get the solution

of the system of equations. No back substitution is necessary

1 0 0

0 1 0

0 0 1

a

b

c

Page 21: WEEK 8 SYSTEMS OF EQUATIONS MATRIX SOLUTIONS TO LINEAR SYSTEMS

5. GAUSS-JORDAN ELIMINATION(Cont…)

Let us understand these steps with help of the previous example:

Given system of equations 2x + y + 2z = 18 (1)

x – y + 2z = 9 (2)

x + 2y – z = 6 (3)

Augmented Matrix :

We have already reduced the augmented matrix to row-echelon form, so step 1 and some part of step 2 is already done for us. Now let us obtain the reduced row-echelon matrix from the row-echelon form by using row-operations:

(Matrix in row-echelon form)

2 1 2 18

1 1 2 9

1 2 1 6

1 9

0 1 0

0 0 1

2

33

1 2

We want ‘0’ in these positions.

Page 22: WEEK 8 SYSTEMS OF EQUATIONS MATRIX SOLUTIONS TO LINEAR SYSTEMS

5. GAUSS-JORDAN ELIMINATION(Cont…)

We need to reduce the element in second row, third column to zero, for this we perform the row-operation that is multiply each element of third row by (2/3)

and add the products to corresponding elements of row 2, to get the row-equivalent matrix

Next we make the element in the first row, second column to be zero. For this we perform that row-operation and get the row-equivalent matrix

2 3 2

2

3R R R

1 3 12R R R

( 1) 2 9

0 1 0 2 0 1 0 2

0 0

2(0) 1 2(0) 2(1

1

) 2(3) 1

3 0 0 1

1 0 3

3

1 1 2 91 1 2 9

20 1 0

30 0 1 3

0

2 2 2 2(0) (0) (1) (3

0 1 3

) 0 1 0 23 3 3 3

Page 23: WEEK 8 SYSTEMS OF EQUATIONS MATRIX SOLUTIONS TO LINEAR SYSTEMS

5. GAUSS-JORDAN ELIMINATION(Cont…)

Now we need to reduce the element in the second row, second column to zero to get the required matrix in reduced row-echelon form.For this, we perform the row transformation and get the row-equivalent matrix

STEP 3: Convert the matrix back into a system of linear equations to get the solution of the system of equations. The system represented by the last matrix is, x = 5

y = 2 z = 3

Thus, the solution set for original system of equations is {(5, 2, 3)}.NOTE: 1. We can use either of the two methods – Gaussian –elimination or Gauss-Jordan

elimination to get a solution of system of linear equations using matrices and as we notice from the above solution set, we get the same solution using both the methods.

2. While performing row-operation our aim is to reduce the augmented matrix to the row-echelon form (in case of Gaussian elimination method and reduced row-echelon in case of Gauss-Jordan elimination method). We can perform the row-operations in any sequence, work in different order or simplify different rows and still come up with the right answer. As long as each step along the way is correct we will come up with the same answer.

1 2 1R R R

This is the required matrix in

reduced row-echelon form

1 ( 1) 0

0 1 0 2 0 1 0 2

0 0 1 3 0 0

0 1 0 2

1 3

3 1 0 0 5

Page 24: WEEK 8 SYSTEMS OF EQUATIONS MATRIX SOLUTIONS TO LINEAR SYSTEMS

6. SUMMARYLet us recall what we have learnt so far:

A Matrix (plural: Matrices) is an ordered rectangular array/arrangement of numbers arranged in rows and columns and enclosed in brackets. Each number in the matrix is called an element or an entry of the matrix.

Order of a matrix: Matrices are often referred to by their sizes. The dimensions of a matrix are given by its rows and columns.

Types of Matrices:

Row matrix: A matrix having only one row is known as a row matrix.

Column matrix: A matrix having only one column is known as a column matrix.

Square matrix: A matrix having the same number of rows and columns is called a square matrix.

Converting Systems of Linear Equations to Matrices

Each equation in the system becomes a row. Each variable in the system becomes a column. The variables are dropped and the coefficients are placed into a matrix. If the right hand side of the equation is included, it is called an augmented matrix. If the right hand side is not included, it is called a coefficient matrix.

Page 25: WEEK 8 SYSTEMS OF EQUATIONS MATRIX SOLUTIONS TO LINEAR SYSTEMS

6. SUMMARY(Cont…)To solve a given system of linear equations using matrices, we need to reduce any given matrix to the general form,

known as matrix in row-echelon form, where a through f represent real numbers. Matrix row-operations:

1. Any two rows may be interchanged.2. The elements of any row may be multiplied by the same non-zero number.3. The elements in any row may be multiplied by a non-zero number, and these

products maybe added to corresponding elements in any row.We can solve the system of linear equations using matrices by tow methods – Gaussian elimination method and Gauss-Jordan method.

1

0 1

0 0 1

a b c

d e

f