First digits of extremely large binomial coefficients

291 Views Asked by At

Can the first digits of a binomial coeffecient

$$\binom{n}{k}$$

be calculated, if n and k are very large numbers ?

For example

Calculate the first ten digits of

$$\binom{10^{85}}{10^{23}}$$

Any ideas ?

1

There are 1 best solutions below

6
On BEST ANSWER

Yes, use Stirling approximation to compute fractional part $\log_{10} \binom{10^{85}}{10^{23}}$, exponentiate and retain the desired number of first significant digits.

Getting rid of integer part allows to avoid scale overflow problems.

Here is the computation of first 20 significant digits in Mathematica:

In[108]:= Block[{n = 10^83, k = 10^23},
 IntegerPart[
  10^20 (FractionalPart[(LogGamma[n + 1`100] - 
         LogGamma[n - k + 1`100] - LogGamma[k + 1`100])/Log[10]] // 
     Exp)]
 ]

Out[108]= 269878514735170511101