def max_shannon_entropy(n):
"""Returns max possible entropy given "n" mutations.
The maximum possible entropy is the entropy of the
uniform distribution. The uniform distribution has
entropy equal to log(n) (I will use base 2).
Parameters
----------
n : int
total mutation counts
Returns
-------
max possible shannon entropy in bits
"""
if n <= 0:
return 0.
return float(np.log2(n))
评论列表
文章目录