100% found this document useful (1 vote)
315 views29 pages

Gaussian Elimination : Viviana Marcela Bayona Cardenas

The document discusses Gaussian elimination, a method for solving systems of linear equations. It involves rewriting the system of equations in matrix form and then performing row operations to transform the matrix into upper triangular form. This upper triangular form allows the variables to be solved for one by one through back substitution, from the last variable down to the first. An example applying Gaussian elimination to a 3x3 system is provided.

Uploaded by

vimaba
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
100% found this document useful (1 vote)
315 views29 pages

Gaussian Elimination : Viviana Marcela Bayona Cardenas

The document discusses Gaussian elimination, a method for solving systems of linear equations. It involves rewriting the system of equations in matrix form and then performing row operations to transform the matrix into upper triangular form. This upper triangular form allows the variables to be solved for one by one through back substitution, from the last variable down to the first. An example applying Gaussian elimination to a 3x3 system is provided.

Uploaded by

vimaba
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 29

…GAUSSIAN

ELIMINATION…

VIVIANA MARCELA BAYONA CARDENAS


Linear equations…
A set of n linear equations in n variables, xi
a11 x1  a12 x2  a1n xn  b1
a21x1  a22 x2  a2n xn  b2
 
an1 x1  an2 x2  ann xn  bn

can be written in matrix form, Ax = b:

 a11 a12  a1n x1  b1 


a21 a22 a2n x2  b2 
  
   
  
 x  b 
an1 an2
 ann  n   n 
…Linear equations
e.g. the 2  2 system of linear equations
2x  y  5
xy  3
can be written in matrix form, Ax = b:
2 1x 5
 
1 1
 y 3
    
To solve, we premultiply the equation by A–1, A–
1
Ax = A–1b, giving x = A–1b: 1 1
2 1 2 1x 2 1 5

   
  1 1 

1 1 
1 1  
y  3

x 1 1 15 2
y  1 2 3 1
  1     
Matrix equations…
We can use this method for matrix equations of the
form AX = B: e.g. find the matrix X if
5 4 1 1 4
 X  0 1 2
2 2
 
 
We can get rid of the matrix to the left of X by
premultiplying each side of the equation by the

inverse 5 415 4 5 411 1 4
   X  2 2 0
 2

2 2  
2 2     1 

5 411 1 4 1 2 41 1 4


Thus X  2 2 0 1 2  2 5 0 1 2
    2   
 1 3 0
 1 3.5 1
 
…Matrix equations
Similarly for 4  1 e.g.
5XA = B: 1
find the matrix X if
X2 2 0 1 
  4 2 

We can remove matrix



 A
1
 by1postmultiplying
1 1
 each
 5 4 5 4  inverse, 5 4
0 1 2A–12
side of theXequation

2
 2 
2
 2
by 
 4 2 
its 

1 1 1
 1 11   2 4.5
5 4 2 4
X  0 1 2 2  0 1  2 5  1 2.5 
Thus
 4 2   4 2 2   2 3 
Solving n  n linear equations
We can solve a general system of n  n linear equations by
writing it in matrix form, AX = B, and premultiplying the
matrix equation by the inverse of the matrix of
coefficients, A–1.
i.e. if AX = B
then A–1AX = A–1B,
but A–1A = I
so X = A–1B
However, this method is almost never used because it is
inefficient and prone to rounding errors.
We shall investigate Gaussian elimination, a more
efficient and accurate method for solving linear equations.
Visualising n  n linear equations
2 variables • 3 variables
• Solution is at the
Solution is at the intersection of 3 planes
intersection of 2
lines
Gaussian elimination…
Consider a system of 3  3 linear equations in matrix
form, Ax = b:
a11 a12 a13 x1  b1 
a21 a22 a23 x2  b2 

a31 a32 a33 

x 3 
 
b3 

To make book-keeping simpler, we represent the
system by an augmented matrix:

a11 a12 a13 b1 
a21 a22 a23 b2 

a31 a32 a33 b3 

…Gaussian elimination…
We can zero the first column by subtracting a21/a11 times
the first row from the second row, and subtracting a31/a11
times the first row from the third row (primes indicate
changed values)
a11 a12 a13 b1 
 0 a22 a23
 b2

 0 a32 a33 b3

Similarly, we can now zero the second column by
subtracting a’32/a’22 times the first row from the third row

