Permutation

Last Updated : 27 Apr, 2026

Permutation determines the number of possible arrangements for a specific set of elements. Therefore, it plays a big role in computer science, cryptography, and operations research.

Note: In Permutations, order matters; for example, (2, 1) and (1, 2) are counted as different.

For example, take a set {1, 2, 3}:

  • All Permutations taking all three objects are {1, 2, 3}, {1, 3, 2}, {2, 1, 3}, {2, 3, 1}, {3, 1, 2}, {3, 2, 1}.
  • All Permutations taking two objects at a time are, {1, 2}, {1, 3}, {2, 3}, {3, 2}, {3, 1}, {2, 1}.

Calculating permutations involves figuring out how many different ways you can arrange a set of items where the order matters.

Permutation Formula

The permutation formula is used to calculate the number of ways to arrange a subset of objects from a larger set where the order of selection matters.

The formula for Permutation is given as follows,

Permutation

Some of the most common representations or notations are as follows:

  • P(n, r)
  • nPr
  • nPr
  • P(n, k)

Derivation of Permutation Formula

To derive the formula for permutation, we can use the first principle of counting

If an event can occur in m different ways, and another event can occur in n different ways, then the total number of occurrences of the events is m × n.

By the definition of permutation and the principle of counting, we know

nPr = n × (n - 1)  . . .  (n - r + 1)

This product is exactly:

P(n, r) = n! / (n−r)!

Note that there are n ways to pick an item for the first position, (n - 1) ways to pick the second and so on

Multiplying and dividing by (n - r)! on the LHS, we get

nPr = n × (n - 1) × (n - 2) × . . . × (n - r + 1) × (n - r)! / (n - r)!

nPr = n × (n - 1) × (n - 2) × . . . × (n - r + 1) × (n - r) × (n - r - 1) × . . . × 1 / (n - r)!

nPr = n! / (n - r)! where  0 ≤ r ≤ n

Properties of Permutations

Some of the common properties of permutations are listed as follows:

  • nPn = n (n-1) (n-2) . . . 1 = n!
  • nP0 = n! / n! = 1
  • nP1 = n
  • nP(n - 1) = n!/1 = n!
  • nPr / nPr-1 = n - r + 1
  • nPr =n × n-1Pr-1 = n × (n-1) × n-2Pr-2 = n × (n-1) × (n-2) × n-3Pr-3 = and so on.
  • n-1Pr + r × n-1Pr-1 = nPr

Types of Permutation

In the study of permutation, there are some cases such as:

1. Permutation With Repetition

This is the simplest of the lot. In such problems, the objects can be repeated. Let's understand these problems with some examples.

Example: How many 3-digit numbers greater than 500 can be formed using 3, 4, 5, and 7?

Since a three-digit number greater than 500 will have either 5 or 7 at its hundredth place, we have 2 choices for this place.

There is no restriction on the repetition of the digits hence, for the remaining 2 digits; we have 4 choices for each

So the total permutations are,

2 × 4 × 4 = 32

2. Permutation Without Repetition

In this class of problems, the repetition of objects is not allowed. Let's understand these problems with some examples.

Example: How many 3-digit numbers divisible by 3 can be formed using the , digits 2, 4, 6, and 8 without repetition?

For a number to be divisible by 3, the sum of it digits must be divisible by 3

From the given set, various arrangements like 444 can be formed but since repetition isn't allowed we won't be considering them.

We are left with just 2 cases i.e. 2, 4, 6 and 4, 6, 8

Number of arrangements are 3! in each case

Hence the total number of permutations are: 3! + 3! = 12

3. Permutation of Multi-Sets

A permutation of a multiset is used when the objects are not distinct

Example: Find the number of arrangements of the word BALLOON.

  • Total letters = 7
  • Repeated letters: L (2 times), O (2 times)

Number of distinct permutations: \frac{7!}{2! \cdot 2!}

Relation Between nPr and nCr

