Mathwords logoReference LibraryMathwords

Factorial

Factorial

The product of a given integer and all smaller positive integers. The factorial of n is written n! and is read aloud "n factorial".

Note: By definition, 0! = 1.

 

Formula: n! = n·(n – 1)·(n – 2) · · · 3·2·1
Example: 6! = 6·5·4·3·2·1 = 720

 

See also

Permutation formula, combination formula, binomial coefficient

Key Formula

n!=n(n1)(n2)321n! = n \cdot (n-1) \cdot (n-2) \cdots 3 \cdot 2 \cdot 1
Where:
  • nn = A non-negative integer whose factorial you want to compute
  • n!n! = The factorial of n, equal to the product of all positive integers from 1 to n

Worked Example

Problem: Compute 7! (7 factorial).
Step 1: Write out the definition: multiply 7 by every positive integer less than 7, down to 1.
7!=76543217! = 7 \cdot 6 \cdot 5 \cdot 4 \cdot 3 \cdot 2 \cdot 1
Step 2: Multiply the first two factors.
76=427 \cdot 6 = 42
Step 3: Continue multiplying from left to right.
425=21042 \cdot 5 = 210
Step 4: Keep going with the remaining factors.
2104=840,8403=2520,25202=5040,50401=5040210 \cdot 4 = 840, \quad 840 \cdot 3 = 2520, \quad 2520 \cdot 2 = 5040, \quad 5040 \cdot 1 = 5040
Answer: 7! = 5,040

Another Example

This example shows how to simplify a ratio of factorials by cancellation — a technique used constantly in permutations, combinations, and probability, where computing full factorials would be impractical.

Problem: Simplify the expression 10! ÷ 8! without computing each factorial fully.
Step 1: Expand 10! using the recursive property: 10! = 10 × 9 × 8!
10!8!=1098!8!\frac{10!}{8!} = \frac{10 \cdot 9 \cdot 8!}{8!}
Step 2: Cancel the common factor of 8! in the numerator and denominator.
1098!8!=109\frac{10 \cdot 9 \cdot \cancel{8!}}{\cancel{8!}} = 10 \cdot 9
Step 3: Multiply the remaining factors.
109=9010 \cdot 9 = 90
Answer: 10! ÷ 8! = 90

Frequently Asked Questions

Why does 0! equal 1?
The value 0! = 1 is defined so that formulas in combinatorics work consistently. For instance, the number of ways to arrange 0 objects is exactly 1 (do nothing). It also keeps the recursive relationship n! = n × (n − 1)! valid when n = 1, because 1! = 1 × 0! requires 0! to be 1.
Can you take the factorial of a negative number or a fraction?
The standard factorial function is defined only for non-negative integers (0, 1, 2, 3, …). However, mathematicians extend the idea to non-integers and some negative values using the gamma function, where Γ(n + 1) = n! for non-negative integers. You will not encounter this extension in most algebra or precalculus courses.
How are factorials used in permutations and combinations?
Permutations count ordered arrangements and use the formula P(n, r) = n! / (n − r)!. Combinations count unordered selections and use C(n, r) = n! / [r!(n − r)!]. Factorials appear in both formulas because they systematically count how many ways you can arrange or choose items from a set.

Permutations vs. Combinations

PermutationsCombinations
What it countsOrdered arrangements of r items from nUnordered selections of r items from n
Formula using factorialsP(n, r) = n! / (n − r)!C(n, r) = n! / [r!(n − r)!]
Does order matter?YesNo
Result sizeAlways ≥ the corresponding combinationAlways ≤ the corresponding permutation

Why It Matters

Factorials are essential in counting problems throughout algebra, probability, and statistics. You will use them every time you calculate permutations, combinations, or binomial coefficients — from choosing a committee to expanding (a+b)n(a + b)^n with the binomial theorem. They also appear in calculus (Taylor series) and are foundational in computer science algorithms.

Common Mistakes

Mistake: Confusing n! with n × 2, or thinking 0! = 0.
Correction: Remember that n! means multiply n by every positive integer below it, not just by 2. And 0! is defined as 1, not 0. A quick sanity check: 1! = 1, and 0! must also equal 1 for the recursive formula n! = n × (n − 1)! to hold at n = 1.
Mistake: Computing each full factorial separately when simplifying a ratio like n! / (n − r)!.
Correction: Cancel the common factorial instead. For example, 10! / 8! is not best solved by computing 3,628,800 ÷ 40,320. Write 10! as 10 × 9 × 8! and cancel 8! to get 90 directly. This avoids huge numbers and arithmetic errors.

Related Terms