(double primes indicate changed values), forming an
upper triangular matrix:
a11 a12 a13 b1 
 0 a22  b2
a23

 0 0 a33 b3

…Gaussian elimination…
The last row represents an equation in a single variable
a11 a12 a13 b1 
 0 a
22  b2
a23

 0 0 a33 b3

a”33 x3 = b”3
which can be solved as x3 = b”3 / a”33
The second row represents an equation in two variables

a’22 x2 + a’23 x3 = b’2
Since the variable x3 has already been found in the previous
step, x2 can be solved as
x2 = (b’2 – a’23 x3) / a’22
…Gaussian elimination
The first row represents an equation in three variables
a11 x1 + a12 x2 + a13 x3 = b1
Since the variables x2 and x3 have already been found
in the previous steps, x1 can be solved as
x1 = (b1 –  a12 x2 – a13 x3) / a11
This process of solving an upper triangular matrix
equation is called back substitution.
Gaussian elimination: example 1…
Solve the system of equations
x yz  4
x  y  z  2
2x  8y  z  19

Represent the system as an augmented matrix:

 1 1 1 4 
1 1 1 2
2 8 1 19 
We introduce a lower triangular matrix, L, to record
row multipliers in the • positions
 1 0 0
 1 0
  1
…Gaussian elimination: example 1…
Calculate the row multipliers and record them in the L
matrix, l21 = a21/a11 and l31 = a31/a11
1 0 0
L  1 1 0
2  1
Zero the first column by subtracting l21 = a21/a11 times
the first row from the second row, and subtracting

l31 = a31/a11 times the first row from the third row
1 1 1 4  1 1 1 4 
1 1 1 2 0 2 2 6
2 8 1 19  0 6 1 11 
…Gaussian elimination: example 1…
Calculate the row multiplier and record it in the L
matrix, l32 = a’32/a’22
1 0 0
L  1 1 0
2 3 1
Zero the second column by subtracting l32 = a’32/a’22
times the second row from the third row, forming an

upper triangular matrix
1 1 1 4  1 1 1 4 
0 2 2 6 0 2 2 6
0 6 1 11  0 0 7 7
…Gaussian elimination: example 1
 Back substitute
1 1 1 4 
0 2 2 6
0 0 7 7
 The last row represents an equation in a single variable, a”33 z = b”3,
which can be solved as z = b”3 / a”33 = –7 / –7 = 1
 row represents an equation in two variables,
 The second
a’22 y + a’23 z = b’2, which can be solved as
y = (b’2 – a’23 z) / a’22 = (–6 + 2) / (–2) = 2
 The first row represents an equation in three variables
a11 x + a12 y + a13 z = b1, which can be solved as
x1 = (b1 –  a12 y – a13 z) / a11 = (4 – 2 – 1) / 1 = 1
 The solution is thus x = 1, y = 2, z = 1.
Gaussian elimination: example 2…
Solve the system of equations
2x  5y  3z  7
x  2.5y 1.5z  7.5
2x  7y  4.5z  12
Represent the system as an augmented matrix:

 2 5 3 7 
1 2.5 1.5 7.5
2 7 4.5 12 


…Gaussian elimination: example 2…
Calculate the row multipliers and record them in the L
matrix, l21 = a21/a11 and l31 = a31/a11
 1 0 0
L  0.5 1 0
 1  1

Zero the first column by subtracting l21 = a21/a11 times


the
 first row from the second row, and subtracting
l31 = a31/a11 times the first row from the third row
2 5 3 7  2 5 3 7 
1 2.5 1.5 7.5 0 5 3 11
2 7 4.5 12  0 2 1.5 5 
…Gaussian elimination: example 2…
Calculate the row multiplier and record it in the L
matrix, l32 = a’32/a’22
 1 0 0
L  0.5 1 0
 1 0.4 1

Zero the second column by subtracting l32 = a’32/a’22


times the second row from the third row, forming an

upper triangular
2 5matrix
3 7  2 5 3 7 
0 5 3 11 0 5 3 11
0 2 1.5 5  0 0 0.3 0.6 
…Gaussian elimination: example 2
Back substitute 2 5 3 7 
0 5 3 11
0 0 0.3 0.6 

The last row can be solved as z = b”3 / a”33 = 0.6 / 0.3 = 2


The second
 row can be solved as
