Maths Probability

Factorial calculator

Number
Exact value 3628800
10! = 1 × 2 × … × 10
As a number 3,628,800
Number of digits 7
(n−1)! 362,880
Twice n! 7,257,600
Exact to 20 · finite to 170

The number of ways to shuffle a deck of cards is 52!, roughly 8 × 10⁶⁷. That is more than the estimated number of atoms in our galaxy. Every properly shuffled deck in history has almost certainly been in an order never seen before and never to be seen again, which is the most vivid demonstration of factorial growth anyone has come up with.

Advertisement
320 × 100

A factorial is every whole number up to n multiplied together. 10! is 3,628,800. Growth is extraordinarily fast — 20! is 2,432,902,008,176,640,000, and 52! is about 8 × 10⁶⁷.

How to calculate a factorial

1 Enter a whole number between 0 and 170.
2 Read the exact value, given in full to 20 and in scientific notation above that.
3 Use the digit count once the number itself stops being readable: 52! has 68 of them.
4 The (n−1)! row is there because most combination formulas need both.

Zero factorial is defined as one, which looks arbitrary and is not. It falls out of the definition n! = n × (n−1)!: applying it at n = 1 gives 1! = 1 × 0!, so 0! must be 1. It is also what makes the combination formula work. C(n,n) should be 1, meaning there is exactly one way to choose everything, and that only comes out right if 0! = 1. Past about 20 the exact digits stop being the interesting part and the size does. Stirling’s approximation, n! ≈ √(2πn) × (n∕e)ⁿ, gives it directly: at n = 10 it returns 3,598,696 against a true 3,628,800, low by 0.83 per cent, and the relative error keeps shrinking as n grows. That is why serious code almost never holds n! itself: it holds log(n!), which is still a modest number long after n! has stopped fitting into anything.

Questions

3,628,800.

Advertisement
300 × 250
Was this tool any good?
Internal signal only · I use it to find the tools worth rebuilding