• No results found

1.2 Solving a System of Linear Equations

N/A
N/A
Protected

Academic year: 2021

Share "1.2 Solving a System of Linear Equations"

Copied!
13
0
0

Loading.... (view fulltext now)

Full text

(1)

1.2 Solving a System of Linear Equations

1.2.1 Simple Systems - Basic De…nitions

As noticed above, the general form of a linear system of m equations in n variables is of the form

8>

><

>>

:

a11x1+ a12x2+ ::: + a1nxn= b1 a21x1+ a22x2+ ::: + a2nxn= b2

:::

am1x1+ am2x2+ ::: + amnxn= bm

Some of the coe¢ cients aij can be zero. In fact, the more coe¢ cients are zero, the easier the system will be to solve.

The easiest system to solve is of the form 8>

>>

>>

<

>>

>>

>:

a11x1 = b1

a22x2 = b2

a33x3 = b3

... ... ... ... ... ... amnxn = bm Its corresponding augmented matrix is

2 66 66 64

a11 0 0 0 b1

0 a22 0 b2

0 0 a33 0 b3

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

0 0 0 amn bm

3 77 77 75

To solve, we simply divide by the coe¢ cient in front of each variable. This is illustrated below.

Example 20 Solve 8<

:

2x1 = 10

3x2 = 9

x3 = 3 The solution is x1=10

2 = 5, x2=9

3 = 3, x3= 3.

When all the coe¢ cients in the system above are 1, the system in the above example is said to be in reduced row-echelon form. The precise de…nition is given below.

De…nition 21 Consider a system of linear equations.

1. The system is said to be in reduced row-echelon form if it satis…es the four properties below:

(2)

(a) If a row does not consist entirely of zeros, then the …rst nonzero number is a 1. This number is called the leading 1.

(b) The rows consisting entirely of zeros, if there are any, are at the bottom of the system.

(c) If two consecutive rows contain a leading 1, then the leading 1 of the higher row is further to the left than the leading 1 of the lower row.

(d) Each column that contains a leading 1 contains 0 everywhere else.

2. The system is said to be in row-echelon form if the properties a - c are satis…ed. Thus, a system in reduced row-echelon form is necessarily in row-echelon form.

Remark 22 The same de…nitions apply to the augmented matrix of a system.

Remark 23 Since we can switch back and forth between a system of linear equations and its corresponding augmented matrix, we can either work on a system, or on its corresponding augmented matrix. We will illustrate both.

Example 24 The matrices below are in reduced row-echelon form:

1.

2

4 1 0 0 4

0 0 1 3

0 0 0 0

3 5

2.

2 66 4

0 1 2 0 2

0 0 0 1 3

0 0 0 0 0

0 0 0 0 0

3 77 5

3. 0 0 0 0

Example 25 The matrices below are in row-echelon form:

1.

2

4 1 2 3 4

0 0 1 3

0 0 0 0

3 5

2.

2 66 4

0 1 2 0 2

0 0 1 1 3

0 0 0 1 5

0 0 0 0 0

3 77 5

A system in row-echelon form is also easy to solve. We illustrate how with an example.

(3)

Example 26 Consider the system:

8<

:

x1 +2x2 x3 = 10 x2 +x3 = 5

x3 = 2 Its corresponding augmented matrix is

2

4 1 2 1 10

0 1 1 5

0 0 1 2

3 5

Such a system is also fairly easy to solve. The method used is called back- substitution. Since we know x3 = 2, we can replace x3 by its value in the second equation to obtain x2+ 2 = 5 or x2= 3. Now that we know x2 and x3, we can replace in the …rst equation to obtain x1+ 6 2 = 10 or x1 = 6. It is called back substitution because we work backward. We start by …nding the value of the last variable, then the next to the last and so on, until we …nd the value of the …rst variable. At this point, we are done.

Remark 27 In order to be able to do back-substitution, it is not necessary that aii = 1 in the ith equation.

De…nition 28 Two systems are said to be equivalent if they have the same solution set. Similarly, two augmented matrices are said to be equivalent if they are the augmented matrices of two systems having the same solution set.

You remember for elementary mathematics, to solve a given equation in one variable say x, we transform it into an equation of the form x = S where S is then the solution we are after. To transform it, we use certain transformations which do not change the solution set of the equation, in other words, we obtain equivalent equations until we have one of the form x = S. You will recall that the transformations that can be applied when solving an equation are:

