All problems
Convexity via Second Derivative Sign
Problem
A twice differentiable function is convex at a point when its second derivative is nonnegative there.
Given polynomial coefficients and the point x, return True when f''(x) >= 0.
Hint
Only terms of degree two and higher contribute to f''.
Test cases
case 1
in: [[0,0,1],0]
expected: true
case 2
in: [[0,1,1],-2]
expected: true
case 3
in: [[0,0,-1],3]
expected: false
Starter codePython
def convexity_second_derivative_check(coeffs, x):
# Your code here
pass3 test cases · run your code against them in the editor