Solve Gaussian Elimination w/Pivoting: Problem Explained

In summary, the conversation is about using Gaussian elimination with pivoting technique to solve a question. The person initially switched rows to make a11 and a22 the maximum values, but encountered a problem with a31 becoming -2/9. Another person suggests swapping rows 10 and 12 to get a better result, and reminds the first person to keep the goal of ending up with an identity matrix in mind. The first person clarifies that they were asked to reduce the matrix to upper triangular form only.
  • #1
fonseh
529
2

Homework Statement


I am asked to solve this question using pivoting technique ... so , in I , I switched the R1 and R2 so that a11 is max , in III , i switched R9 nad R10 , so that a22 is max . But , in IV , i found that the a31 become -2/9 , which is not 0 anymore , what's wrong with my working ?

Homework Equations

The Attempt at a Solution

 

Attachments

  • u7aqN2o.jpg
    u7aqN2o.jpg
    39.6 KB · Views: 412
  • IMG_20170219_101925_DRO.jpg
    IMG_20170219_101925_DRO.jpg
    30.1 KB · Views: 400
Physics news on Phys.org
  • #2
Can someone edit the title ? change it to gaussian elimination with pivoting . I discovered that pivoting is abit misleading
 
  • #3
It seems to me you forgot the aim of gaussian elimination: you want to end up with the identity matrix at the left. So the operation ##{-a_{41}\over \ a_{11}} ...## doesn't really fit in that scheme. A better result (namely a 1 in position 11) is obtained with ##{-a_{41}\over a_{11}/2}...##
 
  • Like
Likes fonseh
  • #4
BvU said:
It seems to me you forgot the aim of gaussian elimination: you want to end up with the identity matrix at the left. So the operation ##{-a_{41}\over \ a_{11}} ...## doesn't really fit in that scheme. A better result (namely a 1 in position 11) is obtained with ##{-a_{41}\over a_{11}/2}...##
why A better result (namely a 1 in position 11) is obtained with ##{-a_{41}\over a_{11}/2}...## ? why it become a11 divide by 2 ?
 
  • #5
BvU said:
It seems to me you forgot the aim of gaussian elimination: you want to end up with the identity matrix at the left. So the operation ##{-a_{41}\over \ a_{11}} ...## doesn't really fit in that scheme. A better result (namely a 1 in position 11) is obtained with ##{-a_{41}\over a_{11}/2}...##
Can you explain further ?
 
  • #6
Sure. I think I was a bit hasty: nothing wrong with a 2 in position 11.

So you are fine with your matrix II and II. I don't see what you want to exchange row 9 and 10, though.
You want ##a_{22}## to have a large value but that's only useful if the preceding ##a_{21}## is zero.

Instead, I would exchange rows 10 and 12 to get a -8 in position 22 preceded by zeroes, and a 3 in position 33 preceded by zeroes -- and without much arithmetic :smile: ; after that it's bit messier.
 
  • #7
fonseh said:

Homework Statement


I am asked to solve this question using pivoting technique ... so , in I , I switched the R1 and R2 so that a11 is max , in III , i switched R9 nad R10 , so that a22 is max . But , in IV , i found that the a31 become -2/9 , which is not 0 anymore , what's wrong with my working ?

Homework Equations

The Attempt at a Solution


I will not read your posted images, but I will tell you how to do Gaussian elimination (with pivoting).
(1) Bring the element with largest ##|a_{i1}|## into position (1,1) by swapping two rows if necessary.
(2) Zero out the (possibly new) elements ##a_{21}, a_{31}, \ldots, a_{n1}## by row operations.
(3) Now in the (new) rows ##2, \ldots, n##, swap two rows (if necessary) to bring the largest (new) ##a_{2,2}, a_{3,2}, \ldots, a_{n,2}## into position (2,2).
(4) Zero out the (new) elements ##a_{3,2}, \ldots, a_{n,2}## by row operations, etc.

Note that once you have pivoted in row ##i## (that is, zeroed out the elements below ##a_{ii}##), row ##i## is no longer involved in any more operations: no more interchanging row ##i## with some other row again, no more row operations involving the elements in column ##i##, etc.

I will look further at your work if you type it out, in accordance with PF standards.
 
Last edited:
  • Like
Likes fonseh
  • #8
BvU said:
Sure. I think I was a bit hasty: nothing wrong with a 2 in position 11.

