Factorial

The factorial of a number n is equal to the product of all the natural numbers that are less than or equal to n. The factorial is written using the exclamation point n!. For zero: 0! = 1. The factorial is mainly used in combinatorics, where it is used to calculate, for example, permutations. For example, a factorial of five would be equal to 5! = 5 · 4 · 3 · 2 · 1 = 120.

Definition of factorial

The factorial can be defined in different ways. The simplest one is probably this:

$$ n! = \begin{cases} 1&\text{pokud n = 0}\\ n\cdot (n-1)!&\text{jinak} \end{cases} $$

We can also give a definition using a product:

$$ n!=\prod_{k=1}^nk $$

Alternatively, still using the integral:

$$ (z-1)!=\Gamma (z):=\int_{0}^{\infty}t^{z-1}\mathrm{e}^{-t}\mathrm{d}t,\qquad\Re (z)>0. $$

(See the math forum for details.)

Calculating with factorials

Factori are often calculated in fractions. Here we then use the fact that n! = n · (n − 1)!. This is true by definition, let's show this with an example. We know that the factorial of four, 4!, is equal to the product of these natural numbers: 4 · 3 · 2 · 1. In doing so, we can write that the product 3 · 2 · 1 is equal to the factorial of three: 3 · 2 · 1 = 3!. The factorial of four can then be written as 4! = 4 · 3!.

$$ 4!=4\cdot\underbrace{3\cdot2\cdot1}_{=3!}=4\cdot3! $$

This allows us to effectively truncate many different factorials in fractions. Example - simplify the expression:

$$\frac{n!}{(n-2)!}$$

We simplify using the formula I mentioned a moment ago. In the numerator, we can split the factorial into n · (n − 1)! and we can still (using the same formula) split this into n · (n − 1) · (n − 2)!. Now we can shorten the fraction nicely:

$$\frac{n!}{(n-2)!}=\frac{n(n-1)\fbox{(n-2)!}}{\fbox{(n-2)!}}=n(n-1)$$

Another example:

$$\begin{eqnarray} \frac{n!\cdot(n+1)!}{(n-1)!\cdot(n+2)!}&=&\frac{n\cdot\fbox{(n-1)!}\cdot(n+1)!}{\fbox{(n-1)!}\cdot(n+2)!}\\ &=&\frac{n\cdot(n+1)!}{(n+2)!}\\ &=&\frac{n\cdot\fbox{(n+1)!}}{(n+2)\cdot\fbox{(n+1)!}}\\ &=&\frac{n}{n+2} \end{eqnarray}$$

And one last example for the factorial:

$$\begin{eqnarray} \frac{(2(n+1))!}{(2n)!} &=& \frac{(2n+2)!}{(2n)!}\\ &=&\frac{(2n+2)(2n+1)\fbox{(2n)!}}{\fbox{(2n)!}}\\ &=&(2n+2)(2n+1) \end{eqnarray}$$