How to solve an inequality containing the sum of factorials and powers

692 Views Asked by At

In previous question, I asked how one would simplify the following equation for the case where the variables are very big:

$\sum\limits^{k}_{i=m}(N-i)^{k-i}(\frac{1}{N})^k\frac{k!}{(k-i)!i!} \leq a$

This answer was basically to use an approximation like Stirling's formula. Having implemented this with some code, it still takes too long to find the maximum value of N so that the inequality holds true. Therefore, I need a direct solution for N. So the new question is, how would you go about solving this equation for N?

(Some simplifications are acceptable, but I would like to have it as accurate as possible. The values this equation will be used for are all in the 100,000-1,000,000 range, except $m$, which is in the 100s range.)

1

There are 1 best solutions below

4
On

Now you are basically into root finding. I love Numerical Recipes. I have had the book over 30 years. Good discussion of the techniques and code supplied in various languages. Your formula should be an easy one. Other numerical analysis books will work, too.

A small thought: if m is as small as you say, there might be some algebraic simplification in making it 1. I haven't found it, but others are better at these combinatoric identities.

If you are actually doing the sum every time, you might be able to identify the range of i that is the big contribution. It looks like it should be somewhat below k/2. You can probably reduce the terms in the sum by a large factor, at least to get close to N. Then use the full formula for final refinement. And take the N^(-k) out of the sum.