I'm reading an article about Bloom filters, https://en.wikipedia.org/wiki/Bloom_filter, in which an expression is derived for the optimal number of hash functions. I'd like to reproduce the computation for the simplified case that m
= n
, that is, I'd like to determine the minimum of the function
(1-exp(-x))**x
which, from the article, should occur at x = ln(2)
. I tried doing this with sympy
as follows:
In [1]: from sympy import *
In [2]: x, y, z = symbols('x y z')
In [3]: init_printing(use_unicode=True)
In [8]: from sympy.solvers import solve
In [9]: solve(diff((1-exp(-x))**x,x), x)
However, I get a
NotImplementedError: multiple generators [x, exp(x), log(1 - exp(-x))]
No algorithms are implemented to solve equation x*exp(-x)/(1 - exp(-x)) + log(1 - exp(-x))
I would just like to double-check whether Sympy really cannot solve this problem? Perhaps I need to add additional constraints/assumptions on x
?