y = (b’2 – a’23 z) / a’22 = (–11 + 6) / (–5) = 1
The first row can be solved as
x = (b1 – a12 y – a13 z) / a11 
= (7 – 5 – 6) / 2 = –2
The solution is thus x = –2, y = 1, z = 2.
Gaussian elimination: example 3…
Solve the system of equations
0.0001x  0.0001y 1.99z  10
2x  2.001y  z  1
4x  3y  2.982z  1

Work to 4 significant figures and give the answer to 3.


Check the answer by substituting into the original

equation.
Represent the system as an augmented matrix:
0.0001 0.0001 1.99 10
 2 2.001 1 1 
 4 3 9.282 1 
…Gaussian elimination: example 3…
Calculate the row multipliers and record them in the L
matrix, l21 = a21/a11 and l31 = a31/a11
 1 0 0
L  20, 000 1 0

40, 000  1 
Zero the first column by subtracting l21 times the first row
from the second row, and subtracting l31 times the first row
from the third

0.0001 0.0001 1.99 10
 2 2.001 1 1 
 4 3 9.282 1 
0.0001 0.0001 1.99 10 
 0 0.001 39, 800 200, 000

 0 1 79, 600 400, 000

…Gaussian

elimination: example 3…
Calculate the row multiplier and record it in the L
matrix, l32 = a’32/a’22
 1 0 0
L  20, 000 1 0

40, 000 1, 000 1

Zero the second column by subtracting l32 = a’32/a’22
times the second row from the third row, forming an
  matrix
upper triangular 
0.0001 0.0001 1.99 10
 0 0.001 39, 800 200, 000

 0 1 79, 600 400, 000

0.0001 0.0001 1.99 10 
 0 0.001 39, 800 200, 000 

 0 0 39, 880, 000 200, 400, 000

…Gaussian elimination: example 3… 
0.0001 0.0001 1.99 10
Back substitute  0 0.001 39, 800 200, 000 

 0 0 39, 880, 000 200, 400, 000


The last row can be solved as z = –39,880,000 / –


200,400,000 = 5.025
 row can be solved as
The second
y = (–200,000 + 199,995) / (0.001) = –5,000
The first row can be solved as
x = (b1 – a12 y – a13 z) / a11 
= (10 + 0.5 – 9.99975) / 0.0001 = 5,003
The computed solution is thus
x = 5,003, y = –5,000, z = 5.03
…Gaussian elimination: example 3
Check the computed solution against the original
equations 0.0001 0.0001 1.99 x 10
 2 2.001 1 y 1 
 4 3 9.282
z 
 1 
0.0001 0.0001 1.99 5, 000   10 
 2 2.001 1 5, 000  0.03 
 4 3 9.282
 5.03  5, 015
Numerical rounding has caused these errors.
Working to more significant figures gives
x = –7.939 c.f. 5,000

y = 5.922 c.f. –5,000
z = 5.025 c.f. 5.03
Geometric interpretation
Ill-conditioning, as seen in example 3, can be
interpreted geometrically:
The shaded red area represents uncertainty
in the lines’ positions due to rounding errors.
The solid red area represents
where the intersection may be
found due to these errors.
The closer to parallel the
lines are, the larger the
possible error.
Geometric interpretation: 1 solution
Gaussian elimination
to the form
   
0   
0 0  
where none of the
diagonal elements are
zero
 We get the usual form
of the augmented
matrix and can fine a
unique solution by
back substitution
Geometric interpretation: 0 solution
Gaussian elimination
to the form
   
0   
0 0 0 
where b3 is not zero
We end up with
 0 z = non-zero
i.e. no solution can
exist because at least 2
planes, or 3 lines of
intersection, are
parallel
Geometric

interpretation: ∞ solution
Gaussian elimination
to the form
   
0   
0 0 0 0
i.e. b3 is zero
We end up with
 0 z = zero
i.e. an infinite number
of solutions exist
because this is always
true for any value of z
REFERENCE
http
://es.wikipedia.org/wiki/Eliminaci%C3%B3n_de_Gaus
s-Jordan

http://www.monografias.com/trabajos72/resolucion-si
stemas-metodo-gauss-jordan/resolucion-sistemas-me
todo-gauss-jordan.shtml
 
http://cbi.azc.uam.mx/archivos/varios/ProblemarioW
.pdf

You might also like