All problems
Fixed-Point Stability Check
Problem
A fixed point x* of x = g(x) is locally attracting when |g'(x*)| < 1.
Given the polynomial coefficients of g(x) = sum(coeffs[i] * x^i) and the fixed point x, return True when the iteration is stable and False otherwise.
Hint
Differentiate g term by term and test the magnitude of the derivative at the point.
Test cases
case 1
in: [[0,0.5],2]
expected: true
case 2
in: [[0,2],1]
expected: false
case 3
in: [[1,0,-1],0]
expected: true
case 4
in: [[3,0,0],1]
expected: true
case 5
in: [[0,1,-0.5],0.5]
expected: true
Starter codePython
def fixed_point_stable(coeffs, x):
# Return True when abs(g'(x)) < 1
# Your code here
pass5 test cases · run your code against them in the editor