Skip to content
DeepForgeby svx
All problems
MediumCalculusca-207

Newton Decrement

Problem

The Newton decrement lambda^2 = g^T H^(-1) g measures how close a point is to the minimum of a self-concordant function.

For gradient g = (g1, g2) and Hessian H = [[ha, hb], [hb, hc]], solve H x = g and return g dot x. Assume H is positive definite.

Hint

This is the squared length of the Newton step measured in the Hessian norm.

Test cases

case 1
in: [1,1,1,0,1]
expected: 2
case 2
in: [2,0,2,0,4]
expected: 2
case 3
in: [1,2,2,0,2]
expected: 2.5
case 4
in: [3,4,5,0,5]
expected: 5
case 5
in: [0,0,1,0,1]
expected: 0
Starter codePython
def newton_decrement(g1, g2, ha, hb, hc):
    # Your code here
    pass

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