You will write three functions that explore inequalities before you prove them. The first finds the point from which one quantity stays above another. The second measures how much room Bernoulli's inequality leaves.
The idea. "From on" means: true at and at every later that we test. A single failure later resets the start. The base case of an induction proof is this .
Your tasks.
start_from(lhs, rhs, upto). Return the smallest n0 such that lhs(n) > rhs(n) for every n from n0 to upto.bernoulli_gap(x, n). Return (1 + x) ** n - (1 + n * x).bernoulli_holds(xs, upto). Return True when bernoulli_gap(x, n) >= 0 for every x in xs and every n from 1 to upto.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…