tcn 0.4.1

Reference implementation of the TCN protocol for decentralized contact tracing.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
# We calculate the expected total number of collisions,
# from legitimate submissions: n - D + D((D-1)/D)^n
# n = # values, D = size of the output space
# source: http://matt.might.net/articles/counting-hash-collisions/
# To run this script install julia and run "julia collisions.jl".

bits = big"128"  # length of hash
ppl = 8000000000 # world population estimate
cens = 4*24*14   # CENs per person for two weeks, assuming rotation frequency of 15 minutes
n = ppl*cens     # total number of CENs for two weeks
H = 2^bits       # size of hash output space, uniform distribution is assumed

print(n - H + H*((H-1)/H)^n)