from math import log, exp

# size of inputs
I = lambda T, Uu, Uf: T * ((Uu + Uf) ** 2 - (Uu + Uf))

# max probability of positive for one iteration
P_one = lambda R, Pt: Pt ** (1.0 / R)

# probability of positive
P_r = lambda n, s: (n - 1.0) / s

# max probability of false positive
P_f = lambda P_o, P_r: P_o - P_r

# size of bloom filter wit optimal k
m = lambda n, P: n * log(1.0 / P) / log(2) ** 2

# number of hashes
k = lambda m, n: m / float(n) * log(2)

# size of bloom filter with real k
#def m_k(n, k, P):

m_k = lambda n, k, P: -(k * n) / log(1 - P ** (1 / float(k)))

597e7bcf61693a5dcf8675d1667c26cc1c54e2f2
<mask token>

<mask token>
I = lambda T, Uu, Uf: T * ((Uu + Uf) ** 2 - (Uu + Uf))
P_one = lambda R, Pt: Pt ** (1.0 / R)
P_r = lambda n, s: (n - 1.0) / s
P_f = lambda P_o, P_r: P_o - P_r
m = lambda n, P: n * log(1.0 / P) / log(2) ** 2
k = lambda m, n: m / float(n) * log(2)
m_k = lambda n, k, P: -(k * n) / log(1 - P ** (1 / float(k)))

from math import log, exp
I = lambda T, Uu, Uf: T * ((Uu + Uf) ** 2 - (Uu + Uf))
P_one = lambda R, Pt: Pt ** (1.0 / R)
P_r = lambda n, s: (n - 1.0) / s
P_f = lambda P_o, P_r: P_o - P_r
m = lambda n, P: n * log(1.0 / P) / log(2) ** 2
k = lambda m, n: m / float(n) * log(2)
m_k = lambda n, k, P: -(k * n) / log(1 - P ** (1 / float(k)))

from math import log, exp

# size of inputs
I = lambda T, Uu, Uf: T * ((Uu + Uf) ** 2 - (Uu + Uf))

# max probability of positive for one iteration
P_one = lambda R, Pt: Pt ** (1.0 / R)

# probability of positive
P_r = lambda n, s: (n - 1.0) / s

# max probability of false positive
P_f = lambda P_o, P_r: P_o - P_r

# size of bloom filter wit optimal k
m = lambda n, P: n * log(1.0 / P) / log(2) ** 2

# number of hashes
k = lambda m, n: m / float(n) * log(2)

# size of bloom filter with real k
#def m_k(n, k, P):

m_k = lambda n, k, P: -(k * n) / log(1 - P ** (1 / float(k)))
