Question: In python code please The ancient Greeks knew that the iteration x_n + 1 = 1/2(x_n + 2/x_n) would converge to Squareroot 2 x_0 =
The ancient Greeks knew that the iteration x_n + 1 = 1/2(x_n + 2/x_n) would converge to Squareroot 2 x_0 = 1 write a Python program that takes a starting value as input and determines if the sequence converges or not. The sequence converges if |x_n + 1 - x_n| lessthanorequalto 10^-7. If it doesn't converge in 100 iterations, then we'll say the sequence doesn't converge. The definition statement of your program should be def squareroot 2(x0) Your output statement should be of the form: The sequence starting at X0X0X0 converges to XXXX in NNNN iterations. The sequence starting at X0X0X0 doesn't converge where X0X0X0 is the initial value ro, XXXX is the value the sequence converges to and NNNN is the number of iterations it takes to converge
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
