Factorial: quantity example
Five books on a shelf can be arranged in 5 factorial ways: 5 × 4 × 3 × 2 × 1 = 120. Ten books give 10 factorial, which is 3,628,800. Add one more book and the count jumps by a factor of eleven.
By convention zero factorial equals 1, since there is exactly one way to arrange nothing. Factorials grow faster than almost anything. Twenty factorial is about 2.43 × 10¹⁸, more than the number of seconds in 77 billion years.
That explosive growth is why brute-force searches over all orderings become impossible beyond small sizes.
A common misunderstanding
Assuming factorials grow at a roughly linear or exponential rate. For example, 20! is 2,432,902,008,176,640,000. Display precision and finite floating-point range are separate limits.
Related measurements
The factorial is not the same as a power or a simple product. Squaring multiplies a number by itself. A factorial multiplies it by every positive integer below it, and it sits behind permutations, which count arrangements, and combinations, which divide out the ordering; the double factorial multiplies every other number, and is a different function.
A non-integer entry requires an explicitly chosen extension, outside this whole-number tool. The exclamation mark can also appear in ordinary writing, so context matters.
Limits of the definition
The numbers explode. Ordinary calculators overflow near 170 factorial, and exact values need special software. Approximations such as Stirling's formula help for large n; the definition applies to non-negative integers only unless extended by the gamma function.
In practice, avoid computing huge factorials directly when a ratio is needed. Cancel terms first to keep numbers manageable and avoid rounding errors.
Understanding Factorial
Factorial counts the number of distinct orderings of a set: n factorial ways to arrange n distinct items in a row, which is why it underlies both permutations (order matters) and combinations (order doesn't, after dividing out the orderings within each group) rather than being two unrelated ideas.
Using Factorial
Factorials count arrangements in probability and statistics, feed the binomial and Poisson formulas and appear in series expansions in calculus. Scheduling problems, seating charts and password counts use them. Computer scientists use them to describe the cost of trying every ordering.
Physicists meet them in statistical mechanics; a calculator's factorial key is the tool for these questions, and it handles values well beyond what is practical by hand.
Factorial: follow the example through
Assumed example: Five books on a shelf can be arranged in 5 factorial ways: 5 × 4 × 3 × 2 × 1 = 120. Ten books give 10 factorial, which is 3,628,800. Add one more book and the count jumps by a factor of eleven.
By convention zero factorial equals 1, since there is exactly one way to arrange nothing. Factorials grow faster than almost anything. Twenty factorial is about 2.43 × 10¹⁸, more than the number of seconds in 77 billion years.
That explosive growth is why brute-force searches over all orderings become impossible beyond small sizes.
Factorial: calculation reference
n! = n × (n−1) × … × 2 × 1; trailing zeros = ⌊n÷5⌋ + ⌊n÷25⌋ + ⌊n÷125⌋ + …
| Quantity | Entered or calculated amount | Meaning |
|---|---|---|
| Whole number n | 10 | A whole number from 0 to 170. Beyond 170 the answer no longer fits in a computer's number format. |
| n factorial | 3,628,800 | Result under the listed assumptions. |
| Trailing zeros | 2 | Result under the listed assumptions. |
Factorial Calculator: change the inputs and compare the resulting cases
Why is zero factorial one?
There is exactly one way to arrange no items, and the definition keeps formulas like combinations consistent. It also makes the recursive pattern, n factorial equals n times (n − 1) factorial, work down to zero.
How big can I calculate?
Standard calculators overflow around 170 factorial. Software can go much higher, and approximations such as Stirling's formula estimate very large ones.
Confirm the count of items is a non-negative whole number before computing a factorial; the operation is undefined for a negative or fractional count in its basic combinatorial sense.