SOLVING LINEAR SYSTEMS USING GAUSSIAN ELIMINATION

Một phần của tài liệu Elementary linear algebra, fourth edition (Trang 110 - 127)

REVIEW EXERCISES FOR CHAPTER 1

2.1 SOLVING LINEAR SYSTEMS USING GAUSSIAN ELIMINATION

In this section, we introduce systems of linear equations and the Gaussian elimination method for solving such systems.

Elementary Linear Algebra

Copyright © 2010 by Elsevier, Inc. All rights reserved. 79

Systems of Linear Equations

A linear equation is an equation involving one or more variables in which only the operations of multiplication by real numbers and summing of terms are allowed.

For example, 6x3y4 and 8x13x24x3 20 are linear equations in two and three variables, respectively.

When several linear equations involving the same variables are considered together, we have asystem of linear equations. For example, the following system has four equations and three variables:

⎧⎪

⎪⎨

⎪⎪

3x1 2x2 5x3 4 2x1 4x2 x3 2 6x1 4x2 10x3 8 4x1 8x2 9x3 6 .

We often need to find the solutions to a given system. The ordered triple, or 3-tuple, (x1,x2,x3)(4,1, 2)is a solution to the preceding system because each equation in the system is satisfied for these values ofx1,x2, andx3. Notice that

32,34,2 is another solution for that same system. These two particular solutions are part of the complete set of all solutions for that system.

We now formally define linear systems and their solutions.

Definition Asystem ofm(simultaneous)linear equationsinnvariables

⎧⎪

⎪⎪

⎪⎪

⎪⎩

a11x1 a12x2 a13x3ãããa1nxn b1 a21x1 a22x2 a23x3ãããa2nxn b2 ... ... ... . .. ... ... am1x1am2x2am3x3ãããamnxnbm

is a collection ofmequations, each containing a linear combination of the same n variables summing to a scalar. A particular solution to a system of linear equations in the variablesx1,x2,...,xn is an n-tuple (s1,s2,...,sn)that satisfies each equation in the system whens1 is substituted for x1,s2 forx2, and so on.

The(complete) solution setfor a system of linear equations innvariables is the collection of alln-tuples that form solutions to the system.

In this definition, the coefficients ofx1,x2,...,xncan be collected together in an mncoefficient matrix

A

⎢⎢

⎢⎣

a11 a12 ããã a1n

a21 a22 ããã a2n

... ... . .. ... am1 am2 ããã amn

⎥⎥

⎥⎦.

If we also let

X

⎢⎢

⎢⎣ x1

x2

... xn

⎥⎥

⎥⎦ and B

⎢⎢

⎢⎣ b1

b2

... bm

⎥⎥

⎥⎦,

then the linear system is equivalent to the matrix equationAXB(verify!).

An alternate way to express this system is to form theaugmented matrix

[A|B]

⎢⎢

⎢⎣

a11 a12 ããã a1n

a21 a22 ããã a2n ... ... . .. ... am1 am2 ããã amn

b1

b2 ... bm

⎥⎥

⎥⎦.

Each row of [A|B] represents one equation in the original system, and each col- umn to the left of the vertical bar represents one of the variables in the system.

Hence, this augmented matrix contains all the vital information from the original system.

Example 1

Consider the linear system

1

4w2xy3z 5 3w x 5z12. Letting

A +

4 2 1 3

3 1 0 5

, , X

⎢⎢

⎢⎣ w

x y z

⎥⎥

⎥⎦, and B +

5 12 ,

,

we see that the system is equivalent toAXB, or, +

4 2 1 3

3 1 0 5

,⎡

⎢⎢

⎢⎣ w

x y z

⎥⎥

⎥⎦ +

4w2xy3z 3wx5z

,

+ 5 12 ,

.

This system can also be represented by the augmented matrix

[A|B]

+

4 2 1 3

3 1 0 5

5 12 ,

.

Number of Solutions to a System

There are only three possibilities for the size of the solution set of a linear system:

a single solution, an infinite number of solutions, or no solutions. There are no other possibilities because if at least two solutions exist,we can show that an infinite number of solutions must exist (see Exercise 10). For instance,in a system of two equations and two variables — say,xandy— the solution set for each equation forms a line in the xy-plane. The solution to the system is the intersection of the lines corresponding to each equation. But any two given lines in the plane either intersect in exactly one point (unique solution), are equal (infinite number of solutions, all points on the common line), or are parallel (no solutions).

For example, the system

14x13x2 0 2x13x218

(wherex1andx2are used instead ofxandy) has the unique solution(3, 4)because that is the only intersection point of the two lines. On the other hand, the system

