1

I'm trying to solve the egg-dropping problem (in this variant, I have to find the amount of floors that can be covered with $d$ drops and $n$ eggs). From the linked site, I've found this formula:

$$f(d, n) = \sum_{i=1}^n \binom{d}{i}$$

This works, however my program gets too slow to sum all of the combinations if input numbers are very large (bigger than $10000$), so I was wondering if there was a formula to simplify this summation in order to calculate this directly. For example, I know from the binomial theorem that:

$$ \sum_{k=0}^{n} \binom{n}{k} = 2^n$$

And the post Sum of combinations of n taken k where k is from n to (n/2)+1 has a nice solution as well. Is there an immediate formula for an arbitrary $1 \le n \le d$ ?

  • There is one : https://www.wolframalpha.com/input/?i=sum(j%3D0,n,binomial(k,j)) , but it involves hypergeometric functions, so it is not a "nice" closed form. – Peter Aug 17 '17 at 10:47
  • @Peter Thanks. At the end, the problem was in my program. There is a faster solution that doesn't involve combinations. I'll leave this question open in case you want to turn your comment into an answer. – EsotericVoid Aug 17 '17 at 11:26
  • Even though there's not an exact formula, there is a nice approximation of your sum of binomial coefficients via a normal distribution. Many introductory statistics books cover this, such as this youtube video. – Rus May Aug 18 '17 at 20:03
  • How about this https://math.stackexchange.com/questions/4433929? – MathArt Apr 26 '22 at 09:33

1 Answers1

0

You can avoid recomputing every term of the sum from scratch by observing that given $\binom{d}{i}$, computing $\binom{d}{i+1}$ is easy:

$$\binom{d}{i+1} = \frac{d!}{(i+1)!(d-i-1)!} = \frac{d!}{(i+1)i! \frac{(d-i)!}{(d-i-1)}} = \frac{d-i-1}{i+1} \frac{d!}{i!(d-i)!} = \frac{d-i-1}{i+1} \binom{d}{i}.$$

This way you need just one multiplication and one division for every term of the sum, or $2n$ operations to compute all terms of the sum.

Lorenz
  • 101