Try it on paper first. A hint, the key idea and the worked solution are here when you need them.
Draw the graph of for from 0 to 5. Mark the points where it meets the x axis with red dots, using np.roots. Find the lowest point of the curve, and print its coordinates.
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. Make 201 values of , so that is one of them. The roots come from np.roots([1, -5, 6]). The lowest point of the curve is where y is the smallest: argmin.
Check. , so the roots are 2 and 3. The lowest point is halfway between them, at , where .
Answer: the curve meets the x axis at 2 and 3. Its lowest point is .
Log in to join the discussion.
Loading…