Factorial Calculator (2024)

Welcome to the factorial calculator: a tool that calculates the factorial of any number from 0 to 170. On top of calculating, e.g., the 0-factorial or 5-factorial... we will also show you how to use the exclamation point in maths, provide information about the n-factorial formula and the applications it can have. By the end of this, we will have an answer to "what is a factorial?" using the factorial definition. And finally, we will dive into the maths behind it to find how we can include more than just positive integers by using the gamma function.

Exclamation point in maths: what is a factorial?

When you saw an exclamation point in maths for the first time, you probably got shocked or even thought that there was some kind of mistake or typo. But the reality is different: this exclamation point in maths is called the factorial or n-factorial. The factorial is a reasonably unknown operator that can, in fact, be viewed more as an abbreviation than an actual operator, at least at the beginning.

Factorial Calculator (1)

It is important not to confuse the factorial with the prime factorization of a number, which is a way of obtaining the prime numbers that, when multiplied together, give your number. Prime factorization has its uses in maths and is arguably more well-known than the n-factorial. Part of the reason for the popularity of prime factorization is its usefulness when calculating Greatest Common Factor (GCM) and the Least Common Multiplier (LCM), but we digress. However, if you'd like to follow the white rabbit, you can find more information in the prime factorization calculator.

To understand what the factorial does or means, we should start with an example. We could choose any number n and calculate its n-factorial value, but it's best to choose a relatively small number, so let's use 5-factorial.

5! = 5 × 4 × 3 × 2 × 1 = 120

From this example, you can see that it is not rocket science, and you might even take a guess at the factorial formula. You can also understand why this exclamation point in maths can be regarded as an abbreviation since it is not a new operation but rather a collection of multiplications. In short, and somewhat informally, we can define the factorial as the multiplication of all the positive integers smaller than and equal to the given number.

Playing a bit with this, we can see that for 5-factorial, we can relate it to the 4-factorial in a straightforward way:

5! = 5 × (4 × 3 × 2 × 1) = 5 × 4!

This kind of relationship between n-factorials with a different n is the basis of the mathematical formula that defines the factorial operation, as we will see in the next section.

The factorial operation is not used everywhere in maths, but it is essential in statistics and probability problems. In those cases, especially when one has to deal with permutations or combinatorics, the n-factorial appears almost all the time. In the following sections of our factorial calculator, we will see real-world examples of problems that require the usage of factorials and the factorial formula.

Getting mathematical: factorial definition and factorial formula

So far, we have seen a slightly loose answer to the question "what is a factorial?", but we have not given a proper factorial definition. Well, that is precisely the aim of this section: to see and explain the factorial formula and how we can find the factorial definition in a more mathematical way from it.

For a more mathematical description of the factorial formula, let's look at the n-factorial and how it relates to other factorials. In this case, n can be any number. If we look at the previous examples with 5-factorial, we can see that:

5! = 5 × 4! = 5 × (5-1)!

If we now extrapolate that to the n-factorial:

n! = n × (n-1)!

The above is the general factorial formula and is an integral part of the factorial definition. However, we're sure this does not answer all the questions about factorials you may have. For example, what would happen if we take a negative number? When do I stop subtracting numbers? These are valid questions that the factorial formula above doesn't answer, but are fundamental for having a proper factorial definition.

These two questions can be answered easily by stating that the factorial formula is only defined for positive integers, which means that we cannot go lower than n = 1. But this also brings up another question: What is the 0-factorial? Since we cannot use this formula, you are forgiven for thinking that this question has no answer, and the whole factorial thing is "fake news". However, there is a 'trick' to get around this: setting the value of the zero-factorial to a number by definition.

And, hence, we arrive at the convention:

0! = 1.

A small disclaimer is needed here since, in maths, things are never as easy as "choose a number and roll with it" there are many complex reasons as to why the value of zero-factorial has been set to one and not any other number. However, explaining these reasons in detail is far beyond the scope of this factorial calculator.

Basic values of factorials