1. Add the same number on both sides of the equation.

2. Multiply both sides by the same nonzero number.

We follow a similar procedure to solve systems of equations. There are actually two procedures we can use. They are outlined below, then explored thoroughly in the next two subsections.

The …rst technique, is called Gaussian elimination.

Algorithm 29 (Gaussian Elimination) To solve a system of linear equa- tions, follow the steps below:

1. Transform its augmented matrix into an equivalent augmented matrix in row-echelon form.

(4)

2. Use back-substitution to …nish solving.

The second technique is called Gauss-Jordan elimination

Algorithm 30 (Gauss-Jordan Elimination) To solve a system of linear equa- tions, follow the steps below:

1. Transform its augmented matrix into an equivalent augmented matrix in reduced row-echelon form.

2. The solution is given by the last column of the augmented matrix in re- duced row-echelon form.

With either technique, since the systems are equivalent, they will have the same solution set.

Usually, getting from a system to an equivalent system in row-echelon form or reduced row-echelon form requires several steps, each step producing an equiva- lent system. The question is: which transformations can we apply to a system so that it is transformed into a system in row echelon form or reduced row-echelon form. The key is that the new system should be equivalent to the original one, so they have the same solutions. It would not help to get a system which is simpler to solve, but which does not have the same solutions as the original one. There are three transformations which can be applied, to a system that will produce an equivalent system.

For simplicity, let us label the equations of a system E1, E2, :::, Em. We will use the same names for the rows of the corresponding augmented matrix.

Proposition 31 Each of the following operations on a system of linear equa- tions produces an equivalent system:

1. Equation Ei can be multiplied by a nonzero constant , with the result used in place of Ei. This operation is denoted ( Ei) ! (Ei)

2. Equation Ej can be multiplied by any constant and added to equa- tion Ei, with the result used in place of Ei. This operation is denoted ( Ej+ Ei) ! (Ei)

3. Equations Eiand Ejcan be transposed in order. This operation is denoted (Ei) $ (Ej)

Remark 32 The same operations can be applied to the augmented matrix of a system. Simply replace the term equation by row in the above proposition.

Remark 33 These operations are called elementary row operations.

Let us look at some examples to illustrate how these transformations are done.

(5)

Example 34 Consider 2

4 0 0 0 0 0 2 3 8 1 2 1 5

3 5

If we perform (E1) ! (E3), we obtain 2

4 1 2 1 5 0 2 3 8 0 0 0 0

3 5

Example 35 Consider 2

4 1 2 1 5 0 2 4 8 0 0 0 0

3 5

If we perform 12E2 ! (E2), we obtain 2

4 1 2 1 5 0 1 2 4 0 0 0 0

3 5

This is useful when we want to obtain a leading 1 on a given row.

Example 36 Consider 2

4 1 2 1 5 2 2 4 8 0 0 1 2

3 5

If we perform ( 2E1+ E2) ! (E2), we obtain 2

4 1 2 1 5

0 2 2 2

0 0 1 2

3 5

This is useful when we want to make an entry equal to 0. In this case, we made the …rst entry of the second row equal to 0.

We now look at each method to solve a system in greater detail.

1.2.2 Gaussian Elimination

Gaussian elimination was brie‡y outlined above. It has two main steps. First, we get a system (or its augmented matrix) in row-echelon form. Then, we use back substitution to …nish solving. We have already explained back substitution.

The …rst step is always done in a very orderly fashion. In fact, it is very easy to implement on a computer. It always proceeds as follows (the algorithm below works for both a system and its augmented matrix. The augmented matrix part appears in parentheses):

(6)

Remark 37 Proceed from the …rst equation (row) to the last.

Look at the …rst equation (row), make sure no equation (row) below it has a leading entry further to the left. If one does, switch the two.

Eliminate all the entries below the leading entry of the …rst equation (row).

Repeat the procedure for equation (row) 2, then 3, :::In general, we look at the ith equation (row), make sure the coe¢ cient for xi is not 0. If it is, you will have to …nd an equation in which it is not, and interchange the two equations. Then, eliminate xi from all the equations below the ith equation. We do this for i = 1; 2; :::; n 1 if the system has n equations.

Recall that Gaussian elimination is a systematic procedure which transforms a system into an equivalent system in row-echelon form. We illustrate it with examples.

