Direct Methods for Solving Linear Systems Linear Systems of - - PowerPoint PPT Presentation

direct methods for solving linear systems linear systems
SMART_READER_LITE
LIVE PREVIEW

Direct Methods for Solving Linear Systems Linear Systems of - - PowerPoint PPT Presentation

Direct Methods for Solving Linear Systems Linear Systems of Equations Numerical Analysis (9th Edition) R L Burden & J D Faires Beamer Presentation Slides prepared by John Carroll Dublin City University c 2011 Brooks/Cole, Cengage


slide-1
SLIDE 1

Direct Methods for Solving Linear Systems Linear Systems of Equations

Numerical Analysis (9th Edition) R L Burden & J D Faires

Beamer Presentation Slides prepared by John Carroll Dublin City University

c 2011 Brooks/Cole, Cengage Learning

slide-2
SLIDE 2

Terminology Permissible Operations Gaussian Elimination GE/BS Algorithm

Outline

1

Notation & Basic Terminology

Numerical Analysis (Chapter 6) Linear Systems of Equations R L Burden & J D Faires 2 / 43

slide-3
SLIDE 3

Terminology Permissible Operations Gaussian Elimination GE/BS Algorithm

Outline

1

Notation & Basic Terminology

2

3 Operations to Simplify a Linear System of Equations

Numerical Analysis (Chapter 6) Linear Systems of Equations R L Burden & J D Faires 2 / 43

slide-4
SLIDE 4

Terminology Permissible Operations Gaussian Elimination GE/BS Algorithm

Outline

1

Notation & Basic Terminology

2

3 Operations to Simplify a Linear System of Equations

3

Gaussian Elimination Procedure

Numerical Analysis (Chapter 6) Linear Systems of Equations R L Burden & J D Faires 2 / 43

slide-5
SLIDE 5

Terminology Permissible Operations Gaussian Elimination GE/BS Algorithm

Outline

1

Notation & Basic Terminology

2

3 Operations to Simplify a Linear System of Equations

3

Gaussian Elimination Procedure

4

The Gaussian Elimination with Backward Substitution Algorithm

Numerical Analysis (Chapter 6) Linear Systems of Equations R L Burden & J D Faires 2 / 43

slide-6
SLIDE 6

Terminology Permissible Operations Gaussian Elimination GE/BS Algorithm

Outline

1

Notation & Basic Terminology

2

3 Operations to Simplify a Linear System of Equations

3

Gaussian Elimination Procedure

4

The Gaussian Elimination with Backward Substitution Algorithm

Numerical Analysis (Chapter 6) Linear Systems of Equations R L Burden & J D Faires 3 / 43

slide-7
SLIDE 7

Terminology Permissible Operations Gaussian Elimination GE/BS Algorithm

Introduction

Linear Systems of Equations

We will consider direct methods for solving a linear system of n equations in n variables.

Numerical Analysis (Chapter 6) Linear Systems of Equations R L Burden & J D Faires 4 / 43

slide-8
SLIDE 8

Terminology Permissible Operations Gaussian Elimination GE/BS Algorithm

Introduction

Linear Systems of Equations

We will consider direct methods for solving a linear system of n equations in n variables. Such a system has the form: E1 : a11x1 + a12x2 + · · · + a1nxn = b1 E2 : a21x1 + a22x2 + · · · + a2nxn = b2 . . . En : an1x1 + an2x2 + · · · + annxn = bn

Numerical Analysis (Chapter 6) Linear Systems of Equations R L Burden & J D Faires 4 / 43

slide-9
SLIDE 9

Terminology Permissible Operations Gaussian Elimination GE/BS Algorithm

Introduction

Linear Systems of Equations

We will consider direct methods for solving a linear system of n equations in n variables. Such a system has the form: E1 : a11x1 + a12x2 + · · · + a1nxn = b1 E2 : a21x1 + a22x2 + · · · + a2nxn = b2 . . . En : an1x1 + an2x2 + · · · + annxn = bn In this system we are given the constants aij, for each i, j = 1, 2, . . . , n, and bi, for each i = 1, 2, . . . , n, and we need to determine the unknowns x1, . . . , xn.

Numerical Analysis (Chapter 6) Linear Systems of Equations R L Burden & J D Faires 4 / 43

slide-10
SLIDE 10

Terminology Permissible Operations Gaussian Elimination GE/BS Algorithm

Introduction

Direct Methods & Round-off Error

Numerical Analysis (Chapter 6) Linear Systems of Equations R L Burden & J D Faires 5 / 43

slide-11
SLIDE 11

Terminology Permissible Operations Gaussian Elimination GE/BS Algorithm

Introduction

Direct Methods & Round-off Error

Direct techniques are methods that theoretically give the exact solution to the system in a finite number of steps.

Numerical Analysis (Chapter 6) Linear Systems of Equations R L Burden & J D Faires 5 / 43

slide-12
SLIDE 12

Terminology Permissible Operations Gaussian Elimination GE/BS Algorithm

Introduction

Direct Methods & Round-off Error

Direct techniques are methods that theoretically give the exact solution to the system in a finite number of steps. In practice, of course, the solution obtained will be contaminated by the round-off error that is involved with the arithmetic being used.

Numerical Analysis (Chapter 6) Linear Systems of Equations R L Burden & J D Faires 5 / 43

slide-13
SLIDE 13

Terminology Permissible Operations Gaussian Elimination GE/BS Algorithm

Introduction

Direct Methods & Round-off Error

Direct techniques are methods that theoretically give the exact solution to the system in a finite number of steps. In practice, of course, the solution obtained will be contaminated by the round-off error that is involved with the arithmetic being used. Analyzing the effect of this round-off error and determining ways to keep it under control will be a major component of this presentation.

Numerical Analysis (Chapter 6) Linear Systems of Equations R L Burden & J D Faires 5 / 43

slide-14
SLIDE 14

Terminology Permissible Operations Gaussian Elimination GE/BS Algorithm

Introduction

Direct Methods & Round-off Error

Direct techniques are methods that theoretically give the exact solution to the system in a finite number of steps. In practice, of course, the solution obtained will be contaminated by the round-off error that is involved with the arithmetic being used. Analyzing the effect of this round-off error and determining ways to keep it under control will be a major component of this presentation. We begin, however, by introducing some important terminology and notation.

Numerical Analysis (Chapter 6) Linear Systems of Equations R L Burden & J D Faires 5 / 43

slide-15
SLIDE 15

Terminology Permissible Operations Gaussian Elimination GE/BS Algorithm

Matrices & Vectors

Definition of a Matrix

An n × m (n by m) matrix is a rectangular array of elements with n rows and m columns in which not only is the value of an element important, but also its position in the array.

Numerical Analysis (Chapter 6) Linear Systems of Equations R L Burden & J D Faires 6 / 43

slide-16
SLIDE 16

Terminology Permissible Operations Gaussian Elimination GE/BS Algorithm

Matrices & Vectors

Definition of a Matrix

An n × m (n by m) matrix is a rectangular array of elements with n rows and m columns in which not only is the value of an element important, but also its position in the array.

Notation

The notation for an n × m matrix will be a capital letter such as A for the matrix and lowercase letters with double subscripts, such as aij, to refer to the entry at the intersection of the ith row and jth column; that is: A = [aij] =      a11 a12 · · · a1m a21 a22 · · · a2m . . . . . . . . . an1 an2 · · · anm     

Numerical Analysis (Chapter 6) Linear Systems of Equations R L Burden & J D Faires 6 / 43

slide-17
SLIDE 17

Terminology Permissible Operations Gaussian Elimination GE/BS Algorithm