Let's check now some of the value for the n-factorial of several small n, like zero factorial, 3 factorial, 5 factorial. Pay special attention to the value of 0 factorial because it is the most important one, and we will talk more about it later.

  • 0! = 1
  • 1! = 1
  • 2! = 2
  • 3! = 6
  • 4! = 24
  • 5! = 120
  • 6! = 720
  • 7! = 5040
  • 8! = 40,320
  • 9! = 362,880
  • 10! = 3,628,800

We can see how fast the factorial of a number increases as we use bigger numbers. This is yet another situation where scientific notation can save the day (if we know how to truncate to the necessary significant figures correctly) if you need to work with such big numbers. For factorials of numbers greater than 10, don't hesitate to use the factorial calculator above. Besides, you can use logarithms for the computation of factorials of higher numbers. To see how, you may like to check our logarithm calculator where we explain how logarithm can be applied for such arithmetic.

💡 And did you know that...

The factorials follow the well-known Benford's law?

0-factorial and why it is so special

The 0-factorial is a key part of the factorial definition. To understand why it is so important, we can show the problems we encounter when we try to calculate it using the factorial formula above:

0! = 0 × (0-1)!

It looks like no matter what the value of (0-1)! turns out to be, the result should always be 0! = 0, but things are more complicated than that in maths. In the previous section, we saw that the n-factorial is only defined for n > 0, so we have a problem here. The term (0-1)! is what mathematicians call: undefined expression, which means that the expression is not correct, and thus it has no mathematical meaning. This problem is the same as with division by zero. It's not that we cannot calculate it. The problem is that the expression doesn't make sense, it doesn't have a meaning.

This is a reason why 0! is critical to define as a convention value. Setting it's value to 0! = 0 would not be a good idea since it would mean that n! = 0 for any value of n. You can see why by applying the factorial formula. On the other hand, if we set zero-factorial to 1, we now retain the expected values for n-factorial while having a simple convention for the value of 0!.

In the following section, we will see another reason for setting zero-factorial to be equal to 1, with a bit more mathematical logic behind it. In doing that, we will also introduce the Gamma function, which is, in plain terms, an extended factorial formula that includes all positive numbers and the 0-factorial.

Gamma function: factorials of non-integer values

It is possible to determine the factorial of non-integer numbers – in fact, it is possible for all real and complex numbers, excluding negative integers. It requires the use of sophisticated mathematical tools, so we will try to give a more straightforward version here, retaining as much accuracy as possible. There have been several approaches to extending the factorial formula to include all positive numbers, each with subtle differences and mostly compatible with each other.

Factorial Calculator (2)

Let's start with the Gamma function. The Gamma function is a function that extends the notion of the n-factorial beyond integers. Obviously, the formula cannot be the same as we have used before because we would end up at a dead-end. In fact, this function extends the n-factorial to complex numbers as well, where the intuitive notion of a factorial is much harder to grasp. The only numbers for which the Gamma function is not defined are negative integers:

𝚪(z) = ∫tᶻ⁻¹ e⁻ᵗ dt

That's the Gamma function's definition, where t is the variable of integration from zero to infinity, and z is a (non-negative-integer) complex number. This formula is reduced to the n-factorial formula when applied over any positive integer n.

n! = 𝚪(n+1)

You can see 2 things from this formula:

  1. The Gamma function is much more complicated to use than the n-factorial formula for integers.
  2. It is not an exact copy of the n-factorial since you need to calculate the Gamma function's value for n+1 to obtain n!.

To remedy the second "problem", we can introduce the Pi function.

𝚷(z) = ∫tᶻ e⁻ᵗ dt

The Pi function is very similar to the Gamma function but shifted just enough so that the factorial and the function would match up.

𝚷(n) = n!, n ∈ 𝗡

You might be bewildered by the complexity of the maths behind this factorial formula, but don't fret!. As a simple trick, we can tell you that (-0.5)! = √π and (0.5)! = 0.5√π.

Interestingly, the first factorial formula is still valid here. So, for example:

(2.5)! = 2.5 × (1.5)! = 2.5 × 1.5 × (0.5)! = 1.875√π

