Approximating the probability that a range bounds a given number, with very large numbers

58 Views Asked by At

Let $m$ numbers be chosen uniformly from $0,\dots,n-1$ without replacement and then sorted in ascending order as $\ell_0,\dots,\ell_{m-1}$. Let there be $b,e,x$ such that $0 \le b \le e \le m$ and $0 \le x < n$. What is the probability that $\ell_b \le x < \ell_e$?

That is: What is the probability that the numbers at indices $b$ and $e$ bound $x$ from above and below?

We have that $$p(\ell_b \le x < \ell_e) = \sum^{e-1}_{i=b} p(\ell_i \le x < \ell_{i+1}),$$ and $p(\ell_i \le x < \ell_{i+1}) = $ the probability of choosing exactly $i$ numbers less than or equal to $x$ in $m$ draws. Therefore, $$ p(\ell_i \le x < \ell_{i+1}) = \begin{cases} 0 & \text{if } x < i \text{ or } n-x < m-i \\ \text{otherwise} & \frac{\binom{x}{i}\binom{n-x}{m-i}}{\binom{n}{m}}, \end{cases} $$ and $$ p(\ell_b \le x < \ell_e) = \sum^{e-1}_{i=b} \frac{\binom{x}{i}\binom{n-x}{m-i}}{\binom{n}{m}} = \sum^{e-1}_{i=b} \frac{x!m!(n-x)!(n-m)!}{i!(x-i)!(m-i)!(n-x-m+i)!n!} $$ when $b \le x$ and $m-e \le n-x$. (For the other cases, $x$ is either very small or very large---I'm happy to handle only the case where $x$ is not near the endpoints for now.)

Great. Now, for the problem: The $n,m$ I have are very large, but I see no useful simplification I can do on the terms in the sums. The $n,m$ I need to work with are $n = 2^{160}$ and $m$ around $34$ million, which makes $\binom{n}{m}$ stupendously huge. I'm having difficulty seeing how to (usefully) apply Stirling's approximation to evaluate the factorials here, simply because the terms are also so large as to be unweildy. (E.g., $n! \approx \sqrt{\pi 2^{161}}(\frac{2^{160\cdot 2^{160}}}{e^{2^{160}}})$.)

So, my question is: How should I go about evaluating this mess for specific $b,e,x$? Is there some simplification I've not seen which makes dealing with it more tractable?