Professional Documents
Culture Documents
DEPARTMENT OF MATHEMATICS
MA8452
MA1401- STATISTICS & NUMERICAL METHODS
• The order of convergence of fixed point iteration is 1 and the condition for
convergence is '( x) 1
Problem:
1. Find a positive root of the equation 𝒙𝟑 − 𝟐𝒙 − 𝟓 = 𝟎 by the method of fixed point iteration.
Solution:
Given 𝒇(𝒙) = 𝒙𝟑 − 𝟐𝒙 − 𝟓
1⁄
𝑥 = (2𝑥 2 + 5) 3 = 𝜑(𝑥)
1 −2
'(x) = (2x 2 + 5) 3 4x
3
4x
'(x) = 2
, '(x) 1 for all x in [ 4,5]
3(2 x 2 + 5) 3
Take 𝑥0 = 2.5
1⁄
𝑥1 = 𝜑(𝑥0 ) = (2𝑥02 + 5) 3 = 2.5962 ,
𝑥2 = 2.6438 .....
Solution:
Let f (x) = e x − 3x, f (0) = 1, f (1) = −0.28 The root lies between 0 and 1
ex ex ' ex
The given equation is can be written as x = , let (x) = , (x) =
3 3 3
here ' (x) 1 in the interval [0,1]
By fixed point iteration method, let x 0 = 0.5
x1 = (x 0 ) = 0.5496, x 2 = (x1 ) = 0.5775, x 3 = 5939, x 4 = 0.6037 , x 5 = 0.6096
x 6 = 0.6132, x 7 = 0.6155, x8 = 0.6168 ......... x14 = 0.6189, x15 = 0.6189
The required root is x = 0.6189
3. Find a positive root of the equation cos x - 3x + 1 = 0 by the method of fixed point
iteration.
Solution:
cos x +1 − sin x
(1) x= =g(x), g'(x)=
3 3
sin x
g'(x) =
3
g '( x ) 1 in [01], Let x0 = 0
cos x0 +1
x1 = g( x1 ) = = 0.60845
3
cos x1 +1
x2 = g ( x ) = = 0.60684
3
cos x2 +1
x3 = g ( x2 ) = = 0.60715
3
cos x3 +1
x4 = g( x3 ) = = 0.60709
3
cos x4 +1
x5 = g( x4 ) = = 0.60710
3
cos x5 +1
x6 = g ( x5 ) = = 0.60710 here x5 = x6 = 0.60710
3
Hence the required root is 0.60710
Newton-Raphson Method:
Newton’s method is successfully used to improve the result obtained by other methods.
It is applicable to the solution of equations involving algebraic functions as well as
transcendental functions
1. Using Newton’s iterative method finds the root between 0 and 1 of x 3 = 6 x − 4 correct
to two decimal places.
Solution:
Given f(x)= x 3 − 6 x + 4 f ( x) = 3x 2 − 6
f ( xn ) f ( x0 ) f ( x1 ) f ( x2 )
x n +1 = x n − ; x1 = x0 − =0.67; x 2 = x1 − =0.73 ; x3 = x 2 −
f ( x n ) f ( x0 ) f ( x1 ) f ( x2 )
=0.73.
2. Find a root of x log10x – 1.2 = 0 Newton Raphson method correct to three decimal places
Solution:
f ( xn )
xn+1 = xn −
f ' ( xn )
f(1) = -ve
f(2) = -ve
f(3) = +ve
1
f (x) = x log10 x – 1.2 f '(x) = x log e + log 10 x = log e + log10 x
x
Let x0 = 2
f ( x0 ) x0 log10 x0 – 1.2
x1 = x0 − = = 2.740
f '( x0 ) log e + log10 x0
x2 = 2.741; x3 = 2.741
3. Find an iterative formula to find the reciprocal of a given number N and hence find the
1
value of .
19
1 1
Solution: Let x = N =
N x
1 −1
f (x) = − N ; f ' (x) =
x x2
1
−N
f (x n ) xn 1
By newton 's formula, x n +1 = x n − = xn − = x n + x n2 − N
f (x n ) −1 xn
2
xn
x n +1 = x n (2 − Nx n )
1 1
To find , take x0= = 0.05 x1 = 0.0525; x2 = 0.05263; x3 = 0.05263 ; x4 = 0.05263.
19 20
1
= 0.05263
19
4. Find formula to the value of N , where N is a real number, by Newton’s method
and hence find 15
Solution:
let x = N x 2 = N
take f (x) = x 2 − N f '(x) = 2x
f (x n ) x 2n − N
by newton 's iterative formula, x n +1 = xn − = xn −
f '(x n ) 2x n
1 N
x n +1 = xn +
2 xn
1 N
The Newton’s algorithm for N is x n+1 = xn + .
2 xn
The root lies between 3and 4
Let x0 = 3, N = 15
1 N 1 15
x1 = x0 + = 3 + = 4,
2 x0 2 3
1 15
x2 = 4 + = 3.875
2 4
1 15
x3 = 3.875 + = 3.873, x4 = 3.873
2 3.875
hence x3 = x4 The approximate value of 15 is 3.873
Solution:
Given f(x)= xe x = 3 f ( x) = xe x + e x
f ( xn )
x n +1 = x n − ;
f ( x n )
f ( x0 ) f ( x1 ) f ( x2 )
x1 = x0 − =1.0518; x2 = x1 − =1.0499 ; x3 = x 2 − =1.0499
f ( x0 ) f ( x1 ) f ( x2 )
let x = 3 N x 3 = N
take f (x) = x 3 − N f '(x) = 3x 2
f (x n ) x3 − N
by newton 's iterative formula, x n +1 = x n − = xn − n 2
f '(x n ) 3x n
1 N
x n +1 = 2x n + 2
3 x n
To find 3
24 :
1 24 1 24
x1 = 2x 0 + 2 = 2(2) + 2 = 3.3333
3 x 0 3 (2)
1 24
x 2 = 2x1 + 2 = 2.9422
3 x 1
1 24
x 3 = 2x 2 + 2 = 2.8856
3 x 2
1 24
x 4 = 2x 2 + 2 = 2.8845
3 x 2
1 24
x 5 = 2x 2 + 2 = 2.8845
3 x 2
Hence a value of 3
24 is 2.8845
GAUSS ELIMINATION METHOD
Problem:
1 1 x 2
The given system equations can be written as AX = B =
2 3 y 5
1 1 2 1 1 2
A, B = R2 → R2 − 2 R1
2 3 5 0 1 1
1 2 −5 −9
( A, B) = 3 −1 2 5
2 3 −1 3
1 2 −5 −9
= 0 −7 17 32 R2 → R2 − 3R1
0 −1 9 21 R3 → R3 − 2 R1
1 2 −5 −9
= 0 −7 17 32
0 0 46 115 R3 → 7 R3 − R2
46 z = 115 z = 2.5
−7 y + 17 z = 32 y = −1.5
x + 2 y − 5 z = −9 x = 6.5
The solution is x = 6.5, y = −1.5, z = 2.5
1 −2 9 x 8
where the coefficient matrix A = 3 1 −1 , X = y , B = 3
2 −8 1 z −5
1 −2 9 8
The augumented matrix is A | I = 3 1 −1 3
2 −8 1 −5
by Gauss elimination method,
R 2 → R2 − 3R1, R3 → R3 − 2 R1
1 −2 9 8
A | I = 0 7 −28 −21
0 −4 −17 −21
R3 → 4 R2 + 7 R3
1 −2 9 8
A | I = 0 7 −28 −21
0 0 −231 −231
−231z = −231 z = 1
7 y − 28 z = −21 7 y = 7 y = 1
x − 2 y + 9z = 8 x − 2 + 9 = 8 x = 1
Hence the solution is x = 1, y = 1, z = 1
4. Solve the following system of equations by Gauss Elimination method 2 x + y + 4 z = 12,
8 x − 3 y + 2 z = 20, 4x + 11 y − z = 33
Solution:
2 1 4 12 2 1 4 12
(A, B) = 8 −3 2 20 0 −7 −14 −28 R 2 → R 2 − 4R 1 , R 3 → R 3 − 2R 1
4 11 −1 33 0 9 −9 9
2 1 4 12
R2 R3
0 1 2 4 R 2 → −7 , R 3 → 9
0 1 −1 1
Problem:
1. Apply Gauss Jordan method to find the solution of the following system:
Solution:
1 3 3 x 16
Given A = 1 4 3 , X = y , B = 18
1 3 4 z 19
1 3 3 16
( A, B ) = 1 4 3 18
1 3 4 19
1 3 3 16
= 0 1 0 2 R2 − R1
0 0 1 3 R3 − R1
1 0 3 10
= 0 1 0 2 R1 − 3R2
0 0 1 3
1 0 0 1
= 0 1 0 2 R1 − 3R3
0 0 1 3
Therefore x= 1,y= 2,z=3.
2. Apply Gauss Jordan method, find the solution of the following system:
2x – y + 3z = 8, –x + 2y + z = 4, 3x + y – 4z = 0.
Solu.:
2 −1 3 x 8
where the coefficient matrix A = −1 2 1 , X = y , B = 4
3 1 −4 z 0
2 −1 3 8
The augumented matrix is ( A, B) = −1 2 1 4
3 1 −4 0
−1 2 1 4
R1 R2 ( A, B) 2 −1 3 8
3 1 −4 0
−1 2 1 4
R2 → R2 + 2 R1 , R3 → R3 + 3R1 ( A, B ) 0 38 0 76
0 7 −1 12
−1 2 1 4
R
R2 → 2 ( A, B) 0 1 0 2
38
0 7 −1 12
−1 2 0 2
R3 → R3 − 7 R2 , R1 → R1 → R1 − R3 ( A, B) 0 1 0 2
0 0 1 2
−1 0 0 −2
R1 → R1 − 2 R2 ( A, B) 0 1 0 2
0 0 1 2
2 1 4 12 2 1 4 12
(A, B) = 8 −3 2 20 0 −7 −14 −28 R 2 → R 2 − 4R 1 , R 3 → R 3 − 2R 1
4 11 −1 33 0 9 −9 9
2 1 4 12
R2 R3
0 1 2 4 R 2 → −7 , R 3 → 9
0 1 −1 1
2 1 4 12
0 1 2 4 R 3 → R 2 − R 3
0 0 3 3
6 3 0 24
0 3 0 6 R 1 → 3R 1 − 4R 3 , R 2 → 3R 2 − 2R 3
0 0 3 3
6 0 0 18
0 3 0 6 R1 → R1 − R 2
0 0 3 3
3z = 3 z = 1
y + 2z = 4 y = 4 − 2 = 2
2x + y + 4z = 12 2x = 12 − (2) − 4(1) = 2 x = 3
As the current values of the unknowns at each stage of iteration are used in getting the
values of unknowns, the convergence in Gauss seidel method is very fast when compared to
Gauss Jacobi and Gauss seidel method is roughly two times than Gauss Jacobi method.
Problem:
1. Solve the following system by Gauss Jacobi method 4 x + 2 y + z = 14, x + 5 y − z = 10,
x + y + 8 z = 20
Solution:
Clearly the given equation satisfies the diagonally dominant condition.
1 1 1
x= (14 − 2 y − z ) , y = (10 − x + z ) & z = ( 20 − x − y )
4 5 8
14 10 20
First Iteration : Put x = 0, y = 0 & z = 0 x = = 3.5 ; y = = 2 & z = = 2.5
4 5 8
Second Iteration:
x=
1
4
(14 − 2 ( 2) − 2.5) = 1.875
1
y = (10 − 3.5 + 2.5 ) = 1.8
5
1
z = ( 20 − 3.5 − 2 ) = 1.8125
8
The remaining iteration is
1 1 1
Iteration x= (14 − 2 y − z ) y= (10 − x + z ) z= ( 20 − x − y )
4 5 8
0 0 0 0
1 3.5 2 2.5
11 2 2 2
12 2 2 2
1 1 1
x= (17 − y + 2z ) , y = ( −18 − 3x + z ) & z = ( 25 − 2x + 3 y )
20 20 20
17 −18 25
First Iteration: Put x = 0, y = 0 & z = 0 x = = 0.85 ; y = = −0.9 & z = = 1.25
20 20 20
1 1 1
Iteration x= (17 − y + 2 z ) y= ( −18 − 3x + z ) z= ( 25 − 2 x + 3 y )
20 20 20
0 0 0 0
1 1 1
Therefore x = (7 − y + 2z), y = (−18 − 3x + z), z = (25 − 2 x + 3y)
20 20 20
Solution:
As the coefficient matrix is not diagonally dominant we rewrite the equation as
27 x + 16 y − z = 85, 6 x + 15 y + 2 z = 72, x + y + 54 z = 110;
1 1 1
x= 85 − 6 y + z , y = 72 − 6 x − 2 z , z = 110 − x − y
27 15 54
Let the initial value be x = 0, y = 0, z = 0
1
First Iteration: x (1) = 85 − 6(0) + (0) = 3.148
27
1
y (1) = 72 − 6(3.148) − 2(0) = 3.5408
15
1
z (1) = 110 − 3.148 − 3.5408 = 1.913
54
1
Second Iteration: x (2) = 85 − 6(3.5408) + (1.913) = 2.4322
27
1
y (2) = 72 − 6(2.4322) − 2(1.913) = 3.572
15
1
z (2) = 110 − 2.4322 − 3.572 = 1.9259
54
Proceeding like this we get
6. Solve the following system, starting with initial vector of [0,0,0] using Gauss-seidal
method. 6 x1 − 2 x2 + x3 = 11, − 2 x1 + 7 x2 + 2 x3 = 5, x1 + 2 x2 − 5 x3 = −1
1
6 x1 − 2 x2 + x3 = 11 x1 = (11 + 2 x2 − x3 ) − − − −(1)
6
1
−2 x1 + 7 x2 + 2 x3 = 5 x2 = (5 + 2 x1 − 2 x3 ) − − − −(2)
7
1
x1 + 2 x2 − 5 x3 = −1 x3 = (1 + x1 + 2 x2 ) − − − −(3)
5
sin ce the initial vector [0, 0, 0].
1
First iteration : x1(1) = [11 + 2(0) − 0] = 1.833
6
1
x2(1) = [5 + 2(1.833) − 2(0)] = 1.2380
7
1
x3(1) = [1 + 1.833 + 2(1.2380)] = 1.06190
5
Second iteration : x1(2) = 2.0690, x2(2) = 1.0020, x3(2) = 1.0146
Third iteration : x1(3) = 1.9982, x2(3) = 0.9953, x3(3) = 0.9977
Fourth iteration : x1(4) = 1.9988, x2(4) = 1.0002, x3(4) = 0.9998
Fifthe iteration : x1(5) = 2.0001, x2(5) = 1.0000, x3(5) = 1.0000
sixth iteration : x1(6) = 2.0001, x2(6) = 1.0000, x3(6) = 1.0000
The required soluion is x1 = 2.0001, x2 = 1, x3 = 1
7. Solve the following system of equations by Gauss Seidel method
x + y + 9 z = 15, x + 17 y − 2 z = 48, 30 x − 2 y + 3 z = 75
Solution:
30 x − 2 y + 3z = 75, x + 17 y − 2 z = 48, x + y + 9 z = 15
1 1 1
Therefore x = (75 + 2y − 3z), y = (48 − x + 2z), z = (15 − x − y)
30 17 9
Iterations 1 1 1
x= (75 + 2y − 3z) y= (48 − x + 2z) z = (15 − x − y)
30 17 9
POWER METHOD:
To find the numerically largest eigen value of a matrix A (3 3) take
1 0 0 1
X 0 = 0 or 1 or 0 or 1 as an initial eigen vector. Find AX 0 , take the numerically
0 0 1 1
largest value out from AX 0 and considered as 1 X1 .Find AX 1 , take the numerically largest
value out from AX 1 and considered as 2 X 2 . Repeat the above steps until λi or Xi
converges.
Problem:
2 3
1. Find the dominant eigen value A = using power method upto one
5 4
1
decimal place accuracy. Start with X (0) =
1
2 3 1 5 0.6
AX (0) = = = 9 = 9 X (1)
5 4 1 9 1
AX2= .
2 3 0.6 4.2 0.6
AX (1) = = = 7 = 7 X (2)
5 4 1 7 1
1
Solution: Let the initial eigenvector be X (0)
= 0
0
25 1 2 1 25 1
AX(0)= 1 3 0 0 = 1 = 25 0.04 = 25 X (1) .
2 0 − 4 0 2 0.08
25 1 2 1 25.2 1 1
AX(1)= 1 3 0 0.04 = 1.12 = 25.2 0.0444 = 25.2 X ( 2) .(ie) X ( 2) = 0.0444
2 0 − 4 0.08 1.68 0.0667
0.0667
1 1 1
Repeating this , we get 25.1778 0.0450 , 25.1826 0.0451 , 25.1821 0.0451 .
0.06888 0.0685 0.0685
Therefore The largest eigenvalue is 25.1821
5 0 1
3. Find all the Eigen value of A=
0 −2 0 using power method
1 0 5
Solution:
1
X 0 = 0 be an initial eigen vector
0
5 0 1 1 5 1
AX 0 = 0 −2 0 0 = 0 = 5 0 = 5 X 1
1 0 5 0 1 0.2
5 0 1 1 5.2 1
AX 1 = 0 −2 0 0 = 0 = 5.2 0 = 5.2 X 2
1 0 5 0.2 2 0.3846
1
AX 2 = 5.3846 0 = 5.3846
0.5429
continue this process, then we get the eigen value = 6,corresponding
1
eigen vector = 0
1
−1 0 1 1
Let B = A − I = A − 6 I = 0 −8 0 , take Y0 = 0
1 0 −1 0
−1 0 1 1 −1 1
BY0 = 0 −8 0 0 = 0 = −1 0 − 1Y1
1 0 −1 0 1 −1
−1 0 1 1 −2 1
BY1 = 0 −8 0 0 = 0 = −2 0 = −2Y2
1 0 −1 −1 2 −1
−1 0 1 1 −2 1
BY3 = 0 −8 0 0 = 0 = −2 0 = −2Y3
1 0 −1 −1 2 −1
Dominant eigen value of B = −2 Thesmallest eigen valueof A = −2 + 5 = 4
By thepropertyof eigen value,Sumof theeigen value = Traceof A
1 + 2 + 3 = 5 − 2 + 5
6 + 4 + 3 = 8 3 = −2 The Eigen values are 6,4, −2.
1 6 1
4. Find the largest Eigen value and Eigen vector of 1 2 0 , by using Power
0 0 3
method.
Solu.:
1
Let X1 = 0 be an approximate eigen value
0
1 6 1 1 1 1
AX1 = 1 2 0 0 = 1 = 1 1 = 1X 2
0 0 3 0 0 0
3.5714 1
AX 3 = 1.8572 = 3.5714 0.52 = 3.5714 X 4
0 0
4.12 1
AX 4 = 2.04 = 4.12 0.4951 = 4.12 X 5
0 0
3.9706 1
AX 5 = 1.9902 = 3.9706 0.5012 = 3.9706 X 6
0 0
4.0072 1
AX 6 = 2.0024 = 4.0072 0.4997 = 4.0072 X 7
0 0
3.9982 1
AX 7 = 1.9994 = 3.9982 0.500 = 3.9982 X 8
0 0
4 1
AX 8 = 2 = 4 0.5 = 4 X 9
0 0
1
The largest eigen value is 4, corresponding eigen vector is 0.5
0