We can understand nCr through the following analogy. Consider that we have n distinct boxes and r identical balls. (n > r)

The task is to place all the r balls into boxes such that no box contains more than 1 ball.

As all r objects are the same, the r! Ways of arranging them can be considered as a single way.

To group all r! ways of arranging, we divide nPr by r!

nCr = nPr/r! = n!/{(n - r)! × r!}

Hence, the relation between nPr and nCr is,

nCr = nPr/r!

Permutation vs Combination

The key differences between permutation and combination, some of those differences are listed as follows:

Permutations

Combinations

Arrangements of elements in a specific order.Selections of elements without considering the order.
nPr = n!​/(n−r)!nCr = n!​/[(n−r)! × r!]
nPr  OR P(n, r)nCr  OR C(n, r)
Yes, order matters.No, the order doesn't matter.
Arranging books on a shelf.Selecting members for a committee.
How many ways to arrange 3 books out of 5?How many ways to choose 2 fruits from a basket of 7?
Permutations are used when order matters, 
such as when arranging items in a sequence or forming a code.
Combinations are used when order doesn't matter, 
like selecting a group of people or choosing items without caring about their order.

Solved Problems

Problem 1. Find 6P3

Solution

As per the formula,

nPr = n! / (n - r)!
6P3 = 6! / (6−3)!
= 6 × 5 × 4 = 120

Problem 2. Find n if nP2 = 12

Solution

nPr = n! / (n - r)!

nP2 = n! / (n - 2)!
nP2 = n × (n - 1) × (n - 2)! / (n - 2)!
nP2 = n × (n - 1)
nP2 = n2 - n
∴ n2 - n = 12

Solving the equation,

n2 - n - 12 = 0
⇒ n (n - 4) + 3 (n - 4) = 0
⇒ (n + 3) (n - 4) = 0
∴ n = -3 or n = 4
∵ n ≥ 0

Thus, n = 4

Problem 3. How many 4-letter words, with or without meaning? Can be formed out of the letters of the word, 'SATURDAY' if repetition of letters is not allowed?

Solution:

Word SATURDAY has 8 letters i.e. S, A, T, U, R, D, A, and Y

To form 4-letter words, we first have to select 4 letters from these 8 letters

The ways of selecting 4 letters from 8 letters disregarding the order is 8C4 .

After selection, there are 4! arrangements.

Hence, total number of words formed are: 8C4 × 4!

Note: Selecting r objects out of n objects and then arranging them is same as r-permutation of n objects.

Problem 4. Find the number of ways of selecting 6 balls from 4 red, 6 blue, and 5 white given that the selection must have 2 balls of each color.

Solution:

We need to select 2 balls each of color red, blue and white as per the given condition.

Number of ways of selecting 2 red balls is 4C2

Number of ways of selecting 2 blue balls is 6C2

Number of ways of selecting 2 white balls is 5C2

Hence, the total ways of selection are 4C2 × 6C2 × 5C2  = 900

Problem 5. A class has just 3 seats vacant. Three people, P, A, and R, arrive at the same time. In how many ways can P, A, and R be arranged on those 3 vacant seats?

Solution:

For the very first seat, we have 3 choices i.e. P, A and R.

Let us randomly select A for the first seat.

For the second seat, we have 2 choices i.e. P and R

Let us randomly select R for the second seat.

For the third seat, we have 1 choice i.e. P

To summarize, we did the following:

Placed a person on seat 1 and placed a person on seat 2 and placed a person on seat 3.

Usage of and comes from the fact that occupation of all 3 seats was mandatory.

In mathematics, and is related with multiplication, hence we can say that total choices = 3 × 2 × 1 = 3!

If we change the seating order to P on the first seat, A on the second seat, and R on the third, does that change the total number of choices?

No, it does not. This is because equal importance is given to all three P, A, and R.

Problem 6. Find the number of ways of arranging 5 people if 2 of them always sit together.

Solution:

Let us consider the 2 people as a unit and the remaining 3 person as 3 separate units, So we have total 4 units.

