Skip to content
DeepForgeby svx
All problems
EasyOptimizationop-095

Regret Bound Value

Problem

Compute the standard UCB regret bound for a single suboptimal arm with gap delta after T pulls.

Return 8 * log(T) / delta + (1 + pi ** 2 / 3) * delta, using the natural logarithm. Return 0.0 when delta <= 0 or T < 1.

Hint

The logarithmic term dominates as T grows; the linear term accounts for the gap.

Test cases

case 1
in: [0.1,1000]
expected: 553.0494091319406
case 2
in: [1,10]
expected: 22.71054887764882
case 3
in: [0.5,100]
expected: 75.82765704265769
case 4
in: [0,50]
expected: 0
Starter codePython
def regret_bound_value(delta, T):
    # Your code here
    pass

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