You will write Newton's sums for a monic polynomial of any degree and test them on the roots.
The idea. For the monic polynomial , the power sums obey
for . For the rule is .
Your tasks.
power_sum(roots, k). Return the sum of the kth powers of the roots.newton(c, kmax). Here c = [c1, ..., cn]. Return the list [S1, ..., S_kmax].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…