Skip to content
DeepForgeby svx
All problems
EasyInformation Theoryinfo-263

Hedge Regret Bound

Problem

Return the Hedge (multiplicative weights) regret bound for T rounds and K experts:

R_T <= sqrt(2 * T * ln(K))

Return the value in nats.

Hint

With a single expert there is nothing to regret.

Test cases

case 1
in: [100,2]
expected: 11.774100225154747
case 2
in: [1000,10]
expected: 67.86140424415112
case 3
in: [100,1]
expected: 0
case 4
in: [10,2]
expected: 3.723297411059034
Starter codePython
import math
def hedge_regret_bound(T, num_experts):
    # Your code here
    pass

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