All problems
Differential Privacy Epsilon
Problem
Return the privacy parameter epsilon of the Laplace mechanism given the query sensitivity and the Laplace noise scale:
epsilon = sensitivity / scale
Hint
Larger noise means smaller epsilon and stronger privacy.
Test cases
case 1
in: [1,2]
expected: 0.5
case 2
in: [2,1]
expected: 2
case 3
in: [5,10]
expected: 0.5
case 4
in: [1,0.5]
expected: 2
Starter codePython
def laplace_epsilon(sensitivity, scale):
# Your code here
pass4 test cases · run your code against them in the editor