14x6y10 6x9y15

has an infinite number of solutions because the two given lines are really the same, and so every point on one line is also on the other. Finally, the system

12x1x23 2x1x21

has no solutions at all because the two lines are parallel but not equal. (Both of their slopes are2.)The solution set for this system is the empty set{}∅.All three systems are pictured in Figure 2.1.

Any system that has at least one solution (either unique or infinitely many) is said to beconsistent. A system whose solution set is empty is calledinconsistent. The first two systems in Figure 2.1 are consistent, and the last one is inconsistent.

Gaussian Elimination

Many methods are available for finding the complete solution set for a given lin- ear system. The first one we present,Gaussian elimination, involves systematically replacing most of the coefficients in the system with simpler numbers (1’s and 0’s) to make the solution apparent.

In Gaussian elimination, we begin with the augmented matrix for the given system, and then examine each column in turn from left to right. In each column, if possible, we choose a special entry, called apivot entry, convert that pivot entry to “1,” and

(0, 6)

(3, 4)

(0, 0)

(0, 3) (0, 1) Unique solution

x1 x2

(9, 0) (1,21)

( , 0)

4x123x250

2x113x2518 4x123x250

2x113x2518

4x26y510 6x29y515

4x26y510

No solution

x1 x2

2x11x253 2x11x251

2x11x253 2x11x251

Infinite number of solutions x y

5 2

(32, 0) (12, 0)

(0,253)

FIGURE 2.1

Three systems: unique solution, infinite number of solutions, no solution

then perform further operations to zero out the entries below the pivot. The pivots will be “staggered” so that as we proceed from column to column, each new pivot occurs in a lower row.

Row Operations and Their Notation

There are three operations that we are allowed to use on the augmented matrix in the Gaussian elimination method. These are as follows:

Row Operations

(I) Multiplying a row by anonzeroscalar

(II) Adding a scalar multiple of one row to another row (III) Switching the positions of two rows in the matrix

To save space, we will use a shorthand notation for these row operations. For example, a row operation of type (I) in which each entry of row 3 is multiplied by 12 times that entry is represented by (I):3 ← 123. That is, each entry of row 3 is multiplied by 12, and the result replaces the previous row 3. A type (II) row operation in which(3) (row 4)is added to row 2 is represented by (II):2 ← 342. That is, a multiple (3, in this case) of one row (in this case, row 4) is added to row 2, and the result replaces the previous row 2. Finally, a type (III) row operation in which the second and third rows are exchanged is represented by (III):

2 ↔ 3. (Note that a double arrow is used for type (III) operations.)

We now illustrate the use of the first two operations with the following example:

Example 2

Let us solve the following system of linear equations:

⎧⎪

⎪⎩

5x5y15z40 4x2y 6z19 3x6y17z41 .

The augmented matrix associated with this system is

⎢⎣

5 5 15

4 2 6

3 6 17

40 19 41

⎥⎦.

We now perform row operations on this matrix to give it a simpler form, proceeding through the columns from left to right. Starting with the first column, we choose the(1, 1)position as our first pivot entry. We want to place a 1 in this position. The row containing the current pivot is often referred to as thepivot row, and so row 1 is currently our pivot row. Now, when placing 1 in the matrix, we generally use a type (I) operation to multiply the pivot row by the reciprocal of the pivot entry. In this case, we multiply each entry of the first row by 15.

type (I) operation:1 ←1 51

⎢⎣

1 1 3

4 2 6

3 6 17

8 19 41

⎥⎦.

For reference, we circle all pivot entries as we proceed.

Next we want to convert all entries below this pivot to 0. We will refer to this as “targeting”

these entries. As each entry is changed to 0, it is called thetarget, and its row is called thetarget row. To change a target entry to 0, we always use the following type (II) row operation:

(II):target row ←(target value)pivot rowtarget row.

For example, to zero out (target) the(2, 1)entry, we use the type (II) operation2 ←(4) 12. (That is, we add(4)times the pivot row to the target row.) To perform this operation, we first do the following side calculation:

(4)(row1) 4 4 12 32

(row2) 4 2 6 19

(sum) 0 2 6 13

The resulting sum is now substituted in place of the old row2, producing type (II) operation:2 ←(4)12

⎢⎣

1 1 3

0 2 6

3 6 17

8 13 41

⎥⎦.

Note that even though we multiplied row 1 by4in the side calculation, row 1 itself was not changed in the matrix. Only row 2, the target row, was altered by this type (II) row operation.

Similarly, to target the(1, 3)position (that is, convert the(1, 3)entry to 0), row 3 becomes the target row, and we use another type (II) row operation. We replace row 3 with(3) (row 1)(row 3). This gives