Matrices & Vectors

A Vector is a special case

The 1 × n matrix A = [a11 a12 · · · a1n] is called an n-dimensional row vector, and an n × 1 matrix A =      a11 a21 . . . an1      is called an n-dimensional column vector.

Numerical Analysis (Chapter 6) Linear Systems of Equations R L Burden & J D Faires 7 / 43

slide-18
SLIDE 18

Terminology Permissible Operations Gaussian Elimination GE/BS Algorithm

Matrices & Vectors

A Vector is a special case (Cont’d)

Usually the unnecessary subscripts are omitted for vectors, and a boldface lowercase letter is used for notation. Thus x =      x1 x2 . . . xn      denotes a column vector, and y = [y1 y2 . . . yn] a row vector.

Numerical Analysis (Chapter 6) Linear Systems of Equations R L Burden & J D Faires 8 / 43

slide-19
SLIDE 19

Terminology Permissible Operations Gaussian Elimination GE/BS Algorithm

Matrices & Vectors: Augmented Matrix

The Augmented Matrix (1/2)

An n × (n + 1) matrix can be used to represent the linear system a11x1 + a12x2 + · · · + a1nxn = b1, a21x1 + a22x2 + · · · + a2nxn = b2, . . . . . . an1x1 + an2x2 + · · · + annxn = bn,

Numerical Analysis (Chapter 6) Linear Systems of Equations R L Burden & J D Faires 9 / 43

slide-20
SLIDE 20

Terminology Permissible Operations Gaussian Elimination GE/BS Algorithm

Matrices & Vectors: Augmented Matrix

The Augmented Matrix (1/2)

An n × (n + 1) matrix can be used to represent the linear system a11x1 + a12x2 + · · · + a1nxn = b1, a21x1 + a22x2 + · · · + a2nxn = b2, . . . . . . an1x1 + an2x2 + · · · + annxn = bn, by first constructing A = [aij] =      a11 a12 · · · a1n a21 a22 · · · a2n . . . . . . . . . an1 an2 · · · ann      and b =      b1 b2 . . . bn     

Numerical Analysis (Chapter 6) Linear Systems of Equations R L Burden & J D Faires 9 / 43

slide-21
SLIDE 21

Terminology Permissible Operations Gaussian Elimination GE/BS Algorithm

Matrices & Vectors: Augmented Matrix

The Augmented Matrix (2/2)

and then forming the new array [A, b]: [A, b] =      a11 a12 · · · a1n b1 a21 a22 · · · a2n b2 . . . . . . . . . . . . an1 an2 · · · ann bn     

Numerical Analysis (Chapter 6) Linear Systems of Equations R L Burden & J D Faires 10 / 43

slide-22
SLIDE 22

Terminology Permissible Operations Gaussian Elimination GE/BS Algorithm

Matrices & Vectors: Augmented Matrix

The Augmented Matrix (2/2)

and then forming the new array [A, b]: [A, b] =      a11 a12 · · · a1n b1 a21 a22 · · · a2n b2 . . . . . . . . . . . . an1 an2 · · · ann bn      where the vertical line is used to separate the coefficients of the unknowns from the values on the right-hand side of the equations.

Numerical Analysis (Chapter 6) Linear Systems of Equations R L Burden & J D Faires 10 / 43

slide-23
SLIDE 23

Terminology Permissible Operations Gaussian Elimination GE/BS Algorithm

Matrices & Vectors: Augmented Matrix

The Augmented Matrix (2/2)

and then forming the new array [A, b]: [A, b] =      a11 a12 · · · a1n b1 a21 a22 · · · a2n b2 . . . . . . . . . . . . an1 an2 · · · ann bn      where the vertical line is used to separate the coefficients of the unknowns from the values on the right-hand side of the equations. The array [A, b] is called an augmented matrix.

Numerical Analysis (Chapter 6) Linear Systems of Equations R L Burden & J D Faires 10 / 43

slide-24
SLIDE 24

Terminology Permissible Operations Gaussian Elimination GE/BS Algorithm

Matrices & Vectors: Augmented Matrix

Representing the Linear System

In what follows, the n × (n + 1) matrix [A, b] =      a11 a12 · · · a1n b1 a21 a22 · · · a2n b2 . . . . . . . . . . . . an1 an2 · · · ann bn     

Numerical Analysis (Chapter 6) Linear Systems of Equations R L Burden & J D Faires 11 / 43

slide-25
SLIDE 25

Terminology Permissible Operations Gaussian Elimination GE/BS Algorithm

Matrices & Vectors: Augmented Matrix

Representing the Linear System

In what follows, the n × (n + 1) matrix [A, b] =      a11 a12 · · · a1n b1 a21 a22 · · · a2n b2 . . . . . . . . . . . . an1 an2 · · · ann bn      will used to represent the linear system a11x1 + a12x2 + · · · + a1nxn = b1 a21x1 + a22x2 + · · · + a2nxn = b2 . . . . . . an1x1 + an2x2 + · · · + annxn = bn

Numerical Analysis (Chapter 6) Linear Systems of Equations R L Burden & J D Faires 11 / 43

slide-26
SLIDE 26

Terminology Permissible Operations Gaussian Elimination GE/BS Algorithm

Outline

1

Notation & Basic Terminology

2

3 Operations to Simplify a Linear System of Equations

3

Gaussian Elimination Procedure

4

The Gaussian Elimination with Backward Substitution Algorithm

Numerical Analysis (Chapter 6) Linear Systems of Equations R L Burden & J D Faires 12 / 43

slide-27
SLIDE 27

Terminology Permissible Operations Gaussian Elimination GE/BS Algorithm

Simplifying a Linear Systems of Equations

The Linear System

Returning to the linear system of n equations in n variables: E1 : a11x1 + a12x2 + · · · + a1nxn = b1 E2 : a21x1 + a22x2 + · · · + a2nxn = b2 . . . En : an1x1 + an2x2 + · · · + annxn = bn where we are given the constants aij, for each i, j = 1, 2, . . . , n, and bi, for each i = 1, 2, . . . , n,

Numerical Analysis (Chapter 6) Linear Systems of Equations R L Burden & J D Faires 13 / 43

slide-28
SLIDE 28

Terminology Permissible Operations Gaussian Elimination GE/BS Algorithm

Simplifying a Linear Systems of Equations

The Linear System

Returning to the linear system of n equations in n variables: E1 : a11x1 + a12x2 + · · · + a1nxn = b1 E2 : a21x1 + a22x2 + · · · + a2nxn = b2 . . . En : an1x1 + an2x2 + · · · + annxn = bn where we are given the constants aij, for each i, j = 1, 2, . . . , n, and bi, for each i = 1, 2, . . . , n, we need to determine the unknowns x1, . . . , xn.

Numerical Analysis (Chapter 6) Linear Systems of Equations R L Burden & J D Faires 13 / 43

slide-29
SLIDE 29

Terminology Permissible Operations Gaussian Elimination GE/BS Algorithm

Simplifying a Linear Systems of Equations

Permissible Operations

We will use 3 operations to simplify the linear system:

Numerical Analysis (Chapter 6) Linear Systems of Equations R L Burden & J D Faires 14 / 43

slide-30
SLIDE 30

Terminology Permissible Operations Gaussian Elimination GE/BS Algorithm

Simplifying a Linear Systems of Equations

Permissible Operations

We will use 3 operations to simplify the linear system:

1

Equation Ei can be multiplied by any nonzero constant λ with the resulting equation used in place of Ei. This operation is denoted (λEi) → (Ei).

Numerical Analysis (Chapter 6) Linear Systems of Equations R L Burden & J D Faires 14 / 43

