← 2015 Paper 2

UPSC 2015 Maths Optional Paper 2 Q8b — Step-by-Step Solution

15 marks · Section B

Gauss-Seidel iteration · Numerical Analysis · asked 7× in 13 yrs · Read the full method →

Question

Find the solution of the system

10x12x2x3x4=3,10x_1-2x_2-x_3-x_4=3, 2x1+10x2x3x4=15,-2x_1+10x_2-x_3-x_4=15, x1x2+10x32x4=27,-x_1-x_2+10x_3-2x_4=27, x1x22x3+10x4=9,-x_1-x_2-2x_3+10x_4=-9,

using Gauss-Seidel method (make four iterations).

Technique

Standard Gauss-Seidel iteration using diagonal-dominant rearrangement; each new xi(k+1)x_i^{(k+1)} uses already-updated x1(k+1),,xi1(k+1)x_1^{(k+1)},\dots,x_{i-1}^{(k+1)} and old xi+1(k),,xn(k)x_{i+1}^{(k)},\dots,x_n^{(k)}.

Solution

Setup. Rearrange each equation to solve for the diagonal variable:

x1=3+2x2+x3+x410,x_1=\dfrac{3+2x_2+x_3+x_4}{10}, x2=15+2x1+x3+x410,x_2=\dfrac{15+2x_1+x_3+x_4}{10}, x3=27+x1+x2+2x410,x_3=\dfrac{27+x_1+x_2+2x_4}{10}, x4=9+x1+x2+2x310.x_4=\dfrac{-9+x_1+x_2+2x_3}{10}.

Diagonal dominance check: Each diagonal has 10|10| vs. sum of off-diagonals 2+1+1=4|−2|+|−1|+|−1|=4, so 10>410>4 ✓. Gauss-Seidel converges.

Initial guess: xi(0)=0x_i^{(0)}=0 for all ii.

Iteration 1 (use most recent values)

x1(1)=(3+0+0+0)/10=0.3x_1^{(1)}=(3+0+0+0)/10=0.3. x2(1)=(15+2(0.3)+0+0)/10=(15+0.6)/10=1.56x_2^{(1)}=(15+2(0.3)+0+0)/10=(15+0.6)/10=1.56. x3(1)=(27+0.3+1.56+0)/10=(28.86)/10=2.886x_3^{(1)}=(27+0.3+1.56+0)/10=(28.86)/10=2.886. x4(1)=(9+0.3+1.56+2(2.886))/10=(9+0.3+1.56+5.772)/10=(1.368)/10=0.1368x_4^{(1)}=(-9+0.3+1.56+2(2.886))/10=(-9+0.3+1.56+5.772)/10=(-1.368)/10=-0.1368.

After iter 1: (0.3,1.56,2.886,0.1368)(0.3, 1.56, 2.886, -0.1368).

Iteration 2

x1(2)=(3+2(1.56)+2.8860.1368)/10=(3+3.12+2.8860.1368)/10=(8.8692)/10=0.88692x_1^{(2)}=(3+2(1.56)+2.886-0.1368)/10=(3+3.12+2.886-0.1368)/10=(8.8692)/10=0.88692.

x2(2)=(15+2(0.88692)+2.8860.1368)/10=(15+1.77384+2.8860.1368)/10=(19.52304)/10=1.952304x_2^{(2)}=(15+2(0.88692)+2.886-0.1368)/10=(15+1.77384+2.886-0.1368)/10=(19.52304)/10=1.952304.

x3(2)=(27+0.88692+1.952304+2(0.1368))/10=(27+0.88692+1.9523040.2736)/10=(29.565624)/10=2.9565624x_3^{(2)}=(27+0.88692+1.952304+2(-0.1368))/10=(27+0.88692+1.952304-0.2736)/10=(29.565624)/10=2.9565624.

x4(2)=(9+0.88692+1.952304+2(2.9565624))/10=(9+0.88692+1.952304+5.9131248)/10=(0.2476512)/10=0.02476512x_4^{(2)}=(-9+0.88692+1.952304+2(2.9565624))/10=(-9+0.88692+1.952304+5.9131248)/10=(-0.2476512)/10=-0.02476512.

After iter 2: (0.88692,1.952304,2.9565624,0.02476512)(0.88692, 1.952304, 2.9565624, -0.02476512).

Iteration 3