type (II) operation:3 ←(3)13

Side Calculation Resulting Matrix

(3)(row1) 3 3 9 24

(row3) 3 6 17 41

(sum) 0 3 8 17

⎢⎣

1 1 3

0 2 6

0 3 8

8 13 17

⎥⎦

Now, the last matrix is associated with the linear system

⎧⎪

⎪⎩

x y3z 8 2y6z 13 3y8z 17 .

Note thatxhas been eliminated from the second and third equations, which makes this system simpler than the original. However, as we will prove later, this new system has the same solu- tion set.

Our work on the first column is finished, and we proceed to the second column. The pivot entry for this column must be in a lower row than the previous pivot, so we choose the(2, 2) position as our next pivot entry. Thus, row 2 is now the pivot row. We first perform a type (I) operation on the pivot row to convert the pivot entry to 1. Multiplying each entry of row 2 by 12 (the reciprocal of the pivot entry), we obtain

type (I) operation:2 ←1 22

Resulting matrix

⎢⎣

1 1 3

0 1 3

0 3 8

8 132 17

⎥⎦.

We now use a type (II) operation to target the(3, 2)entry. The target row is now row3.

type (II) operation: 3 ←323

Side Calculation Resulting Matrix

(3)(row2) 0 3 9 392

(row3) 0 3 8 17

(sum) 0 0 1 52

⎢⎣

1 1 3

0 1 3

0 0 1

8 132

52

⎥⎦

The last matrix corresponds to

⎧⎪

⎪⎨

⎪⎪

xy3z 8 y3z 132 z 52 .

Notice thatyhas been eliminated from the third equation. Again, this new system has exactly the same solution set as the original system.

At this point, we know from the third equation thatz 52. Substituting this result into the second equation and solving fory, we obtainy3

52 13

2, and hence,y1. Finally, substituting these values foryandzinto the first equation, we obtainx13

52

8, and hencex32. This process of working backward through the set of equations to solve for each variable in turn is calledback substitution.

Thus, the final system has a unique solution — the ordered triple3 2, 1,52

. However, you can check by substitution that3

2, 1,52

is also a solution to the original system. In fact, Gaussian elimination always produces the complete solution set, and so3

2, 1,52

is the unique solution to the original linear system.

The Strategy in the Simplest Case

In Gaussian elimination, we work on one column of the augmented matrix at a time.

Beginning with the first column, we choose row 1 as our initial pivot row, convert the (1, 1)pivot entry to 1, and target (zero out) the entries below that pivot. After each column is simplified, we proceed to the next column to the right. In each column, if possible, we choose a pivot entrythat is in the next row lower than the previous pivot, and this entry is converted to 1. The row containing the current pivot is referred to as thepivot row. The entries below each pivot are targeted (converted to 0) before proceeding to the next column. The process advances to additional columns until we reach the augmentation bar or run out of rows to use as the pivot row.

We generally convert pivot entries to 1 by multiplying the pivot row by the reciprocal of the current pivot entry. Then we use type (II) operations of the form

target row ←(target value)pivot rowtarget row

to target (zero out) each entry below the pivot entry. This eliminates the variable corresponding to that column from each equation in the system below the pivot row.

Note that in type (II) operations, we add an appropriate multiple of thepivot row to the target row. (Any other type (II) operation could destroy work done in previous columns.)

Using Type ( III ) Operations

So far, we have used only type (I) and type (II) operations. However, when we begin work on a new column, if the logical choice for a pivot entry in that column is 0, it is impossible to convert the pivot to 1 using a type (I) operation. Frequently, this dilemma can be resolved by first using a type (III) operation to switch the pivot row with another row below it. (We never switch the pivot row with a row above it, because such a type (III) operation could destroy work done in previous columns.)

Example 3

Let us solve the following system using Gaussian elimination:

⎧⎪

⎪⎩

3x y 5

6x2y 10 4x5y 8

, with augmented matrix

⎢⎣

3 1

6 2

4 5

5 10 8

⎥⎦.

We start with the first column, and establish row 1 as the pivot row. We convert the pivot entry in the(1, 1)position to 1 by multiplying the pivot row by the reciprocal of the pivot entry.

type (I) operation:1 ←1 31 Resulting matrix

⎢⎣

1 13 6 2

4 5

53 10 8

⎥⎦

Next, we use type (II) operations to target the rest of the first column by adding appropriate multiples of the pivot row (the first row) to the target rows.

type (II) operation:2 ←612 type (II) operation:3 ←(4)13

Resulting matrix

⎢⎣ 1 13