slide-31
SLIDE 31

Terminology Permissible Operations Gaussian Elimination GE/BS Algorithm

Simplifying a Linear Systems of Equations

Permissible Operations

We will use 3 operations to simplify the linear system:

1

Equation Ei can be multiplied by any nonzero constant λ with the resulting equation used in place of Ei. This operation is denoted (λEi) → (Ei).

2

Equation Ej can be multiplied by any constant λ and added to equation Ei with the resulting equation used in place of Ei. This

  • peration is denoted (Ei + λEj) → (Ei).

Numerical Analysis (Chapter 6) Linear Systems of Equations R L Burden & J D Faires 14 / 43

slide-32
SLIDE 32

Terminology Permissible Operations Gaussian Elimination GE/BS Algorithm

Simplifying a Linear Systems of Equations

Permissible Operations

We will use 3 operations to simplify the linear system:

1

Equation Ei can be multiplied by any nonzero constant λ with the resulting equation used in place of Ei. This operation is denoted (λEi) → (Ei).

2

Equation Ej can be multiplied by any constant λ and added to equation Ei with the resulting equation used in place of Ei. This

  • peration is denoted (Ei + λEj) → (Ei).

3

Equations Ei and Ej can be transposed in order. This operation is denoted (Ei) ↔ (Ej).

Numerical Analysis (Chapter 6) Linear Systems of Equations R L Burden & J D Faires 14 / 43

slide-33
SLIDE 33

Terminology Permissible Operations Gaussian Elimination GE/BS Algorithm

Simplifying a Linear Systems of Equations

Permissible Operations

We will use 3 operations to simplify the linear system:

1

Equation Ei can be multiplied by any nonzero constant λ with the resulting equation used in place of Ei. This operation is denoted (λEi) → (Ei).

2

Equation Ej can be multiplied by any constant λ and added to equation Ei with the resulting equation used in place of Ei. This

  • peration is denoted (Ei + λEj) → (Ei).

3

Equations Ei and Ej can be transposed in order. This operation is denoted (Ei) ↔ (Ej). By a sequence of these operations, a linear system will be systematically transformed into to a new linear system that is more easily solved and has the same solutions.

Numerical Analysis (Chapter 6) Linear Systems of Equations R L Burden & J D Faires 14 / 43

slide-34
SLIDE 34

Terminology Permissible Operations Gaussian Elimination GE/BS Algorithm

Simplifying a Linear Systems of Equations

Illustration

The four equations E1 : x1 + x2 + 3x4 = 4 E2 : 2x1 + x2 − x3 + x4 = 1 E3 : 3x1 − x2 − x3 + 2x4 = −3 E4 : −x1 + 2x2 + 3x3 − x4 = 4 will be solved for x1, x2, x3, and x4.

Numerical Analysis (Chapter 6) Linear Systems of Equations R L Burden & J D Faires 15 / 43

slide-35
SLIDE 35

Terminology Permissible Operations Gaussian Elimination GE/BS Algorithm

Simplifying a Linear Systems of Equations

Illustration

The four equations E1 : x1 + x2 + 3x4 = 4 E2 : 2x1 + x2 − x3 + x4 = 1 E3 : 3x1 − x2 − x3 + 2x4 = −3 E4 : −x1 + 2x2 + 3x3 − x4 = 4 will be solved for x1, x2, x3, and x4. We first use equation E1 to eliminate the unknown x1 from equations E2, E3, and E4 by performing: (E2 − 2E1) → (E2) (E3 − 3E1) → (E3) and (E4 + E1) → (E4)

Numerical Analysis (Chapter 6) Linear Systems of Equations R L Burden & J D Faires 15 / 43

slide-36
SLIDE 36

Terminology Permissible Operations Gaussian Elimination GE/BS Algorithm

Simplifying a Linear Systems of Equations

E1 : x1+x2 +3x4=4 E2 : 2x1+x2−x3+ x4=1

Numerical Analysis (Chapter 6) Linear Systems of Equations R L Burden & J D Faires 16 / 43

slide-37
SLIDE 37

Terminology Permissible Operations Gaussian Elimination GE/BS Algorithm

Simplifying a Linear Systems of Equations

E1 : x1+x2 +3x4=4 E2 : 2x1+x2−x3+ x4=1

Illustration Cont’d (2/5)

For example, in the second equation (E2 − 2E1) → (E2) produces (2x1 + x2 − x3 + x4) − 2(x1 + x2 + 3x4) = 1 − 2(4)

Numerical Analysis (Chapter 6) Linear Systems of Equations R L Burden & J D Faires 16 / 43

slide-38
SLIDE 38

Terminology Permissible Operations Gaussian Elimination GE/BS Algorithm

Simplifying a Linear Systems of Equations

E1 : x1+x2 +3x4=4 E2 : 2x1+x2−x3+ x4=1

Illustration Cont’d (2/5)

For example, in the second equation (E2 − 2E1) → (E2) produces (2x1 + x2 − x3 + x4) − 2(x1 + x2 + 3x4) = 1 − 2(4) which simplifies to the result shown as E2 in E1 : x1 + x2 + 3x4 = 4 E2 : − x2 − x3 − 5x4 = −7

Numerical Analysis (Chapter 6) Linear Systems of Equations R L Burden & J D Faires 16 / 43

slide-39
SLIDE 39

Terminology Permissible Operations Gaussian Elimination GE/BS Algorithm

Simplifying a Linear Systems of Equations

Illustration Cont’d (3/5)

Similarly for equations E3 and E4 so that we obtain the new system: E1 : x1 + x2 + 3x4 = 4 E2 : − x2 − x3 − 5x4 = −7 E3 : − 4x2 − x3 − 7x4 = −15 E4 : 3x2 + 3x3 + 2x4 = 8 For simplicity, the new equations are again labeled E1, E2, E3, and E4.

Numerical Analysis (Chapter 6) Linear Systems of Equations R L Burden & J D Faires 17 / 43

slide-40
SLIDE 40

Terminology Permissible Operations Gaussian Elimination GE/BS Algorithm

Simplifying a Linear Systems of Equations

Illustration Cont’d (4/5)

In the new system, E2 is used to eliminate the unknown x2 from E3 and E4 by performing (E3 − 4E2) → (E3) and (E4 + 3E2) → (E4).

Numerical Analysis (Chapter 6) Linear Systems of Equations R L Burden & J D Faires 18 / 43

slide-41
SLIDE 41

Terminology Permissible Operations Gaussian Elimination GE/BS Algorithm

Simplifying a Linear Systems of Equations

Illustration Cont’d (4/5)

In the new system, E2 is used to eliminate the unknown x2 from E3 and E4 by performing (E3 − 4E2) → (E3) and (E4 + 3E2) → (E4). This results in E1 : x1 + x2 + 3x4 = 4, E2 : − x2 − x3 − 5x4 = −7, E3 : 3x3 + 13x4 = 13, E4 : − 13x4 = −13.

Numerical Analysis (Chapter 6) Linear Systems of Equations R L Burden & J D Faires 18 / 43

slide-42
SLIDE 42

Terminology Permissible Operations Gaussian Elimination GE/BS Algorithm

Simplifying a Linear Systems of Equations

Illustration Cont’d (4/5)

In the new system, E2 is used to eliminate the unknown x2 from E3 and E4 by performing (E3 − 4E2) → (E3) and (E4 + 3E2) → (E4). This results in E1 : x1 + x2 + 3x4 = 4, E2 : − x2 − x3 − 5x4 = −7, E3 : 3x3 + 13x4 = 13, E4 : − 13x4 = −13. This latter system of equations is now in triangular (or reduced) form and can be solved for the unknowns by a backward-substitution process.

