opendp 0.14.2-dev.20260401.2

A library of differential privacy algorithms for the statistical analysis of sensitive private data.
1
2
3
4
5
6
7
8
# type: ignore 
def sample_bernoulli_exp(x) -> bool: 
    while x > 1: 
        if sample_bernoulli_exp1(1):  # |\label{line:B_i}| 
            x -= 1 
        else:  
            return False 
    return sample_bernoulli_exp1(x)   # |\label{line:C}|