0 0

0 113

53 0 44 3

⎥⎦

We now advance to the second column, and designate row2as the pivot row. We want to convert the pivot entry(2, 2)to 1, but because the pivot is0, a type (I) operation will not work. Instead, we first perform a type (III) operation, switching the pivot row with the row below it, in order to change the pivot to a nonzero number.

type (III) operation:2 ↔ 3

Resulting matrix

⎢⎢

⎣ 1 13 0 113

0 0

53 44

3 0

⎥⎥

Now, using a type (I) operation, we can convert the(2, 2)pivot entry to 1.

type (I) operation: 2 ← 3 112

Resulting matrix

⎢⎢

⎣ 1 13

0 1

0 0

53 4 0

⎥⎥

Since the entry below the current pivot is already0, the second column is now simplified. Because there are no more columns to the left of the augmentation bar, we stop. The final matrix corres- ponds to the following system:

⎧⎪

⎪⎩

x13y 53 y 4 0 0 .

The third equation is always satisfied, no matter what valuesx andy have, and provides us with no information. The second equation givesy4. Back substituting into the first equation, we obtainx13(4) 53, and sox 3. Thus, the unique solution for our original system is (3, 4).

The general rule for using type (III) operations is

When starting a new column, if the pivot entry is0, look for a nonzero number in the current columnbelow the pivot row. If you find one, use a type (III) operation to switch the pivot row with the row containing this nonzero number.

Skipping a Column

Occasionally when we progress to a new column, the pivot entry as well as all lower entries in that column are zero. Here, a type (III) operation cannot help. In such cases, we skip over the current column and advance to the next column to the right. Hence, the new pivot entry is located horizontally to the right from where we would nor- mally expect it. We illustrate the use of this rule in the next few examples. Example 4

involves an inconsistent system, and Examples 5, 6, and 7 involve infinitely many solutions.

Inconsistent Systems

Example 4

Let us solve the following system using Gaussian elimination:

⎧⎪

⎪⎩

3x16x2 3x4 9 2x14x22x3 x4 11 4x18x26x37x4 5 .

First, we set up the augmented matrix

⎢⎣

3 6 0 3

2 4 2 1

4 8 6 7

9 11 5

⎥⎦.

We begin with the first column and establish row 1 as the pivot row. We use a type (I) operation to convert the current pivot entry, the(1, 1)entry, to 1.

(I):1 ←1 31 Resulting matrix

⎢⎣

1 2 0 1

2 4 2 1

4 8 6 7

3 11 5

⎥⎦

Next, we target the entries below the pivot using type (II) row operations.

(II):2 ←212 (II): 3 ←413

Resulting matrix

⎢⎣

1 2 0 1

0 0 2 1

0 0 6 3

3 5 17

⎥⎦

We are finished with the first column, so we advance to the second column. The pivot row now advances to row 2, and so the pivot is now the (2,2) entry, which unfortunately is 0. We search for a nonzero entry below the pivot but do not find one. Hence, we skip over this column and advance horizontally to the third column, still maintaining row 2 as the pivot row.

We now change the current pivot entry (the(2, 3)entry) into 1.

(I):2 ←1 22 Resulting matrix

⎢⎣

1 2 0 1

0 0 1 12

0 0 6 3

3 52 17

⎥⎦

Targeting the entry below this pivot, we obtain

(II):3 ←623

Resulting matrix

⎢⎣

1 2 0 1

0 0 1 12

0 0 0 0

3 52 2

⎥⎦

We proceed to the fourth column, and the pivot row advances to row 3. However, the pivot entry, the(3, 4)entry, is also0. Since there is no row below the pivot row(row 3)to switch with, the fourth column is finished. We attempt to move the pivot horizontally to the right, but we have reached the augmentation bar, so we stop. The resulting system is

⎧⎪

⎪⎪

⎪⎪

⎪⎩

x12x2 x4 3 x312x4 52

0 2

.

Regardless of the values of x1,x2,x3, andx4, the last equation,0 2, isnever satisfied.

This equation has no solutions. But any solution to the system must satisfy every equation in the system. Therefore, this system is inconsistent, as is the original system with which we started.

For inconsistent systems, the final augmented matrix always contains at least one row of the form

0 0 ããã 0c ,

with all zeroes on the left of the augmentation bar and a nonzero numberc on the right. Such a row corresponds to the equation 0c, for somec0, which certainly has no solutions. In fact, if you encounter such a row at anystage of the Gaussian elimination process, the original system is inconsistent.

Beware! An entire row of zeroes, with zero on the right of the augmentation bar, does not imply the system is inconsistent. Such a row is simply ignored, as in Example 3.

