Question: All the way back in tutorial 2, we introduced an algorithm for calculating the square root y - x, which had the following steps: 1.

 All the way back in tutorial 2, we introduced an algorithm

All the way back in tutorial 2, we introduced an algorithm for calculating the square root y - x, which had the following steps: 1. Start with an initial guess for y. 2. Calculate yy, and stop if it's 'close enough tox 3. Update y to the average of y and x/y: y --> [y+x/yy2. 4. Loop back to step 2. At that point, we couldn't really do the last step: we just repeated the steps by hand until the result looked good for we got sick of it.) But now we can make Python control the loop for us! Part A tol Implement the function square root in the cell below. I've included the arguments and a brief docstring to get your started. The 'error tolerance defines the stopping condition of our algorithm, le. it defines what "close enough" in step 2 means: ly - x|

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!