So you are fine with your matrix II and II. I don't see what you want to exchange row 9 and 10, though.
You want ##a_{22}## to have a large value but that's only useful if the preceding ##a_{21}## is zero.

Instead, I would exchange rows 10 and 12 to get a -8 in position 22 preceded by zeroes, and a 3 in position 33 preceded by zeroes -- and without much arithmetic :smile: ; after that it's bit messier.
Actually I swap row10 and row9 to get the max a22 , which is 9 , compare to a12 , a32 and a42...
 
  • #9
Ray Vickson said:
I will not read your posted images, but I will tell you how to do Gaussian elimination (with pivoting).
(1) Bring the element with largest ##|a_{i1}|## into position (1,1) by swapping two rows if necessary.
(2) Zero out the (possibly new) elements ##a_{21}, a_{31}, \ldots, a_{n1}## by row operations.
(3) Now in the (new) rows ##2, \ldots, n##, swap two rows (if necessary) to bring the largest (new) ##a_{2,2}, a_{3,2}, \ldots, a_{n,2}## into position (2,2).
(4) Zero out the (new) elements ##a_{3,2}, \ldots, a_{n,2}## by row operations, etc.

Note that once you have pivoted in row ##i## (that is, zeroed out the elements below ##a_{ii}##), row ##i## is no longer involved in any more operations: no more interchanging row ##i## with some other row again, no more row operations involving the elements in column ##i##, etc.

I will look further at your work if you type it out, in accordance with PF standards.

Is it a special rule ? It's not written in my book
 
  • #10
Keep the goal of the elimination procedure in mind: you want to end up with the identity matrix on the left. Did I mention that already ?
 
  • Like
Likes fonseh
  • #11
BvU said:
Keep the goal of the elimination procedure in mind: you want to end up with the identity matrix on the left. Did I mention that already ?
Yes , this is one of the method . But , i am asked to reduce it to become upper triangular matrix only
 
  • #12
BvU said:
Sure. I think I was a bit hasty: nothing wrong with a 2 in position 11.

So you are fine with your matrix II and II. I don't see what you want to exchange row 9 and 10, though.
You want ##a_{22}## to have a large value but that's only useful if the preceding ##a_{21}## is zero.

Instead, I would exchange rows 10 and 12 to get a -8 in position 22 preceded by zeroes, and a 3 in position 33 preceded by zeroes -- and without much arithmetic :smile: ; after that it's bit messier.
So , the way i change the row 9 and row 10 is completely wrong ?
 
  • #13
Ray Vickson said:
I will not read your posted images, but I will tell you how to do Gaussian elimination (with pivoting).
(1) Bring the element with largest ##|a_{i1}|## into position (1,1) by swapping two rows if necessary.
(2) Zero out the (possibly new) elements ##a_{21}, a_{31}, \ldots, a_{n1}## by row operations.
(3) Now in the (new) rows ##2, \ldots, n##, swap two rows (if necessary) to bring the largest (new) ##a_{2,2}, a_{3,2}, \ldots, a_{n,2}## into position (2,2).
(4) Zero out the (new) elements ##a_{3,2}, \ldots, a_{n,2}## by row operations, etc.

Note that once you have pivoted in row ##i## (that is, zeroed out the elements below ##a_{ii}##), row ##i## is no longer involved in any more operations: no more interchanging row ##i## with some other row again, no more row operations involving the elements in column ##i##, etc.

I will look further at your work if you type it out, in accordance with PF standards.

Do you mean in my working , i have pivoted the row 1 (make the a11 has the largest vaule compared to a21 , a31 and a41), so i can't change ( swap the row 1 with other row) anymore ?
So , in my working , swapping R10 and R9 is wrong ?
Please refer to this one :
https://www.physicsforums.com/attachments/img_20170219_101925_dro-jpg.113417/
 
  • #14
fonseh said:
Do you mean in my working , i have pivoted the row 1 (make the a11 has the largest vaule compared to a21 , a31 and a41), so i can't change ( swap the row 1 with other row) anymore ?
So , in my working , swapping R10 and R9 is wrong ?
Please refer to this one :
https://www.physicsforums.com/attachments/img_20170219_101925_dro-jpg.113417/

Yes, you should not swap row 1 with anything else anymore.

