Open In App

Factorial Formula

Last Updated : 23 Jul, 2025
Comments
Improve
Suggest changes
Like Article
Like
Report

The factorial is one of the most fundamental mathematical operations in combinatorics, algebra, and number theory. Represented by an exclamation mark (!), the factorial of a non-negative integer n, denoted as n!, is the product of all positive integers less than or equal to n. It plays a crucial role in permutations, combinations, binomial expansions, and more

The formula for the factorial is:

Factorial
Factorial Formula

Factorial of n = n! = n × (n - 1) × (n - 2) × ... × 1

Examples:

  • 0! = 1
  • 1! = 1
  • 3! = 3 x 2 x 1 = 6
  • 4! = 4 x 3 x 2 x 1 = 24

Factorial Zero (0!)

The value of Zero factorial is equal to 1. It its represented as 0! = 1, to read more about why zero factorial is zero check this article. [Read Here!]

Formula for Counting Trailing 0s in Factorial

Trailing 0s in n! = Count of 5s in prime factors of n! = floor⌊n/5⌋ + floor⌊n/25⌋ + floor⌊n/125⌋ + …

How does this work? A 0 is formed by the multiplication of 5 and 2 (10). So if we consider all prime factors of all numbers from 1 to n, there would be more 2s than 5s. So the number of 0s is limited by a number of 5s. If we count a number of 5s in prime factors, we get the result. Consider the following examples:

Count the number of training zeros in 100!

  1. ⌊100/5⌋ = 20 (There are 20 multiples of 5 between 1 and 100).
  2. ⌊100/25⌋ = 4 (There are 4 multiples of 25 between 1 and 100).
  3. ⌊100/125⌋ = 0 (There are no multiples of 125 between 1 and 100).

So, the total number of trailing zeros in 100! is: 20 + 4 = 24 trailing zeros.

To read more about floor function check - Floor Function ⌊ ⌋

Factorials of Numbers 1 to 10 Table

Here's a clear and concise Factorial Table for Numbers 1 to 10, including both the expansion and the computed value:

n! (Factorial)

Expansion

Value

1!

1

1

2!

2 × 1

2

3!

3 × 2 × 1

6

4!

4 × 3 × 2 × 1

24

5!

5 × 4 × 3 × 2 × 1

120

6!

6 × 5 × 4 × 3 × 2 × 1

720

7!

7 × 6 × 5 × 4 × 3 × 2 × 1

5,040

8!

8 × 7 × 6 × 5 × 4 × 3 × 2 × 1

40,320

9!

9 × 8 × 7 × 6 × 5 × 4 × 3 × 2 × 1

362,880

10!

10 × 9 ×8 × 7 × 6 × 5 ×4 × 3 × 2 × 1

3,628,800

Applications of Factorial

The factorial formula is used in many areas, specifically in permutations and combinations of mathematics. For example,

Permutations:

A permutation is an arrangement of objects in a definite order. The members or elements of sets are arranged here in a sequence or linear order

  • The number of ways n distinct objects can be arranged in a row is equal to n!
  • Permutation gives the number of ways to select r elements from n elements when order matters. It is given using the formula nPr.

nPr = n! / (n - r)!

Combinations

The combination is defined as “An arrangement of objects where the order in which the objects are selected does not matter.” The combination means “Selection of things”

  • Combination gives the number of ways to select r elements from n elements where order does not matter. It is given as nCr.

nCr = n! / r! (n - r)!

Binomial Theorem:

The Binomial Theorem provides a systematic method for expanding expressions raised to a positive integer power. It is a powerful tool in algebra with wide-ranging applications in areas such as probability, combinatorics, and calculus.

(a + b)^n = \sum_{k=0}^{n} \binom{n}{k} a^{n-k} b^k

Properties of Factorial

  • A factorial of any number is a whole number.
  • A factorial can also be represented as a recursive function.

n! = n × (n - 1) × (n - 2) × ... × 1 = n × (n - 1)!

  • Factorial of zero is 1, that is 0! = 1.
  • Factorial of negative numbers is not defined.

Solved question on Factorial

Question 1: Find the value of factorial of 5.
Solution:

To find the factorial of 5, we need to multiply all the whole numbers smaller than or equal to 5.

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

Question 2: Find the value of a number x, given factorial of x is 720.
Solution:

Apply the recursive property of factorial to find x. Until and unless we get 720 as our result, we will proceed recursively.

1! = 1
2! = 2 × 1! = 2
3! = 3 × 2! =6
4! = 4 × 3! = 4 × 6 = 24
5! = 5 × 4! = 5 × 24 = 120
6! = 6 × 5! = 6 × 120 = 720

Since 720 is obtained as the factorial of 6, one can compare the value of x with 6.
Thus, the value of x = 6

Question 3: Find the number of ways 5 distinct objects can be arranged in a row.
Solution:

Use the property that the number of ways n distinct objects can be arranged in a row is equal to n!

Thus, 5 distinct objects can be arranged in 5! = 5 × 4 × 3 × 2 × 1 = 120.
So, the number of ways is equal to 120.

Question 4: Find the number of ways 3 students can be selected from a class of 50 students.
Solution:

To find the number of ways 3 students can be selected from a class of 50 students, we can use the formula for Combination, since the order of the selected three students does not matter here.

Thus, the total number of ways = 50C3
So, this can be simplified as 50C3 = 50! / (3! × 47!) = (50 × 49 × 48 × 47!) / (3! × 47!) = 50 ×49 × 48 / 6 = 19,600

So, there are a total of 19,600 ways.

Question 5: Three different fruits are to be distributed among a group of 10 people. Find the total number of ways this can be possible.
Solution:

Since, in this case, the order of how the fruits are distributed matters, we need to implementPermutation.
So, the total number of ways is given as 10P3.

Simplifying, this can be written as,
10P3 = 10! / (10 - 3) ! = 10! / 7! = 10 × 9 × 8 × 7! / 7! = 10 × 9 × 8 = 720

Thus, there are a total of 720 ways possible.

Practice Problems on Factorial Formula

Question 1: Find the value of 7!.

Question 2: Determine the value of x if the factorial of x is 5040.

Question 3: How many ways can 6 distinct objects be arranged in a row?

Question 4: Calculate the number of ways 4 students can be selected from a class of 30 students.

Question 5: Find the number of permutations of the word "MATH".

Question 6: How many different ways can 3 identical red balls and 2 identical blue balls be arranged in a row?

Question 7: In how many ways can a committee of 4 members be chosen from a group of 12 people?

Question 8: A password consists of 3 distinct letters chosen from the alphabet. How many possible passwords can be formed?

Question 9: Calculate the number of ways to arrange the letters in the word "COMPUTER" such that the vowels always come together.

Question 10: How many ways can 5 people be seated in a row if two specific people must sit next to each other?


Factorial of a Number

Similar Reads