Factorials are used throughout mathematics, in topics from algebra, analysis and calculus to probability and statistics. As a result, it helps to have an idea of how this important concept is applied in each of these areas.

So, when do you use factorials? **Factorials are used in binomial coefficients (entries in Pascal’s Triangle). They are also use in combinatorics & probability for combinations, permutations, & Poisson distributions. They are used in calculus & analysis for Power Series expansions (for e ^{x}, sin(x), & cos(x)) and the gamma function.**

Of course, factorials are really just a shorthand way to express a specific product of numbers. By using them, we are making it easier to read and write expressions that involve these products.

In this article, we’ll talk about when to use factorials. We’ll also see what the calculations for factorials look like.

Let’s get started.

## When To Use Factorials

Factorials are recursively defined, which means that (N+1)! depends on the value of N! – for example, 5! is equal to 5*4!, or 5*4*3*2*1.

Factorials are used of various purposes throughout mathematics in analysis, combinatorics, and statistics, such as:

**Permutations****Combinations****Binomial Coefficients (Entries In Pascal’s Triangle)****Poisson Distributions****Power Series Expansions For Various Functions (such as e**^{x}, sin(x), and cos(x))**Gamma Function**

Let’s take a closer look at each of these in turn, starting with binomial coefficients.

### Permutations

Factorials are used to calculate permutations when we select r items from a group of n distinct items (when order of the objects matters – for example, if we laid the r items out in a row on a table).

Remember that the definition of a permutation for items chosen from a group of n distinct items is:

_{n}P_{r}= n! / (n – r)!

or

_{n}P_{r}= n(n – 1)*…*(n – r + 1)

### Example 1: Permutations Of 3 Marbles

Let’s say we have 3 marbles: a blue, a green, and a red. We want to find out how many ways we can order the marbles if we choose two of them.

We would use the permutation formula for n = 3 (the total number of marbles we are choosing from) and r = 2 (the number of marbles we are choosing).

This gives us:

_{n}P_{r}= n! / (n – r)!_{3}P_{2}= 3! / (3 – 2)!_{3}P_{2}= 3*2*1 / 1!_{3}P_{2}= 6 / 1_{3}P_{2}= 6

Since the order of the marbles matters, the six permutations are as follows:

**Blue & green****Blue & red****Green & blue****Green & red****Red & blue****Red & green**

#### Example 2: Permutations of 5 Marbles

Let’s say we have 5 marbles: a blue, a green, a red, an orange, and a yellow. We want to find out how many ways we can order the marbles if we choose three of them.

We would use the permutation formula for n = 5 (the total number of marbles we are choosing from) and r = 3 (the number of marbles we are choosing).

This gives us:

_{n}P_{r}= n! / (n – r)!_{5}P_{3}= 5! / (5 – 3)!_{5}P_{3}= 5! / 2!_{5}P_{3}= 5*4*3*2! / 2!_{5}P_{3}= 5*4*3_{5}P_{3}= 60

### Combinations

Factorials are used to calculate combinations when we select r items from a group of n distinct items (when order does not matter – for example, if we put the r items in a bag).

Remember that the definition of a combination is:

_{n}C_{r}= n! / r!(n – r)!

or

_{n}C_{r}= n(n – 1)*…*(n – r + 1) / r(r – 1)*…*2*1

Note that _{n}C_{r} = _{n}P_{r} / r!, which means that for given values of n and r, there are fewer combinations than permutations. This is because the order of the items does not matter.

#### Example 1: Combinations Of 3 Marbles

Let’s say we have 3 marbles: a blue, a green, and a red. We want to find out how many ways we can choose two of the marbles.

We would use the combination formula for n = 3 (the total number of marbles we are choosing from) and r = 2 (the number of marbles we are choosing).

This gives us:

_{n}C_{r}= n! / r!(n – r)!_{3}C_{2}= 3! / 2!(3 – 2)!_{3}C_{2}= 3! / 2!1!_{3}C_{2}= 3*2*1 / 2*1*1_{3}C_{2}= 6 / 2_{3}C_{2}= 3

Since the order of the marbles does not matter, the three combinations are as follows:

**Blue & green (same as green & blue)****Blue & red (same as red & blue)****Green & blue (same as blue & green)**

#### Example 2: Permutations of 5 Marbles

Let’s say we have 5 marbles: a blue, a green, a red, an orange, and a yellow. We want to find out how many ways we can choose three of them.

We would use the combination formula for n = 5 (the total number of marbles we are choosing from) and r = 3 (the number of marbles we are choosing).

This gives us:

_{n}C_{r}= n! / r!(n – r)!_{5}C_{3}= 5! / 3!(5 – 3)!_{5}C_{3}= 5! / 3!2!_{5}C_{3}= 5*4*3! / 3!2!_{5}C_{3}= 5*4/ 2!_{5}C_{3}= 20 / 2_{5}C_{3}= 10

### Binomial Coefficients

Factorials are also used to calculate binomial coefficients (that is, the entries in Pascal’s Triangle). These coefficients make it much easier for us to expand powers of binomials, such as:

**(x + y)**^{4}= x^{4}+ 4x^{3}y + 6x^{2}y^{2}+ 4xy^{3}+ y^{4}

Note that it would become quite time-consuming to use the Distributive Property repeatedly on (x + y)^{n} for large values of n.

To find the binomial coefficients for (x + y)^{n}, we calculate the values of _{n}C_{r} for r = 0 to n. Note that there are n + 1 of these coefficients (the same number of entries in the nth row of Pascal’s Triangle).

For n = 4 (the example above), we calculate:_{4}C_{r} for r = 0, 1, 2, 3, and 4 to get:

_{4}C_{0}= 4! / 0!(4 – 0)! = 4! / 0!4! = 1_{4}C_{1}= 4! / 1!(4 – 1)! = 4! / 1!3! = 4_{4}C_{2}= 4! / 2!(4 – 2)! = 4! / 2!2! = 6_{4}C_{3}= 4! / 3!(4 – 3)! = 4! / 3!1! = 4_{4}C_{4}= 4! / 4!(4 – 4)! = 4! / 4!0! = 1

These are the same coefficients that we saw before: 1, 4, 6, 4, and 1. Note that the exponents for x and y are given by n – r and r for each term.

That is, the rth term in the binomial expansion (x + y)^{n} is given by:

_{n}C_{r}x^{n-r}y^{r}

We can also read the binomial coefficients for (x + y)^{n} from Pascal’s Triangle, which is pictured below:

You can learn more about Pascal’s Triangle in my article here.

### Poisson Distributions

Factorials are also used to define a Poisson distribution, which is used in probability & statistics. A Poisson distribution is a discrete probability distribution defined by the probability density function

**f(k, λ) = λ**^{k}e^{-λ}/ k!

Note that this is the probability that we see k occurrences of an event in a given time interval if λ is the mean (and variance) of the number of occurrences in a time interval (each event occurs independently).

The Poisson distribution can be used to model probabilities for things like:

**the number of patients admitted to a hospital emergency room in a given hour****the number of cars passing over a bridge on a given day**

### Power Series Expansions

Factorials are also used in analysis & calculus to write power series expansions for functions such as:

**e**^{x}**1 / (1 – x)****sin(x)****cos(x)**

A power series is the sum of all terms (from n = 0 to infinity) of the form:

**a**_{n}(x – c)^{n}

where a_{n} is the coefficient of the nth term, and c is a constant (the center). We can use any value for c, but it is often convenient to use a center of c = 0 (such as in a Maclaurin series, which is a Taylor series with c = 0).

This simplifies the terms to:

**a**_{n}(x – 0)^{n}= a_{n}x^{n}

The coefficients a^{n} for the functions mentioned earlier are as follows:

**e**^{x}: a_{n}= 1 / n!**1 / (1 – x): a**_{n}= 1

Note that we can find the value of the constant e by using x = 1, which gives us the sum of the reciprocal of every factorial from n = 0 to infinity:

- e = 1/0! + 1/1! + 1/2! + 1/3! + …

The terms of two common trig functions, sine and cosine, are given by:

**sin(x): (-1)**^{n}x^{2n+1}/ (2n + 1)!**cos(x): (-1)**^{n}x^{2n}/ (2n)!

These expansions make it clear that sin(0) = 0 and cos(0) = 1.

### Gamma Function

The gamma function expands the factorial function to complex numbers. It is defined by

**Γ(n) = (n – 1)!**

Note that this definition means that:

**Γ(n+1) = n!****Γ(n+1) = n(n-1)!****Γ(n+1) = nΓ(n)**

which means that gamma is a recursively defined function. It is used in analysis, calculus, differential equations, and statistics.

## Conclusion

Now you know when to use factorials in various areas within mathematics.

I hope you found this article helpful. If so, please share it with someone who can use the information.

Don’t forget to subscribe to my YouTube channel & get updates on new math videos!

~Jonathon