An easier method to calculate factorials

factorial

To find the factorial of a number, $n$, you need to multiply $n$ by every number that comes before it.

For example, if $n = 4$, then $n! = 24$ since $4 \cdot 3 \cdot 2 \cdot 1 = 24$.

However, this method is very time consuming and, as $n$ gets larger, this method also become more difficult, so is there an easier method that I can use to find the factorial of any number?

Best Answer

To answer your question, there are several methods that can help calculate factorials faster, though most are either approximations or shortcuts for calculation. I will be detailing some of these methods below:

Method 1

As mentioned by Joe in the comments, Stirling's approximation is a good method to approximate the value of a large factorial, and by rewriting the factorial as a Gamma function, the following formula is obtained:

$$n! \sim \sqrt{2\pi n} \cdot \biggl(\frac{n}{e} \biggr)^n$$

$$\\$$

Method 2

Again, as mentioned by Math101 in the comments, we can make use of the property $n! = n(n - 1)!$ to quickly calculate a factorial given the value of a previous factorial.

For example, given that $5! = 120$ (or by calculating $5!$ by using the same method):

$$6! = 6 \cdot 5! = 6 \cdot 120 = 720$$

This method does not work as efficiently as Method 1, especially at larger values of $n$, but it may be useful in some ways.

$$\\$$

Method 3

By pairing up the numbers needed to calculate a factorial, a shortcut can be used to quickly calculate the factorial by using the commutative property ($xy = yx$).

For example:

$$8! = 8 \cdot 7 \cdot 6 \cdot 5 \cdot 4 \cdot 3 \cdot 2 \cdot 1 = (8 \cdot 1) \cdot (7 \cdot 2) \cdot (6 \cdot 3) \cdot (5 \cdot 4) = 8 \cdot 14 \cdot 18 \cdot 20 = 40320$$

The largest value is always paired up with the smallest value, the second-largest with the second-smallest, and so on.

Please have a read through the source for this method for more detail on how to use this method more efficiently.

Please note that there is no clear method to easily calculate large factorials; approximations can only bring you fairly close to the true value.


I hope this helps! I'm still new to MSE, so I would really appreciate any and all feedback. Thank you!