All problems
Envelope Theorem Derivative
Problem
Maximize f(x, theta) = a*x - 0.5*b*x^2 + c*theta*x over x. The optimizer is x*(theta) = (a + c*theta) / b and the value function is V(theta) = f(x*(theta), theta).
By the envelope theorem V'(theta) equals the partial derivative of f with respect to theta at the optimum, which is c*x*. Given a, b != 0, c, and theta, return V'(theta).
Hint
Differentiate f with respect to theta, then substitute the optimal x.
Test cases
case 1
in: [1,2,3,0]
expected: 1.5
case 2
in: [0,1,2,5]
expected: 20
case 3
in: [2,4,-1,1]
expected: -0.25
case 4
in: [5,1,0,3]
expected: 0
Starter codePython
def envelope_derivative(a, b, c, theta):
# Your code here
pass4 test cases · run your code against them in the editor