The product of the whole numbers from 1 to n is written n! and read "n factorial": n!=n×(n−1)×⋯×2×1
about 25 min1 simulation2 practice questions1 Python program5 questions to check yourself
This lesson is free to read. Enroll free to keep your place and take the tests.
Lesson 3 of 3Show all lessonsHide
Try the code and the simulations beside the lesson.
What you will be able to do
write a product of whole numbers counting down to 1 as a factorial;
use the rule n!=n×(n−1)!, and explain why 0!=1;
simplify ratios of factorials;
write a product counting down from n as a ratio of factorials.
A product that keeps appearing
Mira puts 5 different books in a row on a shelf. The first place has 5 choices, the next 4, then 3, 2 and 1. So there are
5×4×3×2×1=120
arrangements. Products like this one, counting down to 1, appear in counting again and again. They get a short name.
The factorial
For a natural number n, the product 1×2×3×⋯×n is written n!, and read "n factorial".
n
n!
n
n!
1
1
5
120
2
2
6
720
3
6
7
5040
4
24
8
40320
Each factorial is the one before it, times the new number:
n!=n×(n−1)!
For example, 6!=6×5!=6×120=720. So you never need to multiply a long product from the start.
Why 0! = 1
The rule n!=n×(n−1)! with n=1 reads 1!=1×0!. Since 1!=1, the only value that keeps the rule true is 0!=1. So we define0!=1.
There is a counting reason too. There is exactly one way to arrange no objects: do nothing. Formulas in the next courses will give 0! in their answers, and 0!=1 makes them work every time.
Working with factorials
Factorials grow fast, so do not multiply them out. Cancel first.
8!10!=8!10×9×8!=10×9=90.
5!×2!7!=27×6=21.
The reverse is useful as well. A product counting down from n is a ratio of factorials:
9×8×7=6!9!
The bottom, 6!, cancels the numbers from 6 down to 1 that the product leaves out.
Some rules that look natural are false. In general (2n)!=2×n!, and (a+b)!=a!+b!. For example, 4!=24, but 2×2!=4.
A worked example
Find x if 7!1+8!1=9!x.
Clear the fractions. Multiply every term by 9!: 7!9!+8!9!=x.
Cancel each ratio.7!9!=9×8=72 and 8!9!=9.
Add.x=72+9=81.
Practise with new numbers
Try it in Python
The program builds each factorial from the one before, with the rule n!=n×(n−1)!. Then it compares with math.factorial, and cancels a ratio.
A look ahead
Mira now chooses only 3 of her 5 books, and puts them in a row. There are 5×4×3=60 arrangements, which is 2!5!. Arrangements like this are called permutations, and the next course gives them their own formula.
Common mistakes
Taking 0! as 0.0!=1. Otherwise the rule 1!=1×0! would fail.
Cancelling the numbers inside the factorial.3!6! is 6×5×4=120, not 2!.
Splitting a factorial over a sum or a product.(a+b)! is not a!+b!, and (2n)! is not 2×n!.
Multiplying out before cancelling. Cancel the common factorial first; the numbers stay small.
Remember these
n!=1×2×⋯×n, and 0!=1.
n!=n×(n−1)!.
(n−2)!n!=n(n−1), and the like: cancel the smaller factorial.
A product of k numbers counting down from n is (n−k)!n!.
Check yourself
Try each one on your own first. If you are stuck, open a hint. Then check with Show the answer.
Find 5!−3!.
Simplify 10!12! without a calculator.
Write 11×10×9×8 as a ratio of factorials.
Is 3!+3!=6!? Is 3!×4=4!?
Find n if (n−1)!n!=15.
Enroll free in The Fundamental Principle of Counting
Every lesson is open to read. Enrolling also lets you:
Mark lessons done and carry on where you stopped.
Take the tests of this lesson and its course.
Count the course towards the certificate for its chapter.