Factorial
Factorial is a fundamental function in mathematics, often used in combinatorics. Factorial is written with an exclamation mark after a number, e.g. n!.
The definition is:
$$ \large n! = n \cdot (n-1) \cdot (n-2) \cdot \ldots \cdot 2 \cdot 1 $$
This means that we multiply the number n by all the natural numbers below it, down to 1.
Examples
$$ \large 5! = 5 \cdot 4 \cdot 3 \cdot 2 \cdot 1 = 120 $$
$$ \large 4! = 4 \cdot 3 \cdot 2 \cdot 1 = 24 $$
$$ \large 3! = 3 \cdot 2 \cdot 1 = 6 $$
$$ \large 2! = 2 \cdot 1 = 2 $$
$$ \large 1! = 1 $$
As a convention it is defined that:
$$ \large 0! = 1 $$
Everyday example
How many ways can 4 people be arranged in a row?
The first position can be chosen by 4 people, the next by 3, then 2 and finally 1. In total:
$$ \large 4 \cdot 3 \cdot 2 \cdot 1 = 4! = 24 $$
So there are 24 different ways.
Summary
Factorial is used to calculate the number of permutations and appears in many formulas in combinatorics and probability.
When you see n!, it means that you multiply n by all the positive numbers below it, down to 1. Factorial grows very quickly, even for small values of n.