Try it on paper first. A hint, the key idea and the worked solution are here when you need them.
Use Newton's method to find as the root of , starting from . How many steps are needed until ? Print the guess after each step.
Have you tried it?
Work it out on paper first. It is fine to get stuck or make a mistake: that is how we learn. When you are ready, go through the solution one step at a time, and check each step against your own.
Plan. The derivative is , so the step is . Count the steps in a loop that stops when is small.
Check. The guesses go 4, 2.875, 2.655, 2.6458, 2.64575131, and then 2.6457513111. The last two agree with . Notice the doubling of the digits at the end.
Answer: 6 steps, and .
Log in to join the discussion.
Loading…