# Jorge Valle Jorge Valle is a front end developer with a particular passion for, and expertise in, JavaScript and user interfaces. Lately, he's also been diving into machine learning.

# What is the factorial?

## Formula

The factorial of an integer is the product of all integers from that integer down to one. It's denoted by an exclamation mark immediately following the integer. When read aloud, it's voiced as "n factorial".

Formally, the factorial of an integer $n$ is defined as follows.

So we multiply all the terms from $n$ down to one, and the factorial is the result. Simple.

## Why is it useful?

Factorials are useful because they afford us an easy way to calculate permutations: the different sequential combinations of $n$ objects that can be achieved.

By way of example, let's say we have three objects: $A, B, C$. Here are all the ways we could sequentially arrange them.

We can arrange them in six different ways. An easy way to find that out, without having to draw the permutations by hand, would be to calculate the factorial of three: $3!$

## Intractability

Notice that factorials get very large, very quickly.

Therefore, in the domain of algorithm analysis, an algorithm running in factorial time is said to be intractable. 