Factorial Example 04Aa2D
1. The problem is to understand how factorial works and see an example.
2. The factorial of a non-negative integer $n$, denoted by $n!$, is the product of all positive integers less than or equal to $n$.
3. The formula is:
$$n! = n \times (n-1) \times (n-2) \times \cdots \times 2 \times 1$$
4. Important rules:
- $0! = 1$ by definition.
- Factorials grow very fast as $n$ increases.
5. Example: Calculate $5!$
$$5! = 5 \times 4 \times 3 \times 2 \times 1$$
6. Calculate step-by-step:
$$5 \times 4 = 20$$
$$20 \times 3 = 60$$
$$60 \times 2 = 120$$
$$120 \times 1 = 120$$
7. So, $5! = 120$.
This means multiplying all integers from 5 down to 1 gives 120.