You will write three functions for a polynomial given by its coefficients, highest power first: means . The checker tests several polynomials.
The idea. The derivative of is . The function is increasing where the derivative is positive. The derivative can change sign only at its zeros, so we find those and test between them.
Your tasks.
derivative(coeffs). Return the coefficients of the derivative, in the same order.stopping_points(coeffs). Return the sorted real zeros of the derivative, rounded to 6 decimals.rising(coeffs, x). Return True if the function is increasing at x, and False otherwise.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…