What Is a Factorial (n!)? Why 0!=1, Permutations, and Explosive Growth
A factorial is the product of all integers from 1 up to n, written n!. It appears naturally when counting how many ways things can be arranged and underpins permutations, combinations, and probability. This article explains what a factorial is, why 0!=1, how the value grows explosively, its link to permutations and combinations, its uses, and the overflow pitfalls in calculators.
Have you ever seen the notation "n!" in a math textbook or on a calculator button? That is a factorial. The exclamation mark may look like emphasis, but it is a genuine mathematical operator meaning "multiply together every integer from 1 up to that number." This article explains, step by step, what a factorial is, why the factorial of zero equals one, and why the value becomes enormous so quickly.
What Is a Factorial (n!)
A factorial is the product of all integers from 1 up to a positive integer n, written n! and read "n factorial." Written as a formula, the definition is:
n! = n × (n − 1) × (n − 2) × … × 3 × 2 × 1
The easiest way to grasp it is to look at concrete values. Here are the factorials of small numbers.
| n | Calculation | n! |
|---|---|---|
| 1 | 1 | 1 |
| 2 | 2 × 1 | 2 |
| 3 | 3 × 2 × 1 | 6 |
| 4 | 4 × 3 × 2 × 1 | 24 |
| 5 | 5 × 4 × 3 × 2 × 1 | 120 |
Factorials have a handy property: n! = n × (n − 1)!. For example, 5! can be computed as 5 × 4! = 5 × 24 = 120. Because you only multiply the previous factorial by the next number, you can build up the values easily one step at a time. When you want to check values yourself, a Scientific Calculator with a factorial key (x!) lets you compute even large numbers in a single press.
Why 0! Equals 1
Reading the definition literally, since you "multiply starting from 1," the factorial of zero, 0!, might seem like it should be 0 or undefined. Yet in mathematics it is defined that 0! = 1. This is not arbitrary; for several reasons, setting it to 1 is the most natural and convenient choice.
First, trace the relationship n! = n × (n − 1)! backwards. Solving it for (n − 1)! gives (n − 1)! = n! ÷ n. Substituting n = 1 yields 0! = 1! ÷ 1 = 1 ÷ 1 = 1, so 0! = 1 follows naturally.
The second reason comes from counting. A factorial represents "the total number of ways to arrange n items in a row." So how many ways are there to arrange zero items (nothing at all)? It is natural to say there is exactly one arrangement: the "arrange nothing" arrangement. That is why 0! = 1 also matches real-world counting. This idea plays an important role in the formula for counting combinations as well.
Factorials Grow Explosively
The most striking property of factorials is that a small increase in n makes the value vastly larger. Because it repeats multiplication, it grows at a speed that single additions or multiplications cannot compare to. The table below shows this rapid growth.
| n | n! |
|---|---|
| 5 | 120 |
| 10 | 3,628,800 (about 3.6 million) |
| 13 | 6,227,020,800 (about 6.2 billion) |
| 20 | about 2.43 × 10^18 |
| 70 | more than 10^100 (a 1 followed by over 100 zeros) |
Even 10 gives about 3.6 million, and 20 reaches roughly 2.43 quintillion. 70! exceeds 10^100, a number said to surpass even estimates of the number of atoms in the universe. Factorials are known to grow even faster than exponential functions. This is why a fact like "the number of ways to order a 52-card deck is 52!, far larger than the age of the universe counted in seconds" holds true.
Relationship to Permutations and Combinations
The classic places factorials shine are permutations and combinations. Both count "how many ways there are to pick and arrange, or simply pick, some items," and factorials appear in their formulas.
Permutations (arrangements)
A permutation is the number of ways to choose r items from n distinct items and arrange them in order, expressed as:
nPr = n! ÷ (n − r)!
For example, choosing 3 people from 5 and lining them up gives 5P3 = 5! ÷ 2! = 120 ÷ 2 = 60 ways. The hallmark of a permutation is that different orders are counted as distinct.
Combinations (selections)
A combination counts the number of ways to choose r items without regard to order:
nCr = n! ÷ ( r! × (n − r)! )
It is the permutation divided by r!, the number of ways to reorder the chosen r items. Thanks to setting 0! = 1, nCn (choosing all of them) computes cleanly as n! ÷ (n! × 0!) = 1, which shows how well the definition is chosen. When you want to check actual numbers, the Combination Calculator lets you find permutation and combination values just by entering n and r, with no need to do the messy factorial division by hand.
What It Is Used For: Probability and Counting
Factorials are used widely not only in pure math problems but also in everyday probability and counting calculations. You could say a factorial is involved in almost any situation where you count "how many ways are there in total."
- Probability: the chance that a specific arrangement appears in a lottery or card draw is found as "the number of favorable cases ÷ the total number of cases." Factorials (permutations and combinations) are used to count those cases.
- Counting arrangements and seats: the total number of ways to line up several people in a row, or seat them around a table, is expressed with factorials.
- Statistics and data analysis: formulas for probability distributions such as the binomial distribution include combinations (that is, factorials).
For instance, "how many ways are there to line up 7 people?" gives 7! = 5,040, and "how many ways to choose a committee of 3 from 10 people?" gives the combination 10C3 = 120. Everyday counting problems like these can be expressed with factorials. When you want to do such calculations quickly and accurately, the Combination Calculator and a Scientific Calculator with a factorial key are handy.
Watch Out for Overflow
When handling factorials on a calculator or in a program, something you must know about is overflow. As noted, factorials grow explosively, so entering only a slightly larger n can quickly exceed the maximum number the computer can handle.
For example, the range many programming languages can safely handle as an integer is up to about 9.2 × 10^18 for a signed 64-bit integer. In factorial terms, 20! fits, but 21! exceeds this range and can no longer be computed correctly. Beyond the limit, you may get an error, or, with no warning at all, a completely different (often negative) value can be returned; the latter is especially easy to miss and dangerous.
Computing with decimals (floating-point numbers) lets you handle larger n, but introduces a different problem: fine precision is lost and the result becomes an approximation. To obtain large factorials exactly, you need an environment or tool that supports "arbitrary-precision integers" with no digit limit. When doing calculations that involve factorials, it is important to be aware of "how precisely the tool you are using can actually compute." To check safely at hand, try starting with smaller values of n in a Scientific Calculator that handles display digits carefully.
Despite its simple definition as the product from 1 to n, the factorial, with its 0! = 1 convention, explosive growth, and reach into permutations, combinations, and probability, is a foundational concept supporting the world of mathematical counting. Start by computing permutation and combination values in the Combination Calculator and factorials themselves in a Scientific Calculator, and feel for yourself just how fast the numbers grow.
Please note that this article is intended to provide general information. The precision and limits of factorial-based calculations vary with your input and the tool's specifications. For important calculations, verify with more than one method and make your decision after checking the latest official information and reliable sources.
FAQ
What is a factorial (n!)?
A factorial is the product of all integers from 1 up to a positive integer n, written n!. For example, 5! = 5 × 4 × 3 × 2 × 1 = 120. It represents the total number of ways to arrange n items in a row and underpins permutations, combinations, and probability. It is read "n factorial."
Why does 0! (the factorial of zero) equal 1?
From the relationship n! = n × (n − 1)!, you can derive (n − 1)! = n! ÷ n; substituting n = 1 gives 0! = 1! ÷ 1 = 1. It is also natural to say "there is exactly one way to arrange zero items: arranging nothing," and the combination formula works out cleanly thanks to this convention.
How large do factorials get?
They grow very fast. 10! is about 3.6 million, 20! is about 2.43 × 10^18, and 70! exceeds 10^100 (a 1 followed by over 100 zeros). Because factorials grow even faster than exponential functions, be aware that a small increase in n makes the value vastly larger.
How are factorials related to permutations and combinations?
Both include factorials: a permutation is nPr = n! ÷ (n − r)! and a combination is nCr = n! ÷ ( r! × (n − r)! ). A permutation counts ordered arrangements, while a combination counts unordered selections, both essential for probability and counting. WAZA TOOLS' Combination Calculator finds them instantly when you enter n and r.
Are the values I enter in the factorial calculation tools sent to a server?
WAZA TOOLS' Combination Calculator and Scientific Calculator run entirely in your browser, so the numbers you enter and the results are never sent to or stored on a server. They work on smartphones too, and you can calculate factorials, permutations, and combinations as many times as you like, for free.