1
$\begingroup$

I want to calculate a Poisson that involves the calculation of $100!$ Does anyone know how to program it in a Casio calculator?

$\endgroup$
2
$\begingroup$

Your calculator may overflow at $10^{100}$ while $100!\approx 9.3\times 10^{157}$.

If so, and assuming you want to use $100!$ in multiplication, one approach would be to use logarithms, as $\log(100!)=\log(1)+\log(2)+\cdots+\log(100)$.

I leave the programming to you, but as a check, $\log_{10}(100!)\approx 157.97$ and $\ln(100!)\approx 363.74$.

$\endgroup$
  • $\begingroup$ How good is Stirling in that case? $100!\approx\dfrac{100^{100+1/2}\sqrt{2\pi}}{e^{100}}$. ${}\qquad{}$ $\endgroup$ – Michael Hardy Dec 17 '14 at 18:31
  • $\begingroup$ @Michael Hardy: about $0.999167$ of the actual value, so not bad. You could still need logarithms. $\endgroup$ – Henry Dec 17 '14 at 18:33
  • $\begingroup$ BTW, it was de Moivre who first showed that $\dfrac{n^n\sqrt{n}}{n!e^n}$ converges to a limit strictly between $0$ and $\infty$, and computed it numerically. It was Stirling who showed that the limit is $1/\sqrt{2\pi\,{}}$. ${}\qquad{}$ $\endgroup$ – Michael Hardy Dec 17 '14 at 18:33
  • $\begingroup$ A better approximation is $$\ln(n!) \approx (\ln(n)-1) n + \dfrac{1}{2}\ln(2 \pi n) + \dfrac{1}{12n} - \dfrac{1}{360 n^3} + \ldots$$ For $n = 100$, the terms shown give $\ln(100!) \approx 363.73937555556341078$ while the correct value is $363.73937555556349014$. $\endgroup$ – Robert Israel Dec 17 '14 at 19:33

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.