25
CALCULUS – II Gauss Elimination by Dr. Eman Saad & Dr. Shorouk Ossama

CALCULUS – II Gauss Elimination by Dr. Eman Saad & Dr. Shorouk Ossama

Embed Size (px)

Citation preview

CALCULUS – IIGauss Elimination

by

Dr. Eman Saad &

Dr. Shorouk Ossama

• Gauss Elimination:

We need write the equations in form of

augmented matrix for the system. The fourth

column consists of the constant on the right-

hand sides.

• The elementary operations referred to

previously become elementary row operations

on the matrix. The final matrix is said to be in

echelon form: that is, it has zeros below the

diagonal elements starting from the top left.

We can solve the equations by back

substation.

• Examples For Echelon Form :

The following matrices are in reduced row

echelon form.

• The following matrices are in row echelon

form but not reduced row echelon form.

Example: Find the solution by using gauss elimination

2 R1 + R2 = R`2

- R1 + R3 = R`3

R1 - R3 = R`1

-(1/7) R3 + R2 = R`2

-(2/7) R2 + R3 = R`3 (-2) R2 + R1 = R`1

- (7/23) R3 = R`3

- (1/7) R2 = R`2

by back substation x3 = 2 x2 = -1 x1 = 1

1

2

3

4

5

X Y Z=

back substation

Three Equations:

0 + 0 + Z = 2

0 + Y + 0 = -1

X + 0 + 0 = 1

Example: Using gauss elimination & back substitution,

solve the set of equations

-2 R1 + R2 = R`2 (-2/3) R3 + R4 = R`4

R2↔R3(-1/3) R3 = R`3

(3/5) R4 = R`4

R4 – R2= R`4

x4 = 3 x3 = 2 x2 = 1

x1 = -1

2

3

4

5

6

0 1 -1 2 5

0 1 -1 2 5

0 1 -1 2 5

0 0 -2 1 -1

0 0 0 5/3 5

0 0 0 1 3

X1 X2 X3

=

back substation

0 + 0 + 0 + X4 = 3

0 + 0 + X3 + 1/3 X4 = 3

0 + X2 + X3 + X4 = 6

X1 + X2 + 2X3 + 0 = 4

0 0 0 1 3

X4

• For two equations in two unknowns the

occurrences of unique solutions are easy to

detect.

• For higher-order sets of equations these

possibilities are not so obvious.

Consider the set of equations:

det A = = zero

• So the Cramer’s Rule will fail, although there

still may be solutions.

• We can determine whether solutions exist

more readily by using Gaussian Elimination.

• In this case the application of row operations

on the augmented matrix leads to:

-2 R1 + R2 = R`2

- R1 + R3 = R`3

By Back Substation

Row 3 is impossible to be satisfied

0 = 1

No Solution

(-1/2) R2 + R3 = R`3

1 1 -1 3 0 -4 1 -40 -2 3 -1

1

2

4

1 1 -1 33 -1 3 51 -1 2 2

1 1 -1 3 0 -4 6 -40 0 0 1

6

-2 R1 + R2 = R`2

- R1 + R3 = R`3By Back Substation

Row 3 is consistentRow 2 is -4y+6z=2

Hence, y = -1/4 ( 2 – 6z )

From Row 1, X = 1 – y + z = 3/2 – ½ zThus, z can take any value, say t

So the full solution set is:

(-1/2) R2 + R3 = R`3

1 1 -1 1 0 -4 6 2 0 0 0 0

1

2

1 1 -1 13 -1 3 51 -1 2 2

Infinite Number of Solution

Advantage of using gauss elimination more than cramer’s rule when the number of equations differs from the number of unknowns.

-3 R1 + R2 = R`1

-R1 + R3 = R`3

- R1 + R4 = R`4

Row 4 is consistent, while row 3 is implies z=3.

Then y and x can be found by back substitution row2 and 1

So: y= 4 , x=0

(-1/2) R2 + R3 = R`3

1 1 -1 1 0 -4 6 2

0 -2 3 0 0 -1 2 3/2

1

2

1 1 -1 13 -1 3 51 -1 2 2 1 0 1 3

1 1 -1 10 -4 6 2

0 0 -2 -6 0 0 0 0

Show that the following equations are inconsistent:

- R1 + R2 = R`2

-3 R1 + R3 = R`3

Row 3, 0 ≠ 2The system is

inconsistent

-2 R2 + R3 = R`3

1

2

1 1 -1 2 11 -2 3 -1 43 -3 7 0 7

1 1 1 2 10 -3 2 -3 30 -6 4 -6 4

1 1 12 1 10 -3 2 -3 30 0 0 0 -2

Determine the complete sets of values for a and b which make the equations :

-2 R1 + R2 = R`2

- R1 + R3 = R`3

1. System has unique solution if:

a ≠ -1, then z= (b-1/a+1)

2. System is inconsistency if:a = -1 and b ≠ 1

3. System has infinite solutions

If: a = -1 and b = 1

- R2 + R3 = R`3

1

2

1 -2 3 22 -1 2 31 1 a b

1 -2 3 10 3 -4 -1

0 0 a+1 b-1

Homogeneous Linear Systems:

A system of linear equations is said to be homogeneous if the

constant terms are all zero; that is, the system has the form:

Every homogeneous system of linear equations is consistent

because all such systems have x1=0,x2=0,…,xn=0 as a solution.

This solution is called the trivial solution; if there are other

solutions, they are called non-trivial solutions.

Because a homogeneous linear system always has the trivial solution, there are only two possibilities for its solutions:

• The system has only the trivial solution.• The system has infinitely many solutions in addition to the trivial solution.

In the special case of a homogeneous linear system of two equations in two unknowns, say:

the graphs of the equations are lines through the origin, and the trivial solution corresponds to the point of intersection at

the origin.

After solving the system, the corresponding system of equations is:

Solving for the leading variables we obtain:

Note that the trivial solution results when r = s = t = 0

• Any set of equations AX=0 is known as a

homogeneous set; it is a set of linear

equations with zero right-hand sides. So the

equations always have trivial solution x=o, but

there may exist non-trivial solutions. What are

the conditions for their existence.

- R1 + R2 = R`2

- R1 + R3 = R`3

System is non-trivial solutions if and if only:

a = 5, put z= tBy back substitution

Y – Z = 0Y = z = t

So, x = -y –z = -2tFor any t

the solution is non-trivial

if t ≠ 0

4 R2 + R3 = R`3

1

2

1 1 1 01 2 0 01 -3 a 0

1 1 1 00 1 -1 0

0 0 a-5 0

We therefore have the following test:

For Homogeneous equations AX = 0, where A

is square:

• If det A = 0, there is an infinite number of

non-trivial solutions.

• det A ≠ 0, No solution ( trivial solution ).

Non-Homogeneous System AX = b

The system might has:1. One Solution = Unique Solution

2. Infinite Solutions = non-trivial Solution

3. No Solution = Trivial Solution (det A ≠ 0)

.. .. .. ..

.. .. .. ..

0 0

.. .. .. ..

.. .. .. ..

0 0 0 0

Consistent

.. .. .. ..

.. .. .. ..

0 0 0In Consistent

Homogeneous System AX = 0

The system might has:1. No Solution = Trivial Solution

at det A ≠ 0

2. Infinite Solutions = non-trivial Solutionat det A = 0

Note: If the matrix is non- square (n ≠ m) It is non-trivial Solution and used Gauss

Elimination

Thanks