There is a reason for that: you are ultimately solving a system of equations by eliminating the variables, one-by-one. First you use one of the equations to express one of the variables in terms of the others; for example, if ##a_{11} \neq 0## you can use equation 1 to express ##x_1## in terms of the variables ##x_2, x_3, \ldots, x_n##. When you substitute that expression into the other equations ##2, 3, \ldots, n## you get a new system of ##n-1## equations in the ##n-1## variables ##x_2, x_3, \ldots, x_n.## So you have eliminated ##x_1## from the remainder of the problem, hence the word "elimination" in the name of the procedure. To continue that process you again use one of those ##n-1## equations to solve for one of the ##n-1## variables in terms of the other ##n-2##, then substitute that expression into the other (unused) ##n-2## equations, etc., etc.

That is how Gaussian elimination works, and how it has been done for hundreds of years before anybody invented matrices. In fact, I firmly believe that you should study the matrix form only after understanding the variable-based, non-matrix version; that will make all the operations much clearer and lead you away from making the type of error you say you did.

What about pivoting? Well, all you are doing is choosing the first variable ##x_1## to eliminate from that equation whose ##x_1## coefficient is numerically the largest (or, in some versions, if not the largest, then at least above a certain threshold). If you do exact arithmetic (either using rational numbers or infinitely many decimals) you do not have to bother with pivoting. Where pivoting can become important is where you use finite word-length floating-point numbers, so you get round-off errors in your numerical computations. Then, experience has shown that it is important to keep round-off effects under control, by pivoting on numerically "large" elements and avoiding pivots on numerically small quantities. In fact, with round-off errors present, you cannot really tell if a small element like ##0.1643 \times 10^{-16}## is truly an actual small number, or is really supposed to be zero, but comes out very small just because of slight errors in the calculations. Pivoting on 0 is impossible---because of the way Gaussian elimination is supposed to work---but pivoting on a very small nonzero value could be done, but would lead to disaster and nonsensical results.
 
Last edited:
  • Like
Likes fonseh and BvU

What is Gaussian Elimination with Pivoting?

Gaussian Elimination with Pivoting is a mathematical method used to solve systems of linear equations. It involves systematically eliminating variables in a system of equations until a solution is found. Pivoting is the process of rearranging the equations to improve the efficiency and accuracy of the solution.

Why is Pivoting necessary in Gaussian Elimination?

Pivoting is necessary in Gaussian Elimination to avoid errors and inaccuracies caused by dividing by small or zero coefficients. It also helps to improve the efficiency of the algorithm by reducing the number of operations needed to solve the system of equations.

What is the purpose of Gaussian Elimination with Pivoting?

The purpose of Gaussian Elimination with Pivoting is to find the solution to a system of linear equations. This is useful in many areas of science and engineering, such as solving electrical circuits, analyzing chemical reactions, and predicting the behavior of physical systems.

What are the steps involved in Gaussian Elimination with Pivoting?

The steps of Gaussian Elimination with Pivoting are as follows:

  1. Choose a pivot element, typically the largest coefficient in the first column.
  2. Use the pivot element to eliminate the first variable in all other equations.
  3. Repeat this process for each subsequent variable.
  4. If necessary, pivot again to improve accuracy and efficiency.
  5. Solve the resulting simplified system of equations to find the solution.

What are the advantages of using Gaussian Elimination with Pivoting?

Gaussian Elimination with Pivoting has several advantages, including:

  • It is a systematic and reliable method for solving systems of linear equations.
  • Pivoting helps to avoid errors and improve accuracy.
  • It is applicable to a wide range of problems in science and engineering.
  • It can be easily implemented in computer algorithms.

Similar threads

  • Calculus and Beyond Homework Help
2
Replies
37
Views
4K
  • Calculus and Beyond Homework Help
Replies
4
Views
1K
  • Calculus and Beyond Homework Help
Replies
10
Views
2K
  • Calculus and Beyond Homework Help
Replies
4
Views
2K
  • Calculus and Beyond Homework Help
Replies
1
Views
950
  • Calculus and Beyond Homework Help
Replies
4
Views
2K
Replies
2
Views
2K
  • Calculus and Beyond Homework Help
Replies
3
Views
1K
  • Calculus and Beyond Homework Help
Replies
4
Views
2K
  • Calculus and Beyond Homework Help
Replies
2
Views
2K
Back
Top