laziness, impatience, and hubris | |
PerlMonks |
comment on |
( [id://3333]=superdoc: print w/replies, xml ) | Need Help?? |
Ok, it's been communicated that using the entropy function would provide a better approximation to nCr. So here is such a formula:
Let H(eps) := -eps.log_2(eps)-(1-eps)log_2(1-eps) be a binary entropy function. Then binom(n, eps.n) is approximately equal to 2^(n.H(eps)). Where eps is short for epsilon. Update: Note that this uses the more common Stirling formula which is slightly less accurate as it truncates terms in the series (instead of approximating them like the formula i posted before). In reply to Re(2): Pascal triange...
by gumby
|
|