You will write three small functions. The first estimates from two nearby points. The second estimates from three nearby points. The third tests whether a function is a solution of .
The idea. A solution makes equal to zero at every point. We cannot test every point, so we test a few. The estimates are and for a tiny number .
Your tasks.
first(f, x). Return the estimate of above, with h = H.second(f, x). Return the estimate of above.is_solution(f, points). Return True when is within 0.001 of zero at every point of the list.Have you tried it?
Do the tasks in the editor first, and run the checker after each one. Its hints help when a check fails. When you are ready, compare your code with this solution.
Log in to join the discussion.
Loading…