Numerical Analysis (Chapter 6) Linear Systems of Equations R L Burden & J D Faires 18 / 43

slide-43
SLIDE 43

Terminology Permissible Operations Gaussian Elimination GE/BS Algorithm

Simplifying a Linear Systems of Equations

Illustration Cont’d (5/5)

Since E4 implies x4 = 1, we can solve E3 for x3 to give x3 = 1 3(13 − 13x4) = 1 3(13 − 13) = 0.

Numerical Analysis (Chapter 6) Linear Systems of Equations R L Burden & J D Faires 19 / 43

slide-44
SLIDE 44

Terminology Permissible Operations Gaussian Elimination GE/BS Algorithm

Simplifying a Linear Systems of Equations

Illustration Cont’d (5/5)

Since E4 implies x4 = 1, we can solve E3 for x3 to give x3 = 1 3(13 − 13x4) = 1 3(13 − 13) = 0. Continuing, E2 gives x2 = −(−7 + 5x4 + x3) = −(−7 + 5 + 0) = 2,

Numerical Analysis (Chapter 6) Linear Systems of Equations R L Burden & J D Faires 19 / 43

slide-45
SLIDE 45

Terminology Permissible Operations Gaussian Elimination GE/BS Algorithm

Simplifying a Linear Systems of Equations

Illustration Cont’d (5/5)

Since E4 implies x4 = 1, we can solve E3 for x3 to give x3 = 1 3(13 − 13x4) = 1 3(13 − 13) = 0. Continuing, E2 gives x2 = −(−7 + 5x4 + x3) = −(−7 + 5 + 0) = 2, and E1 gives x1 = 4 − 3x4 − x2 = 4 − 3 − 2 = −1.

Numerical Analysis (Chapter 6) Linear Systems of Equations R L Burden & J D Faires 19 / 43

slide-46
SLIDE 46

Terminology Permissible Operations Gaussian Elimination GE/BS Algorithm

Simplifying a Linear Systems of Equations

Illustration Cont’d (5/5)

Since E4 implies x4 = 1, we can solve E3 for x3 to give x3 = 1 3(13 − 13x4) = 1 3(13 − 13) = 0. Continuing, E2 gives x2 = −(−7 + 5x4 + x3) = −(−7 + 5 + 0) = 2, and E1 gives x1 = 4 − 3x4 − x2 = 4 − 3 − 2 = −1. The solution is therefore, x1 = −1, x2 = 2, x3 = 0, and x4 = 1.

Numerical Analysis (Chapter 6) Linear Systems of Equations R L Burden & J D Faires 19 / 43

slide-47
SLIDE 47

Terminology Permissible Operations Gaussian Elimination GE/BS Algorithm

Outline

1

Notation & Basic Terminology

2

3 Operations to Simplify a Linear System of Equations

3

Gaussian Elimination Procedure

4

The Gaussian Elimination with Backward Substitution Algorithm

Numerical Analysis (Chapter 6) Linear Systems of Equations R L Burden & J D Faires 20 / 43

slide-48
SLIDE 48

Terminology Permissible Operations Gaussian Elimination GE/BS Algorithm

Constructing an Algorithm to Solve the Linear System

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

Numerical Analysis (Chapter 6) Linear Systems of Equations R L Burden & J D Faires 21 / 43

slide-49
SLIDE 49

Terminology Permissible Operations Gaussian Elimination GE/BS Algorithm

Constructing an Algorithm to Solve the Linear System

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

Converting to Augmented Form

Repeating the operations involved in the previous illustration with the matrix notation results in first considering the augmented matrix:     1 1 3 4 2 1 −1 1 1 3 −1 −1 2 −3 −1 2 3 −1 4    

Numerical Analysis (Chapter 6) Linear Systems of Equations R L Burden & J D Faires 21 / 43

slide-50
SLIDE 50

Terminology Permissible Operations Gaussian Elimination GE/BS Algorithm

Constructing an Algorithm to Solve the Linear System

Reducing to Triangular Form

Numerical Analysis (Chapter 6) Linear Systems of Equations R L Burden & J D Faires 22 / 43

slide-51
SLIDE 51

Terminology Permissible Operations Gaussian Elimination GE/BS Algorithm

Constructing an Algorithm to Solve the Linear System

Reducing to Triangular Form

Performing the operations as described in the earlier example produces the augmented matrices:     1 1 3 4 −1 −1 −5 −7 −4 −1 −7 −15 3 3 2 8     and     1 1 3 4 −1 −1 −5 −7 3 13 13 −13 −13    

Numerical Analysis (Chapter 6) Linear Systems of Equations R L Burden & J D Faires 22 / 43

slide-52
SLIDE 52

Terminology Permissible Operations Gaussian Elimination GE/BS Algorithm

Constructing an Algorithm to Solve the Linear System

Reducing to Triangular Form

Performing the operations as described in the earlier example produces the augmented matrices:     1 1 3 4 −1 −1 −5 −7 −4 −1 −7 −15 3 3 2 8     and     1 1 3 4 −1 −1 −5 −7 3 13 13 −13 −13     The final matrix can now be transformed into its corresponding linear system, and solutions for x1, x2, x3, and x4, can be obtained. The procedure is called Gaussian elimination with backward substitution.

Numerical Analysis (Chapter 6) Linear Systems of Equations R L Burden & J D Faires 22 / 43

slide-53
SLIDE 53

Terminology Permissible Operations Gaussian Elimination GE/BS Algorithm

Gaussian Elimination with Backward Substitution

Basic Steps in the Procedure

The general Gaussian elimination procedure applied to the linear system E1 : a11x1 + a12x2 + · · · + a1nxn = b1 E2 : a21x1 + a22x2 + · · · + a2nxn = b2 . . . . . . En : an1x1 + an2x2 + · · · + annxn = bn will be handled in a similar manner.

Numerical Analysis (Chapter 6) Linear Systems of Equations R L Burden & J D Faires 23 / 43

slide-54
SLIDE 54

Terminology Permissible Operations Gaussian Elimination GE/BS Algorithm

Gaussian Elimination with Backward Substitution

Basic Steps in the Procedure (Cont’d)

First form the augmented matrix ˜ A: ˜ A = [A, b] =      a11 a12 · · · a1n a1,n+1 a21 a22 · · · a2n a2,n+1 . . . . . . . . . . . . an1 an2 · · · ann an,n+1      where A denotes the matrix formed by the coefficients.

Numerical Analysis (Chapter 6) Linear Systems of Equations R L Burden & J D Faires 24 / 43

slide-55
SLIDE 55

Terminology Permissible Operations Gaussian Elimination GE/BS Algorithm

Gaussian Elimination with Backward Substitution

Basic Steps in the Procedure (Cont’d)

First form the augmented matrix ˜ A: ˜ A = [A, b] =      a11 a12 · · · a1n a1,n+1 a21 a22 · · · a2n a2,n+1 . . . . . . . . . . . . an1 an2 · · · ann an,n+1      where A denotes the matrix formed by the coefficients. The entries in the (n + 1)st column are the values of b; that is, ai,n+1 = bi for each i = 1, 2, . . . , n.

Numerical Analysis (Chapter 6) Linear Systems of Equations R L Burden & J D Faires 24 / 43

slide-56
SLIDE 56

Terminology Permissible Operations Gaussian Elimination GE/BS Algorithm

Gaussian Elimination with Backward Substitution

Basic Steps in the Procedure (Cont’d)

