### The factorial function

The factorial function isn't often referred to as a function, but I'll do so in this section, because it has all of the properties of a function, as you will see. The symbol for factorial is the exclamation point. 3! is read as "3 factorial"

Factorials are defined below. The factorial of an integer, n, is given below. Notice that n factorial is just the product of all numbers from 1 up to n, though it's written backward from that in the definition. Notice that 1! = 1, 2! = 2·1 = 2, 3! = 3·2·1 = 6, and so on.

### The role of factorials in math

Factorials pop up all the time in a couple of areas of mathematics, so it's worth getting to know them and learning how to manipulate and interpret them.

In combinatorics, the study of the number of different ways of combining a bunch of "objects" taken all or a few at a time – a fundamental concept in probability theory – factorials are very important. Just as a quick example, the number of ways of arranging the numbers 1, 2, 3, 4, & 5 is 5! = 120 ways: 1, 2, 3, 4, 5;     1, 2, 3, 5, 4;     1, 3, 2, 4, 5, and so on ... through 120 different versions.

Factorials are also ubiquitous when we work with infinite series representations of functions, an extremely important concept in modern math and computing. The transcendental number e, the base of all continuously-growing exponential functions, for example, can be estimated by the series

$$e \approx \frac{1}{0!} + \frac{1}{1!} + \frac{1}{2!} + \frac{1}{3!} + \frac{1}{4!} + \dots$$

These are two major areas in which factorials are important, but they are by no means the only ones.

### Surprise:   0! = 1

If you looked closely at that last example, you might have been troubled by the first denominator, 0!. What's going on there if we can't divide by zero?

It turns out that we define 0! to be 1. In fact, we can "prove" that 0! = 1 in many ways, but one of the simplest is just this.

Consider that $(n + 1)! = (n + 1)·n!$

Now let n = 0, then we have

$$(0 + 1)! = (0 + 1)·0! \; ,$$

and dividing each side by 1, we get

$$0! = 1! = 1$$

Another way to think about 0! is to go back to combinatorics. If 3!, 2! and 1! are the number of ways of arranging 3, 2 and 1 item in a set, respectively, then the number of ways of arranging the empty set {   } is one. It can only be written in that one way.

### Algebra with factorials

Often we are faced with division problems like this:

They are solved by expanding the factorial to recognize what cancels from the numerator and denominator. In this case only the 6 is left in the denominator. Notice that it's not necessary to expand all the way like I did. You're probably smarter. I could have easily taken a shortcut like this:

Now we can extend that to factorials with variables. here's an example:

With a little practice, you'll be able to recognize where and when you can can cancel factorials and get it done pretty easily. It can really simplify problems, both in terms of the algebra and the size of the numbers you'll encounter. Remember that factorials grow very rapidly.

### Practice problems

Simplify these factorial expressions as much as possible.

 1 $$\frac{8!}{5!}$$ Solution \begin{align} \frac{8!}{5!} &= \frac{8\cdot 7 \cdot 6 \cdot 5!}{5!} \\ \\ &= 8\cdot 7\cdot 6 = \bf 336 \end{align} 2 $$\frac{3!}{7!}$$ Solution \begin{align} \frac{3!}{7!} &= \frac{3!}{5\cdot 4\cdot 3!} \\ \\ &= \frac{1}{5\cdot 4} = \bf \frac{1}{20} \end{align} 3 $$3! - 2!$$ Solution $$3! - 2! = 6 - 4 = 2$$ 4 $$4! - 3!$$ Solution $$4! - 3! = 24 - 6 = 18$$

 5 $$\frac{(n - 1)!}{n! \, (n + 1)!}$$ Solution \begin{align} &\frac{(n - 1)!}{n! \, (n + 1)!} \\ \\ &=\frac{(n - 1)!}{n! \, (n + 1)(n)(n - 1)!} \\ \\ &= \bf \frac{1}{n! \, n \, (n + 1)} \end{align} 6 $$\frac{(n + 1) n!}{(n - 1)!}$$ Solution \begin{align} &\frac{(n + 1)n(n - 1)!}{(n - 1)!} \\ \\ &= \bf n(n + 1) \\ \\ \end{align} 7 $$\frac{(2n)!}{2}$$ Solution Note, if n = 3, then (2n)! = 6! = 6·5·4·3·2·1. Notice also that all factorials except 0! and 1! are even numbers because they contain a factor of 2 (2·1) at the end, so they're divisible by 2. Beyond cancelling that final 2 with the 2 from the denominator, there's no further simplification we can do. 8 $$\frac{(n + 3)!}{(n - 1)!}$$ Solution \begin{align} &\frac{(n + 3)!}{(n - 1)!} \\ \\ &= \frac{(n + 3)(n + 2)(n + 1)n(n - 1)!}{(n - 1)!} \\ \\ &= \bf (n + 3)(n + 2)(n + 1)n \end{align}

### Limitations of factorials & the $\Gamma$ function

The factorial function is defined for positive integers and zero only. Notice that a negative factorial, as defined, would always give an infinite result. Think about n!, where n = -1. That would give us -1·(-1 - 1)(-1 - 2)(-1 - 3) ... which would never end and would get larger and larger in the negative direction.

We also don't know what to do with non-integers. But there is a way to do, say (4.23)! It's called the Gamma (Γ) function, and I'll reserve writing about that for another section.

### Factorials grow very rapidly

Factorials grow extremely rapidly. On a graph, a factorial function will always over take (cross) an exponential function, no matter what the base.

Remember that while the domain of an exponential function is (-∞, ∞), the domain of the factorial function is restricted to zero and positive integers (0, 1, 2, . . .).

Factorials get so large that your calculator will probably not be able to display some of the larger ones. Try calculating 69! or some larger factorial on your calculator.

xaktly.com by Dr. Jeff Cruzan is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Unported License. © 2012, Jeff Cruzan. All text and images on this website not specifically attributed to another source were created by me and I reserve all rights as to their use. Any opinions expressed on this website are entirely mine, and do not necessarily reflect the views of any of my employers. Please feel free to send any questions or comments to jeff.cruzan@verizon.net.