Infinite Solution Sets

Example 5

Let us solve the following system using Gaussian elimination:

⎧⎪

⎪⎪

⎪⎨

⎪⎪

⎪⎪

3x1 x2 7x32x4 13 2x1 4x214x3 x4 10 5x111x2 7x38x4 59 2x1 5x2 4x33x4 39 .

The augmented matrix for this system is

⎢⎢

⎢⎣

3 1 7 2

2 4 14 1

5 11 7 8

2 5 4 3

13 10 59 39

⎥⎥

⎥⎦.

After simplifying the first two columns as in earlier examples, we obtain

⎢⎢

⎢⎢

⎢⎣

1 13 73 23

0 1 2 12

0 0 0 0

0 0 0 132

13 3

4 0 13

⎥⎥

⎥⎥

⎥⎦ .

There is no nonzero pivot in the third column, so we advance to the fourth column and use row operation (III):3 ↔ 4to put a nonzero number into the(3, 4)pivot position, obtaining

⎢⎢

⎢⎢

⎢⎣

1 13 73 23

0 1 2 12

0 0 0 132

0 0 0 0

13 3

4 13 0

⎥⎥

⎥⎥

⎥⎦ .

Converting the pivot entry in the fourth column to 1 leads to the final augmented matrix

⎢⎢

⎢⎢

1 13 73 23

0 1 2 12

0 0 0 1

0 0 0 0

13 3

4 2 0

⎥⎥

⎥⎥

⎦.

This matrix corresponds to

⎧⎪

⎪⎪

⎪⎨

⎪⎪

⎪⎪

x113x273x323x4 133 x2 2x312x4 4 x4 2 0 0 .

We discard the last equation, which gives no information about the solution set. The third equation givesx4 2, but values for the other three variables are not uniquely determined — there are infinitely many solutions. We can letx3 take on any value whatsoever, which then determines the values forx1andx2. For example, if we letx35, then back substituting into the second equation forx2yieldsx22(5)12(2)4, which givesx215. Back substituting into the first equation givesx113(15)73(5)23(2)133, which reduces tox1 11. Thus,one solution is (11, 15, 5,2). However, different solutions can be found by choosing alternate values for x3. For example, letting x3 4 gives the solution x116, x2 3, x3 4, x4 2. All such solutions satisfy the original system.

How can we express the complete solution set? Of course,x4 2. If we use a variable, sayc, to representx3, then from the second equation, we obtainx22c12(2)4, which givesx252c. Then from the first equation, we obtainx113(52c)73(c)23(2)133, which leads tox143c. Thus, the infinite solution set can be expressed as

2(43c, 52c,c,2)c∈R3 .

After Gaussian elimination, the columns having no pivot entries are often referred to asnonpivot columns, while those with pivots are calledpivot columns. Recall that the columns to the left of the augmentation bar correspond to the variables x1,x2, and so on, in the system. The variables for nonpivot columns are calledinde- pendent variables, while those for pivot columns are dependent variables. If a given system is consistent, solutions are found by letting each independent variable take on any real value whatsoever. The values of the dependent variables are then cal- culated from these choices. Thus, in Example 5, the third column is the only nonpivot column. Hence,x3is an independent variable, whilex1,x2, andx4are dependent vari- ables. We found a general solution by lettingx3take on any value, and we determined the remaining variables from that choice.

Example 6

Suppose that the final matrix after Gaussian elimination is

⎢⎢

⎢⎢

⎢⎢

1 2 0 3 5 1

0 0 1 4 23 0

0 0 0 0 0 1

0 0 0 0 0 0

1 9 16 0

⎥⎥

⎥⎥

⎥⎥

⎦ ,

which corresponds to the system

⎧⎪

⎪⎩

x12x2 3x4 5x5x6 1 x34x423x5 9 x6 16 .

Note that we have ignored the row of zeroes. Because the nonpivot columns are columns2,4, and5,x2,x4, andx5are the independent variables. Therefore, we can letx2,x4, andx5take on any real values — say, x2b,x4d, andx5e. We knowx616. We now use back substitution to solve the remaining equations in the system for the dependent variablesx1and x3, yieldingx3 94d23e,x1172b3d5e. Hence, the complete solution set is

2(172b3d5e,b,94d23e,d,e, 16)b,d,e∈R3 .

Particular solutions can be found by choosing values for b,d, ande. For example, choosing b1,d 1, ande0yields(22, 1,5,1, 0, 16).

Một phần của tài liệu Elementary linear algebra, fourth edition (Trang 110 - 127)

Tải bản đầy đủ (PDF)

(769 trang)