document.write( "Question 1192827: Evaluate the equations below using the Gauss-seidel Method, at-least 5 iterations.\r
\n" ); document.write( "\n" ); document.write( "3x + 2y + 4z = 12
\n" ); document.write( "x + 5y + 2z = -9
\n" ); document.write( "7x + 2y + z = 5
\n" ); document.write( "

Algebra.Com's Answer #824793 by greenestamps(13200)\"\" \"About 
You can put this solution on YOUR website!


\n" ); document.write( "3x + 2y + 4z = 12
\n" ); document.write( "x + 5y + 2z = -9
\n" ); document.write( "7x + 2y + z = 5

\n" ); document.write( "I have to admit that this method is new to me; I have never run across it before. Thanks for submitting a question that lets me learn something new.

\n" ); document.write( "After viewing a couple of online videos, it appears the method is well defined.

\n" ); document.write( "(1) Rearrange the equations so that the system is in \"diagonally dominant\" form:

\n" ); document.write( "-----------------------------------------------------------

\n" ); document.write( "NOTE: See the response from tutor @Edwin for a description of \"diagonally dominant form\"....

\n" ); document.write( "-----------------------------------------------------------

\n" ); document.write( "7x + 2y + z = 5
\n" ); document.write( "x + 5y + 2z = -9
\n" ); document.write( "3x + 2y + 4z = 12

\n" ); document.write( "(2) Solve the first equation for x; the second for y; and the third for z:

\n" ); document.write( "[1] x=(5-2y-z)/7
\n" ); document.write( "[2] y=(-9-x-2z)/5
\n" ); document.write( "[3] z=(12-3x-2y)/4

\n" ); document.write( "(3) Choose random starting values x(0), y(0), and z(0) for the three variables.

\n" ); document.write( "(4) Use the most recent values of y and z in [1] to compute the next iteration of x;
\n" ); document.write( "(5) Use the most recent values of x and z in [2] to compute the next iteration of y;
\n" ); document.write( "(6) Use the most recent values of x and y in [3] to compute the next iteration of z;
\n" ); document.write( "(7) Repeat (4) to (6) until the desired number of iterations have been made.

\n" ); document.write( "The calculations are impossible by hand; and they are extremely awkward using a calculator. However, they are quite easy to perform using a spreadsheet program.

\n" ); document.write( "Here is a description of how to do that.

\n" ); document.write( "Make column A the iteration number: A1=0, A2=1, ..., A6=5 (since you are doing 5 iterations).
\n" ); document.write( "Columns B, C, and D will be the iterated values of x, y, and z. Put your initial random guesses (iteration 0) in row 1: B1=0; C1=0; D1=0. (you can use any numbers there....)
\n" ); document.write( "Cell B2 will contain the first iteration of x, using equation [1] and the most recent values of variables y and z: B2=(5-2*C1-D1)/7.
\n" ); document.write( "Cell C2 will contain the first iteration of y, using equation [2] and the most recent values of variables x and z: C2=(-9-B2-2*C1)/5.
\n" ); document.write( "Cell D2 will contain the first iteration of z, using equation [3] and the most recent values of variables x and y: D2=(12-3*B2-2*C2)/4

\n" ); document.write( "Now for the beauty of excel....

\n" ); document.write( "To compute the remaining iterations 2 through 5, simply copy the formulas in cells B2 to D2 down into rows 3 through 6 by highlighting cells B2 to D2 and using ctrl-D to drag those formulas into the other rows.

\n" ); document.write( "I don't know how to copy the results of my excel file here, so I will recreate it....
\r\n" );
document.write( "\r\n" );
document.write( " iteration   x          y          z\r\n" );
document.write( "     0       0          0          0\r\n" );
document.write( "     1    0.714286  -1.94286   3.435714\r\n" );
document.write( "     2    0.778571  -3.33      4.081071\r\n" );
document.write( "     3    1.082704  -3.64897   4.012457\r\n" );
document.write( "     4    1.18364   -3.64171   3.933125\r\n" );
document.write( "     5    1.192899  -3.61183   3.91124

\n" ); document.write( "So the solution after 5 iterations is

\n" ); document.write( "(1.192899, -3.61183, 3.91124)

\n" ); document.write( "The exact solution is (122/103, -371/103, 403/103)

\n" ); document.write( "which to several decimal places is

\n" ); document.write( "(1.184466, -3.60194, 3.912621)

\n" ); document.write( "Note if you do this exercise in excel on your own and continue for about 14 iterations, the solutions will be exact to 5 or 6 decimal places.
\r
\n" ); document.write( "\n" ); document.write( "
\n" ); document.write( "
\n" );