You will write three changes of an equation that act on its list of coefficients, the leading one first. You never find a root.
The idea. Reversing the list gives the reciprocals of the roots. Changing the sign of every other coefficient gives the negatives. The shift , whose roots are each more, can be built by Horner's rule: start from [0], and for each coefficient , multiply by and add .
Your tasks.
reverse(coeffs). Return the list in reverse order.negate(coeffs). Return the coefficients of , made monic in sign: multiply the coefficient of by , then by .shift(coeffs, h). Return the coefficients of .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…