Provided a11 = 0, we perform the operations corresponding to (Ej − (aj1/a11)E1) → (Ej) for each j = 2, 3, . . . , n to eliminate the coefficient of x1 in each of these rows.

Numerical Analysis (Chapter 6) Linear Systems of Equations R L Burden & J D Faires 25 / 43

slide-57
SLIDE 57

Terminology Permissible Operations Gaussian Elimination GE/BS Algorithm

Gaussian Elimination with Backward Substitution

Basic Steps in the Procedure (Cont’d)

Provided a11 = 0, we perform the operations corresponding to (Ej − (aj1/a11)E1) → (Ej) for each j = 2, 3, . . . , n to eliminate the coefficient of x1 in each of these rows. Although the entries in rows 2, 3, . . . , n are expected to change, for ease of notation we again denote the entry in the ith row and the jth column by aij.

Numerical Analysis (Chapter 6) Linear Systems of Equations R L Burden & J D Faires 25 / 43

slide-58
SLIDE 58

Terminology Permissible Operations Gaussian Elimination GE/BS Algorithm

Gaussian Elimination with Backward Substitution

Basic Steps in the Procedure (Cont’d)

Provided a11 = 0, we perform the operations corresponding to (Ej − (aj1/a11)E1) → (Ej) for each j = 2, 3, . . . , n to eliminate the coefficient of x1 in each of these rows. Although the entries in rows 2, 3, . . . , n are expected to change, for ease of notation we again denote the entry in the ith row and the jth column by aij. With this in mind, we follow a sequential procedure for i = 2, 3, . . . , n − 1 and perform the operation (Ej − (aji/aii)Ei) → (Ej) for each j = i + 1, i + 2, . . ., n, provided aii = 0.

Numerical Analysis (Chapter 6) Linear Systems of Equations R L Burden & J D Faires 25 / 43

slide-59
SLIDE 59

Terminology Permissible Operations Gaussian Elimination GE/BS Algorithm

Gaussian Elimination with Backward Substitution

Basic Steps in the Procedure (Cont’d)

This eliminates (changes the coefficient to zero) xi in each row below the ith for all values of i = 1, 2, . . . , n − 1.

Numerical Analysis (Chapter 6) Linear Systems of Equations R L Burden & J D Faires 26 / 43

slide-60
SLIDE 60

Terminology Permissible Operations Gaussian Elimination GE/BS Algorithm

Gaussian Elimination with Backward Substitution

Basic Steps in the Procedure (Cont’d)

This eliminates (changes the coefficient to zero) xi in each row below the ith for all values of i = 1, 2, . . . , n − 1. The resulting matrix has the form: ˜ ˜ A =      a11 a12 · · · a1n a1,n+1 a22 · · · a2n a2,n+1 . . . ... ... . . . . . . · · · ann an,n+1      where, except in the first row, the values of aij are not expected to agree with those in the original matrix ˜ A.

Numerical Analysis (Chapter 6) Linear Systems of Equations R L Burden & J D Faires 26 / 43

slide-61
SLIDE 61

Terminology Permissible Operations Gaussian Elimination GE/BS Algorithm

Gaussian Elimination with Backward Substitution

Basic Steps in the Procedure (Cont’d)

This eliminates (changes the coefficient to zero) xi in each row below the ith for all values of i = 1, 2, . . . , n − 1. The resulting matrix has the form: ˜ ˜ A =      a11 a12 · · · a1n a1,n+1 a22 · · · a2n a2,n+1 . . . ... ... . . . . . . · · · ann an,n+1      where, except in the first row, the values of aij are not expected to agree with those in the original matrix ˜ A. The matrix ˜ ˜ A represents a linear system with the same solution set as the original system.

Numerical Analysis (Chapter 6) Linear Systems of Equations R L Burden & J D Faires 26 / 43

slide-62
SLIDE 62

Terminology Permissible Operations Gaussian Elimination GE/BS Algorithm

Gaussian Elimination with Backward Substitution

Basic Steps in the Procedure (Cont’d)

The new linear system is triangular, a11x1 + a12x2 + · · · + a1nxn = a1,n+1 a22x2 + · · · + a2nxn = a2,n+1 ... . . . . . . ... . . . . . . ... . . . . . . annxn = an,n+1 so backward substitution can be performed.

Numerical Analysis (Chapter 6) Linear Systems of Equations R L Burden & J D Faires 27 / 43

slide-63
SLIDE 63

Terminology Permissible Operations Gaussian Elimination GE/BS Algorithm

Gaussian Elimination with Backward Substitution

Basic Steps in the Procedure (Cont’d)

The new linear system is triangular, a11x1 + a12x2 + · · · + a1nxn = a1,n+1 a22x2 + · · · + a2nxn = a2,n+1 ... . . . . . . ... . . . . . . ... . . . . . . annxn = an,n+1 so backward substitution can be performed. Solving the nth equation for xn gives xn = an,n+1 ann

Numerical Analysis (Chapter 6) Linear Systems of Equations R L Burden & J D Faires 27 / 43

slide-64
SLIDE 64

Terminology Permissible Operations Gaussian Elimination GE/BS Algorithm

Gaussian Elimination with Backward Substitution

Basic Steps in the Procedure (Cont’d)

Solving the (n − 1)st equation for xn−1 and using the known value for xn yields xn−1 = an−1,n+1 − an−1,nxn an−1,n−1

Numerical Analysis (Chapter 6) Linear Systems of Equations R L Burden & J D Faires 28 / 43

slide-65
SLIDE 65

Terminology Permissible Operations Gaussian Elimination GE/BS Algorithm

Gaussian Elimination with Backward Substitution

Basic Steps in the Procedure (Cont’d)

Solving the (n − 1)st equation for xn−1 and using the known value for xn yields xn−1 = an−1,n+1 − an−1,nxn an−1,n−1 Continuing this process, we obtain xi = ai,n+1 − ai,nxn − ai,n−1xn−1 − · · · − ai,i+1xi+1 aii = ai,n+1 − n

j=i+1 aijxj

aii for each i = n − 1, n − 2, . . . , 2, 1.

Numerical Analysis (Chapter 6) Linear Systems of Equations R L Burden & J D Faires 28 / 43

slide-66
SLIDE 66

Terminology Permissible Operations Gaussian Elimination GE/BS Algorithm

Gaussian Elimination with Backward Substitution

A More Precise Description

Gaussian elimination procedure is described more precisely, although more intricately, by forming a sequence of augmented matrices ˜ A(1), ˜ A(2), . . ., ˜ A(n), where ˜ A(1) is the matrix ˜ A given earlier and ˜ A(k), for each k = 2, 3, . . . , n, has entries a(k)

ij , where:

a(k)

ij =

             a(k−1)

ij

when i = 1, 2, . . . , k − 1 and j = 1, 2, . . . , n + 1 when i = k, k + 1, . . . , n and j = 1, 2, . . . , k − 1 a(k−1)

ij

− a(k−1)

i,k−1

a(k−1)

k−1,k−1

a(k−1)

k−1,j

when i = k, k + 1, . . . , n and j = k, k + 1, . . . , n + 1

Numerical Analysis (Chapter 6) Linear Systems of Equations R L Burden & J D Faires 29 / 43

slide-67
SLIDE 67

Terminology Permissible Operations Gaussian Elimination GE/BS Algorithm

Gaussian Elimination with Backward Substitution

A More Precise Description (Cont’d)

Thus

˜ A(k) =                    a(1)

11

a(1)

12

a(1)

13

· · · a(1)

1,k−1

a(1)

1k

· · · a(1)

1n

a(1)

1,n+1

a(2)

22

a(2)

23

· · · a(2)

2,k−1

