You will write three small functions that estimate the radius of a power series from its coefficients and add up its terms. The coefficients come from a function c(n).
The idea. The radius is the limit of . We cannot reach infinity, so we use and round to one decimal place.
Your tasks.
ratio(c, n). Return abs(c(n) / c(n + 1)).radius_estimate(c). Return ratio(c, 300) rounded to one decimal place.partial_sum(c, x, terms). Return the sum of c(n) * x ** n for n = 0, 1, ..., terms - 1.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…