2
$\begingroup$

How to evaluate factorials greater than $69!$? On my calculator, $69!$ is the largest number I can enter before it gives me a syntax error, most likely due to an overflow.

Is there a way to evaluate huge numbers such as $493!$ by hand? I understand if this method exists (which it probably does, I hope.) that it might be very complex, but any answer is appreciated. Thanks in advance. (To 3 decimals places.)

$\endgroup$
4
  • 1
    $\begingroup$ How accurately do you want to calculate? $\endgroup$ Commented Oct 23, 2014 at 22:49
  • $\begingroup$ To 3 decimal places x$10^n$ where $n$ is a power, really large power. @MarkBennet $\endgroup$ Commented Oct 23, 2014 at 22:51
  • $\begingroup$ Related. $\endgroup$
    – user153012
    Commented Oct 24, 2014 at 23:09
  • $\begingroup$ Use Wolfram-Alpha link . It can give a very large stuff very accurately (The exact!) $\endgroup$
    – NeilRoy
    Commented Feb 8, 2015 at 3:51

2 Answers 2

8
$\begingroup$

Well, you can quickly get a very accurate calculation $n!$ by Stirling's approximation:

$$ n! \approx \sqrt{2\pi n} \left( \frac{n}{e} \right) ^n \left( 1 + \frac{1}{12n} + \frac{1}{288 n^2} \right) $$ For $n = 439$ this is accurate to one part in 50 billion.

Your big headache is representing that number on your calculator or in a float number of a computer. That is why people working with factorials of large numbers frequently work with $\log (n!)$.

The answer, by the way, works out to $$1.279533 \cdot 10^{971} $$

$\endgroup$
5
  • $\begingroup$ Thanks so much! I know this is a pain but can you please show this using an example of a larger number, I did it using $5!$ which gave me $120.0025456$ (which is amazing) but how do I do it without my calculator? Or should I just do every part separately and put them all back together at the end? EDIT Just saw your edit, but how did you get that value? If you did use a calculator what method did you take? $\endgroup$ Commented Oct 23, 2014 at 23:06
  • $\begingroup$ Your calculator is limited to $10^{100}$, so anything over $69!$ overflows. There are online calculators like Wolfram Alpha which will overcome this. It will even give you all $972$ digits if you want. In a calculator limited to $10^{100}$ you can calculate $\log 439!$ using Stirling's approximation. Then the integer part is $971$ which gives you the exponent of $10$. Taking $10$ to the power of the fractional part will give you the leading digits. $\endgroup$ Commented Oct 23, 2014 at 23:16
  • $\begingroup$ That makes more sense! Thanks @RossMillikan $\endgroup$ Commented Oct 23, 2014 at 23:19
  • 1
    $\begingroup$ @SamirChahine: for three place accuracy you can ignore the last term. $\frac 1{12\cdot 439}\lt \frac 1{5000}$ so the error there is quite small. $\endgroup$ Commented Oct 23, 2014 at 23:23
  • $\begingroup$ The way I did it was to take the log of (n/e) and multiplied that by n, then actually add up the expression in the parentheses and took the log of that, then took half the log of $2n\pi$, added all three logs, and that gave me the exponent; then I took the fractional part and raised 10 to that power to get the mantissa. That would work fine for even a number like 10000! $\endgroup$ Commented Oct 28, 2014 at 20:37
1
$\begingroup$

A more direct approach with the calculator:

$$ 493! = \frac{69!}{10^{100}} \times \frac{^{119}P_{50}}{10^{100}} \times \frac{^{165}P_{46}}{10^{100}} \times \frac{^{209}P_{44}}{10^{100}} \times \frac{^{251}P_{42}}{10^{100}} \times \frac{^{292}P_{41}}{10^{100}} \times \frac{^{332}P_{40}}{10^{100}} \times \frac{^{371}P_{39}}{10^{100}} \times \frac{^{409}P_{38}}{10^{100}} \times \frac{^{446}P_{37}}{10^{100}} \times \frac{^{483}P_{37}}{10^{100}} \times ^{493}P_{10} \times (10^{100})^{11} $$

You can sort of "cheat" your calculator's limitations by dividing powers of ten and manually appending $10^n$ at the end, remembering what you took away. This gives a fully accurate answer, with the precision of your calculator's. The speed to which you can evaluate larger factorial decreases, but it's still technically almost limitless if you're really desperate. Plus, it's still quick method for the low hundreds, an especially neat trick for the evaluation of those.

Here is a table for the largest consecutive permutations that do not exceed $10^{100}$, for quicker evaluations up to $1000!$

\begin{array}{|c|c|c|} \hline \text{i}& \text{Factorial} & \text{Difference} \\ \hline 1& 69& 69\\ \hline 2& 119& 50\\ \hline 3& 165& 46\\ \hline 4& 209& 44\\ \hline 5& 251& 42\\ \hline 6& 292& 41\\ \hline 7& 332& 40\\ \hline 8& 371& 39\\ \hline 9& 409& 38\\ \hline 10& 446& 37\\ \hline 11& 483& 37\\ \hline 12& 520& 37\\ \hline 13& 556& 36\\ \hline 14& 592& 36\\ \hline 15& 627& 35\\ \hline 16& 662& 35\\ \hline 17& 697& 35\\ \hline 18& 732& 35\\ \hline 19& 766& 34\\ \hline 20& 800& 34\\ \hline 21& 834& 34\\ \hline 22& 868& 34\\ \hline 23& 901& 33\\ \hline 24& 934& 33\\ \hline 25& 967& 33\\ \hline 26& 1000& 33\\ \hline \end{array}

Sorry for being four years late...

$\endgroup$

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .