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

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


Limitations of factorials & the Γ 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


Creative Commons License   optimized for firefox
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.