You will write Simpson's rule, make it refuse an odd number of strips, and check that it equals Richardson's improvement of the trapezium rule.
The idea. for even , and .
Your tasks.
simpson(f, a, b, n). Return None when n is odd.richardson(f, a, b, n). Return , using the trap function given.strips_needed(f, a, b, exact, tol). Return the least even n for which Simpson's error is below tol.Run your code once to unlock the worked solution.
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…