Number of ways of arranging these 4 units is 4!

(just the way we proved in previous problem)

Number of ways of arranging the 2 person amongst themselves is 2!

In conclusion, the number of ways of arranging the 4 units and 2 person amongst themselves is 4! × 2!

Problem 7. 10 Olympians are running a race. Find the different arrangements of 1st, 2nd, and 3rd place possible?

Solution:

We have to find different arrangements of 10 taken 3 at time.
Here,

  • n = 10
  • r = 3

Different arrangement of for 1, 2, and 3 places are

10P3 = 10! / (7!)
= 10 × 9 × 8 = 720

Problem 8. Find all the three-letter words beginning and ending with a vowel. Given that repetition of alphabets is not allowed.

Solution:

Total vowels = 5 (a, e, i, o, u)

First letter (vowel) = 5 choices
Third letter (vowel, no repetition) = 4 choices
Middle letter (any remaining letter) = 26 − 2 = 24 choices

Total words = 5 × 4 × 24 = 480

Problem 9. An ice-cream shop has 10 flavors of ice cream. Find the number of ways to arrange 3 different flavors in layers on an ice cream cone.

Solution:

Let us consider n = 10 (total number of flavors) and r = 3 (number of different flavors needed)

For first flavor we have 10 choices

For second flavor we have 10 - 1 choices

For third flavor we have 10 - 2 choices and this is same as (n - r + 1)

The numbers of arrangement would be: 10 × (10 - 1) × (10 - 3 + 1) = 720

From this we can generalize that, the number of ways of arranging r objects out of n different objects is:

n × (n - 1)  . . . (n - r + 1) = nPr

Problem 10. How many even numbers lying between 1000 and 2000 can be formed using the digits 1, 2, 4, 5, and 9?

Solution:

Since the number is supposed to be even, the digits at units place must either be 2 or 4 leaving us with 2 choices for the digit at units place.

The number is supposed to lie between 1000 and 2000, So the digits at thousand's place must be 1, we thus have 

1 choice for the digit at thousands place.

Rest of the 2 digits can be any one from 1, 2, 4, 5 and 9 i.e. 5 choices each

So the total permutations are: 2 × 5 × 5 × 1 = 50

Problem 11. How many 4-digit numbers divisible by 5 can be formed using 0, 3, 5, 7, and 9 if repetition of digits is not allowed?

Solution:

For the number to be divisible by 5, the digit at units place must either be 0 or 5, hence we have 2 possibilities.

Case 1. Digit at units place is 0

  • There are 4 choices for 103 place (all numbers except 0)
  • There are 3 choices for the 102 place (1 got used up at 103 place)
  • There are 2 choices for the 101 place (1 got used up at 103 place and 1 at 102 place)

Hence the possible arrangements with 0 at units place are

4 × 3 × 2 = 24

Case 2. Digit at units place is 5

  • There are 3 choices for 103 place (all except 0 and 5)
  • There are 3 choices for 102 place (1 got used up at 103 place but we can use 0 now)
  • There is 2 choice for 101 place (1 got used up at 103 place and 1 at 102 place)

Hence the possible arrangements with 5 at units place are 3 × 3 × 2 = 18
Total Arrangements = Number of arrangements in case 1 + Number of arrangements in case 2
Total Arrangements = 24 + 18 = 42

Practice Problems

Question 1. In how many ways can 6 prisoners be placed in 4 cells if any number of prisoners can fit in a cell?

Question 2. Find how many 4-digit numbers divisible by 8 can be formed using 0, 1, 2, 3, 5, 7, and 9 if repetition of digits is not allowed.

Question 3. Find the number of ways of selecting 8 balls from 10 red, 16 blue, and 15 white given that the selection must have 1 ball of each color.

Question 4. Find how many even numbers lying between 4000 and 8000 can be formed using the digits 1, 2, 3, 4, 5, and 6 when repetition is allowed.

Comment

Explore