The factorial of a whole number n, written n!, is the product of all the whole numbers from n down to 1. For example, 5! = 5 × 4 × 3 × 2 × 1 = 120. It counts the ways to arrange n different objects in a row. By agreement, 0! = 1.
Each spot has one fewer choice than the spot before, so the number of orders is 4 × 3 × 2 × 1 = 4!. The table shows how quickly factorials grow.
Formal definition and notation
For a positive integern, n! = n(n − 1)(n − 2) ⋯ 2 · 1, and 0! = 1. Equivalently, factorials are defined recursively by 0! = 1 and n! = n · (n − 1)! for n ≥ 1. The numbern! is the number of permutations (orderings) of n distinct objects. Factorials are not defined for negative integers.
Symbol
Read it as
Meaning
n!
n factorial
the product n × (n − 1) × ⋯ × 1
0!
zero factorial
equals 1
n!(n − r)!
n factorial over n minus r factorial
the number of ordered arrangements of r objects chosen from n
Key facts
Factorials grow very fast: 10! = 3,628,800, and 20! has 19 digits.
0! = 1: there is exactly one way to arrange zero objects (do nothing), and it keeps n! = n × (n − 1)! working at n = 1.
Factorials power counting formulas: permutations n!(n − r)! and combinationsn!r!(n − r)!.
n! is divisible by every whole number from 1 to n. For example, 6! = 720 is divisible by 4 and by 5.
The exclamation mark binds tightly: 2 × 3! means 2 × 6 = 12, not 6! = 720.
Where the name comes from. The exclamation-mark notation n! was introduced by Christian Kramp in 1808.
Factorial formula
Factorial formula
n! = n × (n − 1) × (n − 2) × ⋯ × 2 × 1
n
a whole number (0, 1, 2, 3, …)
n! = n × (n − 1)!
each factorial is the one before times the next number, so 6! = 6 × 120 = 720
To simplify a quotient of factorials, cancel the shared part instead of multiplying everything out: 9!7! = 9 × 8 = 72.
Factorial examples, step by step
Example 1: Evaluate a factorial
Warm-up
Find 6!.
Write the product: 6! = 6 × 5 × 4 × 3 × 2 × 1.
Multiply in pairs: 6 × 5 = 30 and 4 × 3 = 12, with 2 × 1 = 2.
A factorial n! counts orders of all n objects. A permutation count n!(n − r)! counts orders of only r of them, such as 5!3! = 20 ways to pick and order 2 of 5.
Answer: C.5! = 5 × 4 × 3 × 2 × 1 = 120. 15 adds instead of multiplying, 25 is 52, and 3125 is 55.
Question 2 of 3
What is 12!10!?
Show answer and explanation
Answer: A.12! = 12 × 11 × 10!, so the quotient is 12 × 11 = 132. 65 divides 12 by 10, and 2 or 2! subtracts the numbers.
Question 3 of 3
In how many orders can 7 runners finish a race if there are no ties?
Show answer and explanation
Answer: D. 7 choices for first place, 6 for second, and so on: 7! = 5040. 49 is 72, 28 is 7 + 6 + ⋯ + 1, and 7 counts only the winner.
Factorial: frequently asked questions
Why does 0! equal 1?
There are two good reasons. Counting: n! is the number of ways to arrange n objects, and there is exactly one way to arrange zero objects. Pattern: n! = n × (n − 1)!, so 1! = 1 × 0!. Since 1! = 1, 0! must be 1. This choice also makes formulas like n!(n − r)! work when r = n.
What is factorial used for?
Factorials count arrangements. They answer questions like how many ways 8 books can sit on a shelf (8! = 40,320) or how many seating orders a team has. They appear in permutation and combination formulas, in probability, in the binomial theorem, and in calculus series such as the one for e.
Can you take the factorial of a negative number or a fraction?
Not with the school definition. n! is defined only for whole numbers 0, 1, 2, 3 and so on, because it counts arrangements of whole objects. Advanced math extends the idea to fractions using the gamma function, but negative integers still have no factorial.
ProductThe product is the answer you get when you multiply two or more numbers. In 4 × 6 = 24, the product is 24, and 4 and 6 are the factors. In word problems, the words “product of” always mean multiply, so “the product of 3 and 7” is 21.Operations · Grade 3, Grade 4, Grade 5Positive IntegerA positive integer is a whole number greater than zero: 1, 2, 3, 4 and so on. Positive integers have no fraction or decimal part and are never 0 or negative. They are also called counting numbers, and the set is written ℤ+. When a test says n is a positive integer, n cannot be 0, −3 or 2.5.Problem Solving · Grade 6, Grade 7, Algebra 1NumberA number is an amount or value used to count, measure, order and compare. We write numbers with digits (7), words (seven) or other symbols, but the number itself is the amount: 7 dots, the word seven and the numeral 7 all show the same number. Numbers include whole numbers, fractions, decimals and negatives.Number System · Kindergarten, Grade 1, Grade 2PermutationA permutation is an arrangement of objects in a specific order, so ABC and CBA count as different. The number of ways to arrange r objects chosen from n different objects is P(n, r) = n!(n − r)!. For example, picking a president and vice president from 5 people gives 5 × 4 = 20 permutations.Probability · Algebra 2, Precalculus, StatisticsPowerA power is a number written as a base with an exponent, such as 53, or the value that results, 53 = 5 × 5 × 5 = 125. We say 125 is the third power of 5, or “5 to the third power”. The second power is called the square and the third power the cube.Number System · Grade 5, Grade 6, Grade 7CombinationA combination is a selection of items from a group in which the order does not matter. Picking Ana, Ben and Cy for a team is the same combination as Cy, Ana and Ben. The number of ways to choose r items from n is C(n, r) = n!r!(n − r)!; for example, C(5, 2) = 10.Probability · Algebra 2, Precalculus, StatisticsWhole NumberA whole number is 0 or a positive counting number: 0, 1, 2, 3, and so on. Whole numbers do not include fractions, decimals, or negative numbers, so 12 is a whole number but 8.5, 34 and −3 are not. Every whole number is also an integer.Number System · Grade 3, Grade 4, Grade 5SimplifySimplify means to rewrite a number or expression in a shorter, easier form without changing its value. To simplify a fraction, divide the numerator and denominator by a common factor until none is left: 1824 = 34. To simplify an expression, combine like terms and do the operations you can: 3x + 2x = 5x.Number System · Grade 4, Grade 5, Grade 6FactorA factor is a number or expression that divides another number or expression evenly, with no remainder. Factors multiply together to make a product: 4 × 6 = 24, so 4 and 6 are factors of 24. Every whole number greater than 1 has at least two factors, 1 and itself.Number System · Grade 4, Grade 5, Grade 6ExponentAn exponent tells how many times to use a base as a factor. It is the small raised number to the upper right of the base: in 53, the base is 5 and the exponent is 3, so 53 = 5 × 5 × 5 = 125. Any nonzero number with an exponent of 0 equals 1.Algebra · Grade 6, Grade 7, Grade 8BinomialA binomial is a polynomial with exactly two terms, joined by a plus or minus sign. Examples are x + 7, 3m − 4 and a2 − 9. Combine like terms before counting: 3x + 5x is 8x, one term. A polynomial with one term is a monomial; three terms make a trinomial.Algebra · Algebra 1, Algebra 2SeriesA series is the sum of the terms of a sequence. The sequence 3, 7, 11, 15 is a list; the series 3 + 7 + 11 + 15 = 36 is what you get by adding it. A finite series stops after n terms, written Sn. An infinite series has a sum only if its partial sums approach a fixed number.Functions · Algebra 2, Precalculus, CalculusProbabilityProbability measures how likely an event is, from 0 for impossible to 1 for certain. For equally likely outcomes it is the number of favorable outcomes divided by the total number of outcomes: for a fair coin, the probability of heads is 12. Probabilities can be written as fractions, decimals or percents.Probability · Grade 6, Grade 7, Grade 8Euler's NumberEuler’s number, written e, is an irrational constant approximately equal to 2.71828. It is the number that ( 1 + 1n )n gets closer and closer to as n grows. It is the base of natural exponential growth, ex, and of the natural logarithm, lnx.Functions · Algebra 2, Precalculus, CalculusMultipleA multiple of a number is the result of multiplying that number by any whole number. The multiples of 4 are 4, 8, 12, 16, and so on, continuing without end. Every number is a multiple of itself and of 1. To test a number, divide: if the remainder is 0, it is a multiple.Number System · Grade 4, Grade 5, Grade 6