Skip to content

Commit cb69e1d

Browse files
authored
Update Variance_PURE.py
1 parent ebef55b commit cb69e1d

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,16 @@
11

2+
# [1] Wang et al (2017) "Locally differentially private protocols for frequency estimation" (USENIX Security 17).
23

34
def VAR_Pure(p, q, n=1, f=0):
45

6+
"""
7+
Variance value of 'pure' frequency oracles from [1]
8+
9+
:param p: probability of being 'honest';
10+
:param q: probability of randomizing value/bit;
11+
:param n: number of users (if known in advance);
12+
:param f: real frequency of value (if known in advance - not realistic in locally differentially private scenario);
13+
:return: variance value.
14+
"""
15+
516
return q * (1 - q) / (n * (p - q)**2) + f * (1 - p - q) / (n * (p - q))

0 commit comments

Comments
 (0)