NotImplementedError in Sympy's solve

折月煮酒 提交于 2019-12-14 01:36:51

问题


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?

来源:https://stackoverflow.com/questions/45894976/notimplementederror-in-sympys-solve

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!