Example 38 Consider the system:

8>

><

>>

:

E1: x1 +x2 +3x4 = 4

E2: 2x1 +x2 x3 +x4 = 1 E3: 3x1 x2 x3 +2x4 = 3 E4: x1 +2x2 +3x3 x4 = 4

(1.3)

Its corresponding augmented matrix is 2

66 4

1 1 0 3 4

2 1 1 1 1

3 1 1 2 3

1 2 3 1 4

3 77 5

We follow the algorithm described above.

We begin with the …rst row. Its leading entry is in column 1. The goal is to set to 0 all the other entries in column 1 and rows 2 - 4. In order to achieve this, we perform (E2 2E1) ! (E2), (E3 3E1) ! (E3) and (E4+ E1) ! (E4). The resulting augmented matrix is:

2 66 4

1 1 0 3 4

0 1 1 5 7

0 4 1 7 15

0 3 3 2 8

3 77 5

Next, we work on the second row. First, we make its leading entry 1 by performing ( E1) ! (E1). The resulting augmented matrix is:

2 66 4

1 1 0 3 4

0 1 1 5 7

0 4 1 7 15

0 3 3 2 8

3 77 5

(7)

Then we make the entries below the leading entry of the second row equal to 0 by performing (E3+ 4E2) ! (E3) and (E4 3E2) ! (E4). The resulting augmented matrix is:

2 66 4

1 1 0 3 4

0 1 1 5 7

0 0 3 13 13

0 0 0 13 13

3 77 5

We actually were lucky. In the process, we did part of the next step.

Looking at row 3, we already set the entry below it to 0. We just have to set the leading entry of row 3 to 1 by performing 13E3 ! E3. The resulting augmented matrix is:

2 66 4

1 1 0 3 4

0 1 1 5 7

0 0 1 133 133

0 0 0 13 13

3 77 5

We are on the last row, the only thing to do here is to set its leading entry to 1 by performing 131E4 ! (E4). The resulting augmented matrix is:

2 66 4

1 1 0 3 4

0 1 1 5 7

0 0 1 133 133

0 0 0 1 1

3 77 5

Now, we see that the matrix is in row-echelon form. The corresponding system is 8

>>

<

>>

:

E1: x1 +x2 +3x4 = 4 E2: x2 +x3 +5x4 = 7 E3: x3 +133x4 = 133

E4: x4 = 1

(1.4)

The system in (1:4) has the same solutions as the original system (1:3).

We …nish solving the system in (1:4) using back-substitution.

From E4, we get

x4= 1 We can now use E3 to …nd x3 as follows:

x3+13

3 x4 = 13 3 x3 = 13

3 (1 x4) x3 = 0 since x4= 1

(8)

We now continue with E2.

x2 x3 5x4 = 7

x2 = (x3+ 5x4 7) x2 = 2

Finally, using E1 yields:

x1+ x2+ 3x4 = 4

x1 = x2 3x4+ 4 x1 = 1

The solutions of the system in (1:4) and therefore of the system in (1:3) are: x1= 1; x2= 2; x3= 0; and x4= 1:

This is an example in which the procedure produced a unique solution, we had a consistent system. Following the same procedure, how will we detect if we have a system with no solutions, or one with an in…nite number of solutions?

The next two examples illustrate this. To also illustrate that the same procedure can be applied to system as well as augmented matrices, we do the next example using the system.

Example 39 Solve the system 8<

:

x1 + x2 + x3 = 4 2x1 + 2x2 + x3 = 6 x1 + x2 + 2x3 = 6

To eliminate x1from E2and E3, we perform (E2 2E1) ! (E2) and (E3 E1) ! (E3). The resulting system is:

8<

:

x1 + x2 + x3 = 4

x3 = 2

x3 = 2

The next step would be to eliminate x2 from E3. This was done in the previous step. The only thing left is to set the leading coe¢ cient of the second equation to 1 by performing ( E2) ! (E2). The corresponding system is:

8<

:

x1 + x2 + x3 = 4 x3 = 2 x3 = 2

This system has an in…nite number of solutions given by: x3= 2 and x1+x2= 2 or x1= 2 x2. The free variable is x2. In parametric notation, the solution set

is 8

<

:

x1= 2 t x2= t x3= 2

(9)