a(2)

2k

· · · a(2)

2n

a(2)

2,n+1

. . . ... ... . . . . . . . . . . . . . . . ... ... . . . . . . . . . . . . . . . ... a(k−1)

k−1,k−1

a(k−1)

k−1,k

· · · a(k−1)

k−1,n

a(k−1)

k−1,n+1

. . . a(k)

kk

· · · a(k)

kn

a(k)

k,n+1

. . . . . . . . . . . . . . . · · · · · · · · · a(k)

nk

· · · a(k)

nn

a(k)

n,n+1

                  

represents the equivalent linear system for which the variable xk−1 has just been eliminated from equations Ek, Ek+1, . . . , En.

Numerical Analysis (Chapter 6) Linear Systems of Equations R L Burden & J D Faires 30 / 43

slide-68
SLIDE 68

Terminology Permissible Operations Gaussian Elimination GE/BS Algorithm

Gaussian Elimination with Backward Substitution

A More Precise Description (Cont’d)

The procedure will fail if one of the elements a(1)

11 , a(2) 22 , a(3) 33 , . . . ,

a(n−1)

n−1,n−1, a(n) nn is zero because the step

 Ei − a(k)

i,k

a(k)

kk

(Ek)   → Ei either cannot be performed (this occurs if one of a(1)

11 , . . ., a(n−1) n−1,n−1

is zero), or the backward substitution cannot be accomplished (in the case a(n)

nn = 0).

Numerical Analysis (Chapter 6) Linear Systems of Equations R L Burden & J D Faires 31 / 43

slide-69
SLIDE 69

Terminology Permissible Operations Gaussian Elimination GE/BS Algorithm

Gaussian Elimination with Backward Substitution

A More Precise Description (Cont’d)

The procedure will fail if one of the elements a(1)

11 , a(2) 22 , a(3) 33 , . . . ,

a(n−1)

n−1,n−1, a(n) nn is zero because the step

 Ei − a(k)

i,k

a(k)

kk

(Ek)   → Ei either cannot be performed (this occurs if one of a(1)

11 , . . ., a(n−1) n−1,n−1

is zero), or the backward substitution cannot be accomplished (in the case a(n)

nn = 0).

The system may still have a solution, but the technique for finding it must be altered.

Numerical Analysis (Chapter 6) Linear Systems of Equations R L Burden & J D Faires 31 / 43

slide-70
SLIDE 70

Terminology Permissible Operations Gaussian Elimination GE/BS Algorithm

Illustration of the Gaussian Elimination Procedure

Example

Represent the linear system E1 : x1 − x2 + 2x3 − x4 = −8 E2 : 2x1 − 2x2 + 3x3 − 3x4 = −20 E3 : x1 + x2 + x3 = −2 E4 : x1 − x2 + 4x3 + 3x4 = 4 as an augmented matrix and use Gaussian Elimination to find its solution.

Numerical Analysis (Chapter 6) Linear Systems of Equations R L Burden & J D Faires 32 / 43

slide-71
SLIDE 71

Terminology Permissible Operations Gaussian Elimination GE/BS Algorithm

Illustration of the Gaussian Elimination Procedure

Solution (1/6)

The augmented matrix is ˜ A = ˜ A(1) =     1 −1 2 −1 −8 2 −2 3 −3 −20 1 1 1 −2 1 −1 4 3 4    

Numerical Analysis (Chapter 6) Linear Systems of Equations R L Burden & J D Faires 33 / 43

slide-72
SLIDE 72

Terminology Permissible Operations Gaussian Elimination GE/BS Algorithm

Illustration of the Gaussian Elimination Procedure

Solution (1/6)

The augmented matrix is ˜ A = ˜ A(1) =     1 −1 2 −1 −8 2 −2 3 −3 −20 1 1 1 −2 1 −1 4 3 4     Performing the operations (E2 − 2E1) → (E2), (E3 − E1) → (E3) and (E4 − E1) → (E4)

Numerical Analysis (Chapter 6) Linear Systems of Equations R L Burden & J D Faires 33 / 43

slide-73
SLIDE 73

Terminology Permissible Operations Gaussian Elimination GE/BS Algorithm

Illustration of the Gaussian Elimination Procedure

Solution (1/6)

The augmented matrix is ˜ A = ˜ A(1) =     1 −1 2 −1 −8 2 −2 3 −3 −20 1 1 1 −2 1 −1 4 3 4     Performing the operations (E2 − 2E1) → (E2), (E3 − E1) → (E3) and (E4 − E1) → (E4) gives ˜ A(2) =     1 −1 2 −1 −8 −1 −1 −4 2 −1 1 6 2 4 12    

Numerical Analysis (Chapter 6) Linear Systems of Equations R L Burden & J D Faires 33 / 43

slide-74
SLIDE 74

Terminology Permissible Operations Gaussian Elimination GE/BS Algorithm

Illustration of the Gaussian Elimination Procedure

˜ A(2) =     1 −1 2 −1 −8 −1 −1 −4 2 −1 1 6 2 4 12    

Numerical Analysis (Chapter 6) Linear Systems of Equations R L Burden & J D Faires 34 / 43

slide-75
SLIDE 75

Terminology Permissible Operations Gaussian Elimination GE/BS Algorithm

Illustration of the Gaussian Elimination Procedure

˜ A(2) =     1 −1 2 −1 −8 −1 −1 −4 2 −1 1 6 2 4 12    

Solution (2/6)

The diagonal entry a(2)

22 , called the pivot element, is 0, so the

procedure cannot continue in its present form.

Numerical Analysis (Chapter 6) Linear Systems of Equations R L Burden & J D Faires 34 / 43

slide-76
SLIDE 76

Terminology Permissible Operations Gaussian Elimination GE/BS Algorithm

Illustration of the Gaussian Elimination Procedure

˜ A(2) =     1 −1 2 −1 −8 −1 −1 −4 2 −1 1 6 2 4 12    

Solution (2/6)

The diagonal entry a(2)

22 , called the pivot element, is 0, so the

procedure cannot continue in its present form. But operations (Ei) ↔ (Ej) are permitted, so a search is made of the elements a(2)

32 and a(2) 42 for the first nonzero element.

Numerical Analysis (Chapter 6) Linear Systems of Equations R L Burden & J D Faires 34 / 43

slide-77
SLIDE 77

Terminology Permissible Operations Gaussian Elimination GE/BS Algorithm

Illustration of the Gaussian Elimination Procedure

˜ A(2) =     1 −1 2 −1 −8 −1 −1 −4 2 −1 1 6 2 4 12    

Solution (2/6)

The diagonal entry a(2)

22 , called the pivot element, is 0, so the

procedure cannot continue in its present form. But operations (Ei) ↔ (Ej) are permitted, so a search is made of the elements a(2)

32 and a(2) 42 for the first nonzero element.

Since a(2)

32 = 0, the operation (E2) ↔ (E3) can be performed to

  • btain a new matrix.

Numerical Analysis (Chapter 6) Linear Systems of Equations R L Burden & J D Faires 34 / 43

slide-78
SLIDE 78

Terminology Permissible Operations Gaussian Elimination GE/BS Algorithm

Illustration of the Gaussian Elimination Procedure

˜ A(2) =     1 −1 2 −1 −8 −1 −1 −4 2 −1 1 6 2 4 12    

Numerical Analysis (Chapter 6) Linear Systems of Equations R L Burden & J D Faires 35 / 43

slide-79
SLIDE 79

Terminology Permissible Operations Gaussian Elimination GE/BS Algorithm

Illustration of the Gaussian Elimination Procedure

