Skip to content
DeepForgeby svx
All problems
MediumOptimizationop-170

Privacy Budget Step

Problem

Account for one private release in a privacy budget.

Return [eps_spent + eps_step, stop] where stop is True when the new total exceeds max_eps. Otherwise stop is False.

Hint

Stop only when the budget is strictly exceeded.

Test cases

case 1
in: [0.5,0.25,1]
expected: [0.75,false]
case 2
in: [0.9,0.2,1]
expected: [1.1,true]
case 3
in: [0,1,1]
expected: [1,false]
case 4
in: [2,0,5]
expected: [2,false]
Starter codePython
def privacy_budget_step(eps_spent, eps_step, max_eps):
    # Returns [new_eps, stop]
    # Your code here
    pass

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