Determine the fourth root of 200 by finding the numerical so
Solution
Initial values of a and b are guesed as a = -2, and b = 5.
Root is accurate upto 7nth decimal place.
final value of root obtained is 3.76060304791
Python code for the problem:
a = -2;
b = 5;
c = a;
EPSILON = 0.0000001;
iter = 1;
while ((b-a) >= EPSILON and iter <= 30):
print \"Iteration: \", iter
c = float(a+b)/2.0;
if (3*(c**2) - 30 == 0.0):
break;
elif ((c**4 - 200)*(a**4 - 200) < 0):
b = float(a+b)/2;
print \"updated Values: a = \", a, \" and b = \", b
else:
a = float(a+b)/2;
print \"updated Values: a = \", a, \" and b = \", b
iter = iter + 1;
print \"Final root: \", c
Updated values of a and b in each iteration are as follows:
Iteration: 1
updated Values: a = 1.5 and b = 5
Iteration: 2
updated Values: a = 3.25 and b = 5
Iteration: 3
updated Values: a = 3.25 and b = 4.125
Iteration: 4
updated Values: a = 3.6875 and b = 4.125
Iteration: 5
updated Values: a = 3.6875 and b = 3.90625
Iteration: 6
updated Values: a = 3.6875 and b = 3.796875
Iteration: 7
updated Values: a = 3.7421875 and b = 3.796875
Iteration: 8
updated Values: a = 3.7421875 and b = 3.76953125
Iteration: 9
updated Values: a = 3.755859375 and b = 3.76953125
Iteration: 10
updated Values: a = 3.755859375 and b = 3.7626953125
Iteration: 11
updated Values: a = 3.75927734375 and b = 3.7626953125
Iteration: 12
updated Values: a = 3.75927734375 and b = 3.76098632812
Iteration: 13
updated Values: a = 3.76013183594 and b = 3.76098632812
Iteration: 14
updated Values: a = 3.76055908203 and b = 3.76098632812
Iteration: 15
updated Values: a = 3.76055908203 and b = 3.76077270508
Iteration: 16
updated Values: a = 3.76055908203 and b = 3.76066589355
Iteration: 17
updated Values: a = 3.76055908203 and b = 3.76061248779
Iteration: 18
updated Values: a = 3.76058578491 and b = 3.76061248779
Iteration: 19
updated Values: a = 3.76059913635 and b = 3.76061248779
Iteration: 20
updated Values: a = 3.76059913635 and b = 3.76060581207
Iteration: 21
updated Values: a = 3.76060247421 and b = 3.76060581207
Iteration: 22
updated Values: a = 3.76060247421 and b = 3.76060414314
Iteration: 23
updated Values: a = 3.76060247421 and b = 3.76060330868
Iteration: 24
updated Values: a = 3.76060289145 and b = 3.76060330868
Iteration: 25
updated Values: a = 3.76060289145 and b = 3.76060310006
Iteration: 26
updated Values: a = 3.76060299575 and b = 3.76060310006
Iteration: 27
updated Values: a = 3.76060304791 and b = 3.76060310006
Final root: 3.76060304791