˜ A(2) =     1 −1 2 −1 −8 −1 −1 −4 2 −1 1 6 2 4 12    

Solution (3/6)

Perform the operation (E2) ↔ (E3) to obtain a new matrix: ˜ A(2)′ =     1 −1 2 −1 −8 2 −1 1 6 −1 −1 −4 2 4 12    

Numerical Analysis (Chapter 6) Linear Systems of Equations R L Burden & J D Faires 35 / 43

slide-80
SLIDE 80

Terminology Permissible Operations Gaussian Elimination GE/BS Algorithm

Illustration of the Gaussian Elimination Procedure

˜ A(2)′ =     1 −1 2 −1 −8 2 −1 1 6 −1 −1 −4 2 4 12    

Numerical Analysis (Chapter 6) Linear Systems of Equations R L Burden & J D Faires 36 / 43

slide-81
SLIDE 81

Terminology Permissible Operations Gaussian Elimination GE/BS Algorithm

Illustration of the Gaussian Elimination Procedure

˜ A(2)′ =     1 −1 2 −1 −8 2 −1 1 6 −1 −1 −4 2 4 12    

Solution (4/6)

Since x2 is already eliminated from E3 and E4, ˜ A(3) will be ˜ A(2)′, and the computations continue with the operation (E4 + 2E3) → (E4), giving ˜ A(4) =     1 −1 2 −1 −8 2 −1 1 6 −1 −1 −4 2 4    

Numerical Analysis (Chapter 6) Linear Systems of Equations R L Burden & J D Faires 36 / 43

slide-82
SLIDE 82

Terminology Permissible Operations Gaussian Elimination GE/BS Algorithm

Illustration of the Gaussian Elimination Procedure

˜ A(4) =     1 −1 2 −1 −8 2 −1 1 6 −1 −1 −4 2 4    

Numerical Analysis (Chapter 6) Linear Systems of Equations R L Burden & J D Faires 37 / 43

slide-83
SLIDE 83

Terminology Permissible Operations Gaussian Elimination GE/BS Algorithm

Illustration of the Gaussian Elimination Procedure

˜ A(4) =     1 −1 2 −1 −8 2 −1 1 6 −1 −1 −4 2 4    

Solution (5/6)

The solution may now be found through backward substitution: x4 = 4 2 = 2

Numerical Analysis (Chapter 6) Linear Systems of Equations R L Burden & J D Faires 37 / 43

slide-84
SLIDE 84

Terminology Permissible Operations Gaussian Elimination GE/BS Algorithm

Illustration of the Gaussian Elimination Procedure

˜ A(4) =     1 −1 2 −1 −8 2 −1 1 6 −1 −1 −4 2 4    

Solution (5/6)

The solution may now be found through backward substitution: x4 = 4 2 = 2 x3 = [−4 − (−1)x4] −1 = 2

Numerical Analysis (Chapter 6) Linear Systems of Equations R L Burden & J D Faires 37 / 43

slide-85
SLIDE 85

Terminology Permissible Operations Gaussian Elimination GE/BS Algorithm

Illustration of the Gaussian Elimination Procedure

˜ A(4) =     1 −1 2 −1 −8 2 −1 1 6 −1 −1 −4 2 4    

Solution (5/6)

The solution may now be found through backward substitution: x4 = 4 2 = 2 x3 = [−4 − (−1)x4] −1 = 2 x2 = [6 − x4 − (−1)x3] 2 = 3

Numerical Analysis (Chapter 6) Linear Systems of Equations R L Burden & J D Faires 37 / 43

slide-86
SLIDE 86

Terminology Permissible Operations Gaussian Elimination GE/BS Algorithm

Illustration of the Gaussian Elimination Procedure

˜ A(4) =     1 −1 2 −1 −8 2 −1 1 6 −1 −1 −4 2 4    

Solution (5/6)

The solution may now be found through backward substitution: x4 = 4 2 = 2 x3 = [−4 − (−1)x4] −1 = 2 x2 = [6 − x4 − (−1)x3] 2 = 3 x1 = [−8 − (−1)x4 − 2x3 − (−1)x2] 1 = −7

Numerical Analysis (Chapter 6) Linear Systems of Equations R L Burden & J D Faires 37 / 43

slide-87
SLIDE 87

Terminology Permissible Operations Gaussian Elimination GE/BS Algorithm

Illustration of the Gaussian Elimination Procedure

Solution (6/6): Some Observations

The example illustrates what is done if a(k)

kk = 0 for some

k = 1, 2, . . . , n − 1.

Numerical Analysis (Chapter 6) Linear Systems of Equations R L Burden & J D Faires 38 / 43

slide-88
SLIDE 88

Terminology Permissible Operations Gaussian Elimination GE/BS Algorithm

Illustration of the Gaussian Elimination Procedure

Solution (6/6): Some Observations

The example illustrates what is done if a(k)

kk = 0 for some

k = 1, 2, . . . , n − 1. The kth column of ˜ A(k−1) from the kth row to the nth row is searched for the first nonzero entry.

Numerical Analysis (Chapter 6) Linear Systems of Equations R L Burden & J D Faires 38 / 43

slide-89
SLIDE 89

Terminology Permissible Operations Gaussian Elimination GE/BS Algorithm

Illustration of the Gaussian Elimination Procedure

Solution (6/6): Some Observations

The example illustrates what is done if a(k)

kk = 0 for some

k = 1, 2, . . . , n − 1. The kth column of ˜ A(k−1) from the kth row to the nth row is searched for the first nonzero entry. If a(k)

pk = 0 for some p,with k + 1 ≤ p ≤ n, then the operation

(Ek) ↔ (Ep) is performed to obtain ˜ A(k−1)′.

Numerical Analysis (Chapter 6) Linear Systems of Equations R L Burden & J D Faires 38 / 43

slide-90
SLIDE 90

Terminology Permissible Operations Gaussian Elimination GE/BS Algorithm

Illustration of the Gaussian Elimination Procedure

Solution (6/6): Some Observations

The example illustrates what is done if a(k)

kk = 0 for some

k = 1, 2, . . . , n − 1. The kth column of ˜ A(k−1) from the kth row to the nth row is searched for the first nonzero entry. If a(k)

pk = 0 for some p,with k + 1 ≤ p ≤ n, then the operation

(Ek) ↔ (Ep) is performed to obtain ˜ A(k−1)′. The procedure can then be continued to form ˜ A(k), and so on.

Numerical Analysis (Chapter 6) Linear Systems of Equations R L Burden & J D Faires 38 / 43

slide-91
SLIDE 91

Terminology Permissible Operations Gaussian Elimination GE/BS Algorithm

Illustration of the Gaussian Elimination Procedure

Solution (6/6): Some Observations

The example illustrates what is done if a(k)

kk = 0 for some

k = 1, 2, . . . , n − 1. The kth column of ˜ A(k−1) from the kth row to the nth row is searched for the first nonzero entry. If a(k)

pk = 0 for some p,with k + 1 ≤ p ≤ n, then the operation

(Ek) ↔ (Ep) is performed to obtain ˜ A(k−1)′. The procedure can then be continued to form ˜ A(k), and so on. If a(k)

pk = 0 for each p, it can be shown that the linear system does

not have a unique solution and the procedure stops.

Numerical Analysis (Chapter 6) Linear Systems of Equations R L Burden & J D Faires 38 / 43

slide-92
SLIDE 92

Terminology Permissible Operations Gaussian Elimination GE/BS Algorithm

Illustration of the Gaussian Elimination Procedure

Solution (6/6): Some Observations

The example illustrates what is done if a(k)

kk = 0 for some

