Skip to content
DeepForgeby svx
All problems
HardCalculusca-364

2x2 Hessian Eigenvalue Product

Problem

For a 2x2 matrix, the product of the eigenvalues equals the determinant. For a Hessian [[a, b], [c, d]], that product classifies local curvature: positive for a definite saddle-free point, negative at a saddle.

Given the four entries, return the eigenvalue product.

Hint

Compute the determinant of the Hessian.

Test cases

case 1
in: [1,0,0,2]
expected: 2
case 2
in: [0,1,1,0]
expected: -1
case 3
in: [3,1,1,0.5]
expected: 0.5
Starter codePython
def hessian_eigenvalue_product_2x2(a, b, c, d):
    # Your code here
    pass

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