logo

Why Factorial 0 is Defined as 0!=1 📂Functions

Why Factorial 0 is Defined as 0!=1

Definition

For the factorial of $0 \notin \mathbb{N}$, it is defined as follows $0!$. $$ 0! := 1 $$

Explanation

Why is $0!$ not $0$ but $1$? Originally, since $0! := 1$ is a definition, there is no need for proof, and the process of understanding why such a definition is valid is close to a request to ‘accept why this definition was made.’ Let’s understand it step by step according to the level.

Middle School Level

For a natural number $n$, $n!$ can be defined as follows. $$ n! := n \times (n-1) \times \cdots \times 2 \times 1 $$ Simply put, the factorial is not so difficult as it is the product of subtracting $1$ from $n$, and it is soon understood why this is necessary. (If advancing a bit ahead of the curriculum) You can encounter factorials from middle school through permutations and combinations, and they appear immediately in permutations $_{n} P _{r}$ and binomial coefficients $_{n} C_{r}$. $$ \begin{align*} _{n}P_{r} &:=& n ( n - 1 ) \cdots ( r + 1 ) r &=& {{ n! } \over { (n-r)! }} \\ _{n}C_{r} &:=& {{ _{n}P_{r} } \over { r! }} &=& {{ n! } \over { r! (n-r)! }} \end{align*} $$ To say that $r = n$ means calculating permutations and combinations by picking all $n$ items out of $n$ items, $_{n} P _{n} = n! / 0!$ is the same as the number of ways $n!$ to arrange $n$ items in order, and $_{n} C _{n} = n! / n! 0!$ should also be the same as the number of ways $1$ to pick all $n$ items. At this point, $x = 0!$ must be a number that satisfies the following equation formally. $$ \begin{cases} \displaystyle{{ n! } \over { x }} &= n! \\ \displaystyle {{ n! } \over { n! x }} &= 1 \end{cases} $$ There’s no reason it has to be a system of linear equations, but anyway, the solution that simultaneously satisfies both equations is $x = 1$. Assuming that $_{n}P_{r}$ and $_{n}C_{r}$ are validly defined as factorials, it has shown that it is mathematically neat and convenient to define $0!$ as $1$. Even if we may not understand the meaning of factorials in the vast and deep world of mathematics, it seems clear that this is a practical definition for now.

High School Level 1

As high school students, they learn how the power of $a$ extends to negative numbers when learning about exponential functions. Firstly, the power of $2$ for natural numbers logically unfolds as follows. $$ \begin{align*} 2^{2} =& 4 \\ 2^{3} =& 8 \\ 2^{4} =& 16 \\ 2^{5} =& 32 \\ \vdots & \end{align*} $$ As you see, $2^{x}$ increases by $2$ times for each line, with $x$ increasing by $1$. This is the concept of exponentiation that can be understood immediately, even for those who are weak in mathematics. On the other hand, generalizing this to all integers is easier to understand by seeing the pattern in books. $$ \begin{align*} 2^{2} =& 4 \\ 2^{1} =& 2 \\ 2^{0} =& 1 \\ 2^{-1} =& 0.5 \\ \vdots & \end{align*} $$ Again, $2^{x}$ decreases by $2$ times for each line, with $x$ decreasing by $1$. This shows a formally plausible pattern, beyond whether the expression $2^{0}, 2^{-1}$ is correct or such a thing is possible. The lesson from the example of $2^{x}$ is that the expression brilliantly shows that when $x$ increases, it doubles, and when it decreases, it halves.

Now, let’s return to the factorial. $n!$ unfolds in the following way by multiplying $n$ to $(n-1)!$. $$ \begin{align*} 1! =& 1 \\ 2! =& 1! \times 2 \\ 3! =& 2! \times 3 \\ 4! =& 3! \times 4 \\ \vdots & \end{align*} $$ As with the example of the exponential function, let’s ‘flip’ this in a way that ‘makes sense.’ Since $n!$ increased by multiplying $n$, now it should be divided as $n$ decreases. $$ \begin{align*} \vdots & \\ 4! =& 5! \div 5 \\ 3! =& 4! \div 4 \\ 2! =& 3! \div 3 \\ 1! =& 2! \div 2 \\ 0! =& 1! \div 1 \end{align*} $$ $1! = \prod_{k=1}^{1} 1$ So dividing it by $1$ to get $1! \div 1 = 0!$ is ’logically’ $1$. A notable point here is that such persuasion does not inform at all about how $0! = 1$ is useful. It’s pushing this definition purely on mathematical intuition, for its beauty alone.

College Level

When students reach college, they learn about integrals with unbounded range bound, and various specialized textbooks introduce something called a Gamma function.

Gamma function as a generalization of the factorial: For a natural number $n \in \mathbb{N}$, $\Gamma (n) = (n-1)!$ holds.

For the factorial to be a special case of the Gamma function, it must be $0! = 1$. The Gamma function is defined as follows $$ \Gamma (x) = \int_{0}^{\infty} t^{x-1} e^{-t} dt $$ and by substituting $x=1$ into it $$ \begin{align*} \Gamma (1) =& \int_{0}^{\infty} t^{1-1} e^{-t} dt \\ =& \int_{0}^{\infty} e^{-t} dt \\ =& \left[ - e^{-t} \right]_{0}^{\infty} \\ =& - 0 - (-1) = 1 \end{align*} $$ and since $0! = \Gamma (1)$, to extend $n!$ for $0$, it makes sense to define it as $0! = 1$.

Joke

Originally, in programming, 0!=1 should be true, so $0!=1$ is correct.