Skip to content
DeepForgeby svx
All problems
MediumCalculusca-366

Inflection Sign Change Detection

Problem

A function has an inflection between a and b when f'' changes sign across the interval; detect this by checking f''(a) * f''(b) < 0.

Given polynomial coefficients and the two endpoints, return True when the strict sign change occurs.

Hint

For a cubic, f'' is linear and flips sign around the inflection.

Test cases

case 1
in: [[0,0,0,1],-1,1]
expected: true
case 2
in: [[0,0,1],-2,2]
expected: false
case 3
in: [[0,0,0,1],1,2]
expected: false
Starter codePython
def inflection_sign_change_detection(coeffs, a, b):
    # Your code here
    pass

3 test cases · run your code against them in the editor