k = 1, 2, . . . , n − 1. The kth column of ˜ A(k−1) from the kth row to the nth row is searched for the first nonzero entry. If a(k)

pk = 0 for some p,with k + 1 ≤ p ≤ n, then the operation

(Ek) ↔ (Ep) is performed to obtain ˜ A(k−1)′. The procedure can then be continued to form ˜ A(k), and so on. If a(k)

pk = 0 for each p, it can be shown that the linear system does

not have a unique solution and the procedure stops. Finally, if a(n)

nn = 0, the linear system does not have a unique

solution, and again the procedure stops.

Numerical Analysis (Chapter 6) Linear Systems of Equations R L Burden & J D Faires 38 / 43

slide-93
SLIDE 93

Terminology Permissible Operations Gaussian Elimination GE/BS Algorithm

Outline

1

Notation & Basic Terminology

2

3 Operations to Simplify a Linear System of Equations

3

Gaussian Elimination Procedure

4

The Gaussian Elimination with Backward Substitution Algorithm

Numerical Analysis (Chapter 6) Linear Systems of Equations R L Burden & J D Faires 39 / 43

slide-94
SLIDE 94

Terminology Permissible Operations Gaussian Elimination GE/BS Algorithm

Gaussian Elimination with Backward Substitution Algorithm (1/3)

To solve the n × n linear system E1 : a11x1 + a12x2 + · · · + a1nxn = a1,n+1 E2 : a21x1 + a22x2 + · · · + a2nxn = a2,n+1 . . . . . . . . . . . . . . . En : an1x1 + an2x2 + · · · + annxn = an,n+1

Numerical Analysis (Chapter 6) Linear Systems of Equations R L Burden & J D Faires 40 / 43

slide-95
SLIDE 95

Terminology Permissible Operations Gaussian Elimination GE/BS Algorithm

Gaussian Elimination with Backward Substitution Algorithm (1/3)

To solve the n × n linear system E1 : a11x1 + a12x2 + · · · + a1nxn = a1,n+1 E2 : a21x1 + a22x2 + · · · + a2nxn = a2,n+1 . . . . . . . . . . . . . . . En : an1x1 + an2x2 + · · · + annxn = an,n+1

INPUT

number of unknowns and equations n; augmented matrix A = [aij], where 1 ≤ i ≤ n and 1 ≤ j ≤ n + 1.

Numerical Analysis (Chapter 6) Linear Systems of Equations R L Burden & J D Faires 40 / 43

slide-96
SLIDE 96

Terminology Permissible Operations Gaussian Elimination GE/BS Algorithm

Gaussian Elimination with Backward Substitution Algorithm (1/3)

To solve the n × n linear system E1 : a11x1 + a12x2 + · · · + a1nxn = a1,n+1 E2 : a21x1 + a22x2 + · · · + a2nxn = a2,n+1 . . . . . . . . . . . . . . . En : an1x1 + an2x2 + · · · + annxn = an,n+1

INPUT

number of unknowns and equations n; augmented matrix A = [aij], where 1 ≤ i ≤ n and 1 ≤ j ≤ n + 1.

OUTPUT

solution x1, x2, . . . , xn or message that the linear system has no unique solution.

Numerical Analysis (Chapter 6) Linear Systems of Equations R L Burden & J D Faires 40 / 43

slide-97
SLIDE 97

Terminology Permissible Operations Gaussian Elimination GE/BS Algorithm

Gaussian Elimination with Backward Substitution Algorithm (2/3)

Step 1 For i = 1, . . . , n − 1 do Steps 2–4: (Elimination process)

Numerical Analysis (Chapter 6) Linear Systems of Equations R L Burden & J D Faires 41 / 43

slide-98
SLIDE 98

Terminology Permissible Operations Gaussian Elimination GE/BS Algorithm

Gaussian Elimination with Backward Substitution Algorithm (2/3)

Step 1 For i = 1, . . . , n − 1 do Steps 2–4: (Elimination process) Step 2 Let p be the smallest integer with i ≤ p ≤ n and api = 0 If no integer p can be found then OUTPUT (‘no unique solution exists’)

STOP

Numerical Analysis (Chapter 6) Linear Systems of Equations R L Burden & J D Faires 41 / 43

slide-99
SLIDE 99

Terminology Permissible Operations Gaussian Elimination GE/BS Algorithm

Gaussian Elimination with Backward Substitution Algorithm (2/3)

Step 1 For i = 1, . . . , n − 1 do Steps 2–4: (Elimination process) Step 2 Let p be the smallest integer with i ≤ p ≤ n and api = 0 If no integer p can be found then OUTPUT (‘no unique solution exists’)

STOP

Step 3 If p = i then perform (Ep) ↔ (Ei)

Numerical Analysis (Chapter 6) Linear Systems of Equations R L Burden & J D Faires 41 / 43

slide-100
SLIDE 100

Terminology Permissible Operations Gaussian Elimination GE/BS Algorithm

Gaussian Elimination with Backward Substitution Algorithm (2/3)

Step 1 For i = 1, . . . , n − 1 do Steps 2–4: (Elimination process) Step 2 Let p be the smallest integer with i ≤ p ≤ n and api = 0 If no integer p can be found then OUTPUT (‘no unique solution exists’)

STOP

Step 3 If p = i then perform (Ep) ↔ (Ei) Step 4 For j = i + 1, . . . , n do Steps 5 and 6: Step 5 Set mji = aji/aii Step 6 Perform (Ej − mjiEi) → (Ej)

Numerical Analysis (Chapter 6) Linear Systems of Equations R L Burden & J D Faires 41 / 43

slide-101
SLIDE 101

Terminology Permissible Operations Gaussian Elimination GE/BS Algorithm

Gaussian Elimination with Backward Substitution Algorithm (3/3)

Step 7 If ann = 0 then OUTPUT (‘no unique solution exists’)

Numerical Analysis (Chapter 6) Linear Systems of Equations R L Burden & J D Faires 42 / 43

slide-102
SLIDE 102

Terminology Permissible Operations Gaussian Elimination GE/BS Algorithm

Gaussian Elimination with Backward Substitution Algorithm (3/3)

Step 7 If ann = 0 then OUTPUT (‘no unique solution exists’) Step 8 Set xn = an,n+1/ann (Start backward substitution)

Numerical Analysis (Chapter 6) Linear Systems of Equations R L Burden & J D Faires 42 / 43

slide-103
SLIDE 103

Terminology Permissible Operations Gaussian Elimination GE/BS Algorithm

Gaussian Elimination with Backward Substitution Algorithm (3/3)

Step 7 If ann = 0 then OUTPUT (‘no unique solution exists’) Step 8 Set xn = an,n+1/ann (Start backward substitution) Step 9 For i = n − 1, . . . , 1 set xi =

  • ai,n+1 − n

j=i+1 aijxj

aii

Numerical Analysis (Chapter 6) Linear Systems of Equations R L Burden & J D Faires 42 / 43

slide-104
SLIDE 104

Terminology Permissible Operations Gaussian Elimination GE/BS Algorithm

Gaussian Elimination with Backward Substitution Algorithm (3/3)

Step 7 If ann = 0 then OUTPUT (‘no unique solution exists’) Step 8 Set xn = an,n+1/ann (Start backward substitution) Step 9 For i = n − 1, . . . , 1 set xi =

  • ai,n+1 − n

j=i+1 aijxj

aii Step 10

OUTPUT (x1, . . . , xn)

(Procedure completed successfully)

STOP

Numerical Analysis (Chapter 6) Linear Systems of Equations R L Burden & J D Faires 42 / 43

slide-105
SLIDE 105

Questions?