x1(3)=(3+2(1.952304)+2.95656240.02476512)/10=(3+3.904608+2.95656240.02476512)/10=(9.83640528)/10=0.983640528x_1^{(3)}=(3+2(1.952304)+2.9565624-0.02476512)/10=(3+3.904608+2.9565624-0.02476512)/10=(9.83640528)/10=0.983640528.

x2(3)=(15+2(0.983640528)+2.95656240.02476512)/10=(15+1.967281056+2.95656240.02476512)/10=(19.899078)/10=1.9899078x_2^{(3)}=(15+2(0.983640528)+2.9565624-0.02476512)/10=(15+1.967281056+2.9565624-0.02476512)/10=(19.899078)/10=1.9899078.

x3(3)=(27+0.983640528+1.9899078+2(0.02476512))/10=(27+0.983640528+1.98990780.04953024)/10=(29.92401809)/10=2.992401809x_3^{(3)}=(27+0.983640528+1.9899078+2(-0.02476512))/10=(27+0.983640528+1.9899078-0.04953024)/10=(29.92401809)/10=2.992401809.

x4(3)=(9+0.983640528+1.9899078+2(2.992401809))/10=(9+0.983640528+1.9899078+5.984803618)/10=(0.041648054)/10=0.0041648054x_4^{(3)}=(-9+0.983640528+1.9899078+2(2.992401809))/10=(-9+0.983640528+1.9899078+5.984803618)/10=(-0.041648054)/10=-0.0041648054.

After iter 3: (0.9836,1.9899,2.9924,0.00416)(0.9836, 1.9899, 2.9924, -0.00416) (rounded).

Iteration 4

x1(4)=(3+2(1.9899078)+2.9924018090.0041648054)/10=(3+3.9798156+2.9924018090.0041648054)/10=(9.96805260)/10=0.996805260x_1^{(4)}=(3+2(1.9899078)+2.992401809-0.0041648054)/10=(3+3.9798156+2.992401809-0.0041648054)/10=(9.96805260)/10=0.996805260.

x2(4)=(15+2(0.996805260)+2.9924018090.0041648054)/10=(15+1.99361052+2.9924018090.0041648054)/10=(19.98184752)/10=1.998184752x_2^{(4)}=(15+2(0.996805260)+2.992401809-0.0041648054)/10=(15+1.99361052+2.992401809-0.0041648054)/10=(19.98184752)/10=1.998184752.

x3(4)=(27+0.996805260+1.998184752+2(0.0041648054))/10=(27+0.996805260+1.9981847520.008329611)/10=(29.98666040)/10=2.998666040x_3^{(4)}=(27+0.996805260+1.998184752+2(-0.0041648054))/10=(27+0.996805260+1.998184752-0.008329611)/10=(29.98666040)/10=2.998666040.

x4(4)=(9+0.996805260+1.998184752+2(2.998666040))/10=(9+0.996805260+1.998184752+5.99733208)/10=(0.00767791)/10=0.000767791x_4^{(4)}=(-9+0.996805260+1.998184752+2(2.998666040))/10=(-9+0.996805260+1.998184752+5.99733208)/10=(-0.00767791)/10=-0.000767791.

After iter 4: (0.9968,1.9982,2.9987,0.000768)(0.9968, 1.9982, 2.9987, -0.000768).

Convergence to exact solution

The iterates clearly converge to (1,2,3,0)(1,2,3,0). Verify:

So exact solution is (x1,x2,x3,x4)=(1,2,3,0)(x_1,x_2,x_3,x_4)=(1,2,3,0).

Summary table

Iterx1x_1x2x_2x3x_3x4x_4
00000
10.31.562.886-0.1368
20.886921.952302.95656-0.02477
30.983641.989912.99240-0.00416
40.996811.998182.99867-0.00077

Answer

  After 4 iterations: (0.9968,  1.9982,  2.9987,  0.00077);  exact: (1,2,3,0).  \boxed{\;\text{After 4 iterations: }(0.9968,\;1.9982,\;2.9987,\;-0.00077);\;\text{exact: }(1,2,3,0).\;}
We post more of this — worked solutions, CSAT trap breakdowns, guide chapters — a few times a week on Telegram. Free, no sign-in. Join

This solution is part of the Maths Coverage Map — 13 years, mapped. Get the take-away PDF free.