Answered step by step
Verified Expert Solution
Question
1 Approved Answer
1. The square root of a real number (p > 0), can be approximated by the limit of the following sequence (Babylonian algorithm). In+1=
1. The square root of a real number (p > 0), can be approximated by the limit of the following sequence (Babylonian algorithm). In+1= =(n+1) P In p as n-. Write a script in Python to implement this algorithm (with zo as the initial guess) and compare your the result with the "exact" answer provided by the math.sqrt(p), Here is an outline of the steps to be done. (i) First, perform three iterations of this algorithm for computing the square-root of p=4, starting with the initial guess to 1 (by hand, on paper). = (ii) Construct the algorithm: On a sheet of paper, write the tasks that must be performed (request value from user, read it in, set it equal to xn and calculate the new values In+1 iteratively as a sequence of steps). (iii) How do you decide when to break the iterations? Well, we must choose a pre-specified error tolerance. How do you compute error if the exact root is not known? Use the following stopping criteria in your code. (a) +1 P
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started