Skip to content
DeepForgeby svx
All problems
EasyInformation Theoryinfo-176

Laplace Noise Scale

Problem

Return the Laplace noise scale needed to achieve epsilon-differential privacy for a query with the given sensitivity:

scale = sensitivity / epsilon

Hint

This inverts epsilon = sensitivity / scale.

Test cases

case 1
in: [1,1]
expected: 1
case 2
in: [2,0.5]
expected: 4
case 3
in: [5,10]
expected: 0.5
case 4
in: [1,2]
expected: 0.5
Starter codePython
def laplace_scale(sensitivity, epsilon):
    # Your code here
    pass

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