Example 40 Solve the system 8<

:

x1 + x2 + x3 = 4 2x1 + 2x2 + x3 = 4 x1 + x2 + 2x3 = 6

To eliminate x1from E2and E3, we perform (E2 2E1) ! (E2) and (E3 E1) ! (E3). The resulting system is:

8<

:

x1 + x2 + x3 = 4

x3 = 4

x3 = 2

The next step would be to eliminate x2 from E3. This was done in the previous step. The only thing left is to set the leading coe¢ cient of the second equation to 1 by performing ( E2) ! (E2). The corresponding system is:

x1 + x2 + x3 = 4 x3 = 4 x3 = 2

This system has no solutions because the last two equations are in contradiction.

Remark 41 It is important to notice that the Gaussian elimination procedure is always done in a very orderly fashion. In fact, it is very easy to implement on a computer. It always proceeds as follows:

Look at the …rst equation, make sure the coe¢ cient for x1is not 0. If it is, you will have to …nd an equation in which it is not, and interchange the two equations. Then, eliminate x1 from all the equations below the …rst equation.

Next, look at the second equation, make sure the coe¢ cient for x2is not 0.

If it is, you will have to …nd an equation in which it is not, and interchange the two equations. Then, eliminate x2 from all the equations below the second equation.

The procedure continues the same way. In general, we look at the ith equation, make sure the coe¢ cient for xi is not 0. If it is, you will have to …nd an equation in which it is not, and interchange the two equations.

Then, eliminate xi from all the equations below the ith equation. We do this for i = 1; 2; :::; n 1 if the system has n equations.

1.2.3 Gauss-Jordan Elimination

Here, we will work with augmented matrices.

Recall that Gauss-Jordan elimination is a systematic procedure which trans- forms a system into an equivalent system in reduced row-echelon form. To ob- tain a reduced row-echelon form, we …rst obtain a row-echelon form, then we go further. We need to make the columns containing the leading entries equal to 0, except for the leading entry of course. We illustrate it with an example.

(10)

Example 42 Solve the system 8>

><

>>

:

x1 +x2 +3x4 = 4

2x1 +x2 x3 +x4 = 1 3x1 x2 x3 +2x4 = 3

x1 +2x2 +3x3 x4 = 4 Its corresponding augmented matrix is

2 66 4

1 1 0 3 4

2 1 1 1 1

3 1 1 2 3

1 2 3 1 4

3 77 5

This is the system we did above. We will take it from its row-echelon form.

2 66 4

1 1 0 3 4

0 1 1 5 7

0 0 1 133 133

0 0 0 1 1

3 77 5

Now, we start from the bottom and work our way up.

There is nothing to do on the last row.

For row 3, we make the 4th entry 0 by performing E3 13

3E4 ! (E3).

The resulting augmented matrix is 2 66 4

1 1 0 3 4

0 1 1 5 7

0 0 1 0 0

0 0 0 1 1

3 77 5

For row 2, we make the 3rd and 4th entry 0. Let’s do them one at a time.

First, we perform (E2 E3) ! (E2). We obtain 2

66 4

1 1 0 3 4

0 1 0 5 7

0 0 1 0 0

0 0 0 1 1

3 77 5

Next, we perform (E2 5E4) to obtain 2

66 4

1 1 0 3 4

0 1 0 0 2

0 0 1 0 0

0 0 0 1 1

3 77 5

(11)

Finally row 1. We make entries 2 and 4 equal to 0 by performing …rst (E1 E2) ! (E1), this gives us

2 66 4

1 0 0 3 2

0 1 0 0 2

0 0 1 0 0

0 0 0 1 1

3 77 5

then (E1 3E4) ! (E1), this gives us 2

66 4

1 0 0 0 1

0 1 0 0 2

0 0 1 0 0

0 0 0 1 1

3 77 5

The solution is now read from the last column. Thus, we see that x1= 1, x2= 2, x3= 0, and x4= 1.

1.2.4 Homogeneous Linear Systems

We …nish this section by looking at a special type of system, homogeneous systems. These system as we will see, always have at least one solution.

De…nition 43 (Homogeneous System) A system of linear equations is said to be homogeneous if the constant terms are always 0. In other words, a homogeneous system is of the form

8>

><

>>

:

a11x1+ a12x2+ ::: + a1nxn= 0 a21x1+ a22x2+ ::: + a2nxn= 0