Real-world applications

We have already discussed that the factorial is commonly used in probabilistic calculations or permutations, but there is more. Let's see the other places in which the n-factorial appears. Keeping within the realm of pure maths, we arrive at the binomial distribution that helps calculate probabilities of, for example, independent experiments having similar results.

Factorial Calculator (3)

Besides maths, the n-factorial appears in many other calculations, most notably in statistical physics and particle physics, which are parts of physics that deal with the permutations of particles, amongst other things. In particular, statistical physics is a beneficial area of physics that can be thought of as a "microscopic" version of thermodynamics. That is because statistical physics deals with thermodynamics problems (like the one in the latent heat calculator), but it does it from a particle-by-particle basis.

There are other areas (mostly in physics) that use factorials in calculations, and we could dive very deep into how and why they use the factorial formula in their calculations. Still, for a simple calculator like this one, that would be well beyond its reach.

How to calculate factorial in programming languages?

In our modern world, the tedious calculations are generally left to computers (just like you're doing by using this factorial calculator). The usage of coding languages to create small programs that will make those calculations for us are increasingly common. The n-factorial is a perfect candidate since it's not really complex conceptually. It does, however, require too much time for humans to calculate for vast numbers. For those who are using programming languages, we will leave some examples for some of the most common coding languages.

  • Python factorial (after 2.6): Use math.factorial(x) to get the Python factorial values.

  • Java factorial: There is no 'Java factorial' method in the standard Java packages.

  • Factorial Matlab: To calculate a factorial, matlab uses factorial(x). More information on the factorial Matlab function can be found in the official documentation.

  • Factorial in Excel: Use FACT to calculate the factorial in excel. Note that the factorial in excel only works with integers.

  • Factorial C++: There is no factorial c++ function included in the standard libraries. See here an example of a factorial c++ function.

  • Factorial Javascript: There is no factorial javascript function included in the standard libraries.

Factorial Calculator (2024)

FAQs

How do you calculate a factorial? ›

In short, a factorial is a function that multiplies a number by every number below it till 1. For example, the factorial of 3 represents the multiplication of numbers 3, 2, 1, i.e. 3! = 3 × 2 × 1 and is equal to 6.

Why is 5 factorial 120? ›

We use the notation 5! to represent 5 factorial. To find 5 factorial, or 5!, simply use the formula; that is, multiply all the integers together from 5 down to 1. When we use the formula to find 5!, we get 120.

How do you find Factorials quickly? ›

To do factorials, start by determining which number you're computing the factorial for, which will be the number that's in front of the exclamation point. Then, write out all of the numbers that descend sequentially from that number until you get to 1. Finally, multiply all of the numbers together.

What is a factorial of 5? ›

Factorial of a positive integer (number) is the sum of multiplication of all the integers smaller than that positive integer. For example, factorial of 5 is 5 * 4 * 3 * 2 * 1 which equals to 120.

What does 7 factorial mean? ›

factorial, in mathematics, the product of all positive integers less than or equal to a given positive integer and denoted by that integer and an exclamation point. Thus, factorial seven is written 7!, meaning 1 × 2 × 3 × 4 × 5 × 6 × 7.

How to simplify a factorial? ›

Simplify factorial quotients by canceling like integers in the numerator and denominator. Multiply all the remaining integers in the numerator. Multiply all the remaining integers in the denominator. Divide the product in the numerator by the product in the denominator.

What is the factorial rule in math? ›

The factorial rule says the factorial of any number is that number times the factorial of the previous number. This can be expressed in a formula as. = n ⋅ ( n − 1 ) !

What do factorials tell you? ›

We use factorials when we look at permutations and combinations. Permutations tell us how many different ways we can arrange things if their order matters. Combinations tells us how many ways we can choose k item from n items if their order does not matter.

What is the factorial for 20? ›

Summary: The factorial of 20 is 2432902008176640000.

What is the best algorithm for factorial? ›

The best algorithm that is known is to express the factorial as a product of prime powers. One can quickly determine the primes as well as the right power for each prime using a sieve approach. Computing each power can be done efficiently using repeated squaring, and then the factors are multiplied together.

How to do factorial mentally? ›

How to calculate a factorial
  1. Determine the number. Determine the number you are finding the factorial of. ...
  2. Write the sequence. Using the factorial formula, you can write out the sequence of numbers that you'll multiply. ...
  3. Multiply the numbers. Once you have the sequence of numbers written down, you can multiply them together.
Oct 22, 2023

At what age do you learn factorials? ›

Playing educational quizzes is a fabulous way to learn if you are in the 6th, 7th or 8th grade - aged 11 to 14. Ah yes, here we are being hit with yet another new math vocabulary word - factorials. You'll probably be very happy to learn that factorials are really very easy and even fun.

How big is 52 factorial? ›

' (“52 factorial”) which means multiplying 52 by 51 by 50… all the way down to 1. The number you get at the end is 8×10^67 (8 with 67 '0's after it), essentially meaning that a randomly shuffled deck has never been seen before and will never be seen again.

What is the factorial of 100 voice? ›

Answer. The approximate value of 100! is 9.3326215443944E+157. The number of trailing zeros in 100! is 24. The number of digits in 100 factorial is 158.

Top Articles
Our fiction addiction: Why humans need stories
Turkey Visa For Indians: Fees, Types And Documents Required
Dunhams Treestands
Craigslist Pets Longview Tx
Bashas Elearning
Combat level
The Atlanta Constitution from Atlanta, Georgia
New Slayer Boss - The Araxyte
Crossed Eyes (Strabismus): Symptoms, Causes, and Diagnosis
Tx Rrc Drilling Permit Query
Midway Antique Mall Consignor Access
1Win - инновационное онлайн-казино и букмекерская контора
FAQ: Pressure-Treated Wood
Help with Choosing Parts
Radio Aleluya Dialogo Pastoral
Gma Deals And Steals Today 2022
Craigslist Farm And Garden Cincinnati Ohio
2 Corinthians 6 Nlt
iZurvive DayZ & ARMA Map
Foxy Brown 2025
Lola Bunny R34 Gif
Touchless Car Wash Schaumburg
Stoney's Pizza & Gaming Parlor Danville Menu
All Breed Database
Best Sports Bars In Schaumburg Il
Integer Division Matlab
Celina Powell Lil Meech Video: A Controversial Encounter Shakes Social Media - Video Reddit Trend
Craigslist Dubuque Iowa Pets
Preggophili
Abga Gestation Calculator
Our 10 Best Selfcleaningcatlitterbox in the US - September 2024
Play It Again Sports Forsyth Photos
What is Software Defined Networking (SDN)? - GeeksforGeeks
Bursar.okstate.edu
Panchang 2022 Usa
Myhrconnect Kp
Whas Golf Card
Tamilyogi Ponniyin Selvan
Chilangos Hillsborough Nj
Metra Schedule Ravinia To Chicago
Myql Loan Login
Oriellys Tooele
Carroll White Remc Outage Map
Bunkr Public Albums
فیلم گارد ساحلی زیرنویس فارسی بدون سانسور تاینی موویز
Skyward Cahokia
Learn4Good Job Posting
17 of the best things to do in Bozeman, Montana
St Als Elm Clinic
Strange World Showtimes Near Century Federal Way
Room For Easels And Canvas Crossword Clue
Latest Posts
Article information

Author: Jerrold Considine

Last Updated:

Views: 6174

Rating: 4.8 / 5 (58 voted)

Reviews: 81% of readers found this page helpful

Author information

Name: Jerrold Considine

Birthday: 1993-11-03

Address: Suite 447 3463 Marybelle Circles, New Marlin, AL 20765

Phone: +5816749283868

Job: Sales Executive

Hobby: Air sports, Sand art, Electronics, LARPing, Baseball, Book restoration, Puzzles

Introduction: My name is Jerrold Considine, I am a combative, cheerful, encouraging, happy, enthusiastic, funny, kind person who loves writing and wants to share my knowledge and understanding with you.