:::

am1x1+ am2x2+ ::: + amnxn= 0

De…nition 44 The solution xi = 0 for i = 1, 2, :::, n is called the trivial solution. Other solutions are called nontrivial solutions.

Remark 45 A homogeneous system always has at least the trivial solution. So, a homogeneous system is always consistent.

Remark 46 Another important fact about homogeneous systems is that the el- ementary transformations will not alter the last column of their augmented ma- trix. Thus, when we transform a homogeneous system in row-echelon form or reduced row-echelon form, we still have a homogeneous system.

It turns out that a homogeneous system of linear equations either has only the trivial solution, or has in…nitely many solutions. We state this result without proof. We will prove it later in the course. If the homogeneous system has more equations than unknowns, then it will have in…nitely many solutions.

(12)

Example 47 Solve 8<

:

x1 +x2 +3x4 = 0

2x1 +x2 x3 +x4 = 0 3x1 x2 x3 +2x4 = 0 The corresponding augmented matrix is

2

4 1 1 0 3 0

2 1 1 1 0

3 1 1 2 0

3 5

To set the 1st entries in rows 2 and 3, we perform (E2 2E1) ! E2 and (E3 3E1) ! E3. We obtain:

2

4 1 1 0 3 0

0 1 1 5 0

0 4 1 7 0

3 5

Set the leading entry of row 2 to 1 by performing ( E2) ! E2. We obtain:

2

4 1 1 0 3 0

0 1 1 5 0

0 4 1 7 0

3 5

Set the second entry in row 3 to 0 by performing (E3+ 4E2) ! E3. We

obtain: 2

4 1 1 0 3 0

0 1 1 5 0

0 0 3 13 0

3 5

Set the leading entry in row 3 to 1 by performing 13E3 ! E3. We obtain:

2

4 1 1 0 3 0

0 1 1 5 0

0 0 1 133 0 3 5

The corresponding system is 8<

:

x1 +x2 +3x4 = 0

x2 +x3 +5x4 = 0 x3 +133x4 = 0

We can use back substitution. Letting x4 be the free variable and setting x4= t, we get from equation 3 that x3= 133t. From equation 2, we get

x2 = x3 5x4

= 13 3 t 5t

= 2

3t

(13)

Therefore

x1 = x2 3x4

= 2

3t 3t

= 7

3t Thus, the solution in para,etric form is:

8>

><

>>

:

x1= 73t x2= 23t x3= 133t

x4= t

1.2.5 Concept Review

Know what a system in row-echelon form and reduced row-echelon form is.

Be able to solve a system in row-echelon form, using back-substitution.

Know the transformations which produce equivalent systems.

Be able to perform Gaussian elimination to transform a system of linear equations into an equivalent system in row-echelon form.

Be able to perform Gauss-Jordan elimination to transform a system of linear equations into an equivalent system in reduced row-echelon form.

Be able to solve a system of linear equation using either Gaussian elimi- nation or Gauss-Jordan elimination.

1.2.6 Problems

On pages 19 - 21, do # 1, 2, 3, 4, 6, 7, 8, 12, 13, 14, 17, 19, 20, 23, 24, 26, 32.

References

Related documents

Customer relationship has been regarded as the most important issue of the firms, so that an attempt is made to develop customer relationships and their comments on quality and

In OF1.0, packet forwarding within an OpenFlow logical switch is controlled by a single flow table that contains a set of flow entries installed by the controller.. The flow

How Many Breeding Females are Needed to Produce 40 Male Homozygotes per Week Using a Heterozygous Female x Heterozygous Male Breeding Scheme With 15% Non-Productive Breeders.

To define a relevant set of institutional conditions that explain variation in the degree and type of informal economic sectors across the world, we build on recent advances in

Field experiments were conducted at Ebonyi State University Research Farm during 2009 and 2010 farming seasons to evaluate the effect of intercropping maize with

Her background includes heading the nation's first community corrections-based victim advocacy program for the Maryland Division of Parole and Probation, [1996-1999] and running

Over the past decade we have been working with colleagues from around the globe and from a variety of disciplines to quantify human capital management and use the resultant

I first discovered yoga in 1987 when I was pregnant with my daughter. I took a prenatal yoga class at the Tualatin Valley Rec Center in Beaverton. What struck me initially about