Permutations and Combinations for JEE: Arrangements, Selections, Circular Seating and Derangements
Permutations and combinations is the chapter of counting without listing. Every question asks the same thing, "in how many ways", and every answer is built from two rules: multiply when the work is done in stages one after another, add when the work splits into separate cases. Arrangements, selections, circular seatings, distributions and derangements are these two rules applied with care about what is distinct, what is identical and what is being ordered.
This note covers the fundamental principles, factorials and the exponent of a prime in , permutations of distinct objects with and without repetition, permutations with identical objects, the together and gap methods, the rank of a word, circular permutations and necklaces, combinations and the properties of , selections from identical objects and the number of divisors, integer solutions of equations, division into groups and distribution of distinct and identical objects, inclusion and exclusion, derangements, geometrical counting and the sum of numbers formed with given digits. Each section ends with worked examples from JEE Main, JEE Advanced and IIT JEE papers, graded from easy to hard. Circular seatings, derangements and groupings each get a full run of examples. Counting functions (one-one and onto maps) is done in the Functions note, and sums of binomial coefficients in the Binomial Theorem note.
Fundamental principles of counting
Multiplication principle
If a work is done in two stages, the first in ways and, for each of these, the second in ways, then the whole work is done in
The rule extends to any number of stages. The word to look for is and: first stage and second stage and so on.
A tree diagram with three branches A1, A2, A3 at stage 1, each splitting into two branches B1, B2 at stage 2, giving six end points
Addition principle
If a work can be done in either of two separate ways, the first in ways and the second in ways, with no way common to both, then it can be done in
The word to look for is or: case I or case II. The cases must not overlap.
Counting with repetition allowed
Filling places when each place can take any of objects gives ways. A number of digits from a set containing needs one extra check: the first digit cannot be .
| Situation | Count |
|---|---|
| places, choices each, repetition allowed | |
| letters into letter boxes | |
| -digit numbers from | |
| persons leaving a lift at floors |
letters into boxes is , not : each letter chooses a box. Always ask which objects make the choice. The objects that choose are the exponent; the places they choose from are the base.
Examples
Example 1 (JEE Main 2026, 28 Jan Shift 2). Three persons enter a lift at the ground floor. The lift goes up to the floor. The number of ways in which the three persons can exit the lift at three different floors, if the lift does not stop at the first, second and third floors, is equal to ______.
▸ SHOW SOLUTION
Step 1. Floors available
The lift can stop at floors , that is floors.
Step 2. Persons choose distinct floors
The first person has choices, the second , the third :
Answer:
Example 2 (JEE Main 2026, 21 Jan Shift 1). Let . If the number of elements in such that is a multiple of is , and the number of such that is a square of a prime is , then is equal to ______.
▸ SHOW SOLUTION
Step 1. Remainders on division by
and , so
This is exactly when is odd, and is free.
Step 2. The count
odd gives values, gives :
Step 3. The count
, and the prime squares in this range are . For a sum there are pairs:
Answer:
Example 3 (JEE Main 2026, 24 Jan Shift 1). The number of numbers greater than , less than , and divisible by , that can be formed using the digits , if repetition of the digits is allowed, is ______.
▸ SHOW SOLUTION
Step 1. The first digit
A number between and has first digit or . Only is available, so the number is . ( itself is not divisible by .)
Step 2. Digits by remainder on division by
| Remainder | Digits | Count |
|---|---|---|
Step 3. The condition
, so we need . The remainder patterns of , each in orders, are:
| Pattern | Ways for one order | All orders |
|---|---|---|
Answer:
Example 4 (JEE Main 2025, 28 Jan Shift 1). The number of different -digit numbers greater than that can be formed using the digits , such that the sum of their first and last digits should not be more than , is
▸ SHOW SOLUTION
Step 1. First and last digits
The first digit is , or , and first last :
| First digit | Last digit | Pairs |
|---|---|---|
Step 2. The middle three digits
Each of them is free, choices:
Step 3. Remove
is counted (first , rest ) but it is not greater than :
Answer: option (4)
Factorials and the exponent of a prime
Factorial
For a natural number ,
and . The value keeps this rule true at . Splitting into its even and odd factors gives
Exponent of a prime in
For a prime , the highest power of that divides is
where is the greatest integer function. Reason: of the numbers are multiples of , each gives one factor ; of them are multiples of and give one more, and so on.
The number of zeros at the end of is , because appears more often than . For example .
For dividing you need and . The answer is the smaller of and . Taking only the largest prime of the base can give the wrong answer when a smaller prime has a high power in the base.
Examples
Example 5 (JEE Main 2026, 21 Jan Shift 2). The largest for which divides is
▸ SHOW SOLUTION
Step 1. The exponent of
, so only two terms are needed:
Answer: option (1)
Example 6 (JEE Main 2026, 24 Jan Shift 2). The largest value of , for which divides , is
▸ SHOW SOLUTION
Step 1. Prime factors of the base
Step 2. Exponents in
Step 3. Both conditions
gives , and . So .
Answer: option (4)
Permutations of distinct objects
Arrangements without repetition
A permutation is an arrangement in a definite order. The number of arrangements of objects chosen from distinct objects is
Reason: the first place has choices, the second , and the -th place . All objects in a row give .
Arrangements with repetition and with restrictions
| Situation | Count |
|---|---|
| of distinct objects in a row | |
| all in a row | |
| places, repetition allowed | |
| particular objects always included | |
| particular objects never included | |
| a particular object in a fixed place |
For numbers formed from digits, fill the restricted places first: the first digit (not ), the last digit (for even numbers or multiples of ), then the rest.
For a -digit even number from without repetition, split by the last digit. Last digit : . Last digit or : first digit has choices (not , not the last), then , giving . Total . Filling the first place first runs into a case split anyway; starting from the most restricted place keeps it short.
Examples
Example 7 (JEE Main 2026, 6 Apr Shift 1). The number of -letter words, with or without meaning, each consisting of two vowels and two consonants that can be formed from the letters of the word INCONSEQUENTIAL, without repeating any letter, is
▸ SHOW SOLUTION
Step 1. Distinct letters
Vowels : distinct. Consonants : distinct. "Without repeating any letter" means each chosen letter is used once.
Step 2. Choose and arrange
Answer: option (4)
Example 8 (JEE Advanced 2017, Paper 1). Words of length are formed using the letters . Let be the number of such words where no letter is repeated, and let be the number of such words where exactly one letter is repeated twice and no other letter is repeated. Then is ______.
▸ SHOW SOLUTION
Step 1. The count
All letters once each:
Step 2. The count
Choose the doubled letter ( ways) and more letters from the other ( ways). The letters with one pair are arranged in ways:
Step 3. The ratio
Answer:
Example 9 (JEE Advanced 2022, Paper 1). The number of -digit integers in the closed interval formed by using the digits is ______.
▸ SHOW SOLUTION
Step 1. Repetition is allowed
The digits may repeat. Count by the first digit, which must be , or .
Step 2. First digit
All numbers lie in the interval.
Step 3. First digit
There are numbers . Those below are , , , , , , : numbers. So .
Step 4. First digit
We need . Second digit : . Second digit : every third digit available is at most , so and all qualify. Second digit or is too large.
Step 5. Total
Answer:
Permutations with identical objects
Arrangements of all the objects
If among objects are alike of one kind, alike of a second kind and alike of a third kind, the rest distinct, the number of arrangements of all is
Reason: if the alike objects were made different, each arrangement would split into arrangements.
| Word | Repeats | Arrangements |
|---|---|---|
| BANANA | , | |
| MISSISSIPPI | , , | |
| ASSASSINATION | , , , |
Selecting and arranging some of the letters
When only of the letters are used, split into cases by the pattern of repeats. For -letter words the patterns are:
| Pattern | Meaning | Count |
|---|---|---|
| different | choose kinds | |
| alike, different | one pair kind, two single kinds | |
| alike, alike | two pair kinds | |
| alike, different | one triple kind, one single kind | |
| alike | one kind with copies | each |
In the pattern " alike, different" the two different letters must be chosen from the kinds other than the paired kind. Choosing them from all kinds counts words like in the wrong case. Count the available kinds for each part of the pattern separately.
Examples
Example 10 (JEE Main 2026, 23 Jan Shift 1). The number of -letter words, with or without meaning, which can be formed using the letters of PQRPQRSTUVP, is ______.
▸ SHOW SOLUTION
Step 1. The kinds
, , and once each. There are kinds; can give a pair, only can give a triple.
Step 2. The cases
| Pattern | Count |
|---|---|
| alike, different | |
| alike, alike | |
| alike, different | |
| different |
Answer:
Example 11 (JEE Main 2026, 28 Jan Shift 1). Let . Let be the number of -digit numbers formed using the digits of such that only one digit is repeated and it is repeated exactly twice. Let be the number of -digit numbers formed using the digits of such that only two digits are repeated and each is repeated exactly twice. Then
▸ SHOW SOLUTION
Step 1. The count
One digit twice and other digits once: choose the doubled digit () and of the remaining :
Step 2. The count
Two digits twice and digits once: for the pairs, for the singles:
Step 3. The ratio
Answer: option (3)
Example 12 (JEE Main 2023, 1 Feb Shift 2). The number of words, with or without meaning, that can be formed using all the letters of the word ASSASSINATION so that the vowels occur together, is ______.
▸ SHOW SOLUTION
Step 1. Vowels and consonants
Vowels: (). Consonants: ().
Step 2. The vowel block with the consonants
The block and consonants are units, with and :
Step 3. Inside the block
Answer:
Example 13 (JEE Main 2025, 29 Jan Shift 1). The number of -letter words, with or without meaning, that can be formed using the letters of the word MATHS such that any letter that appears in the word must appear at least twice, is ______.
▸ SHOW SOLUTION
Step 1. Patterns of with parts at least
, , , .
Step 2. Count each pattern
| Pattern | Kinds | Arrangements | Count |
|---|---|---|---|
In the two letters have different roles, so the order of choosing matters; in and it does not.
Answer:
Objects together and the gap method
Objects always together
To keep particular objects together, tie them into one block. Arrange the block with the other objects, then arrange the objects inside the block:
"Not all together" is the complement: .
No two together: the gap method
To keep particular objects apart (no two side by side), first arrange the other objects. They leave gaps, counting the two ends. Put the objects into different gaps:
Five objects B1 to B5 in a row with dotted lines marking the six gaps, two at the ends and four between, and a cross under each gap
| Condition | Count for boys and girls in a row |
|---|---|
| all girls together | |
| girls not all together | |
| no two girls together () | |
| boys and girls alternate, | |
| boys and girls alternate, |
"The girls are not all together" allows two girls side by side; only the arrangement with all of them in one block is removed. "No two girls together" is far stronger and needs the gap method. For boys and girls the two counts are and .
Examples
Example 14 (JEE Main 2026, 4 Apr Shift 1). The number of ways of forming a queue of boys and girls such that all the girls are not together, is
▸ SHOW SOLUTION
Step 1. All arrangements
Step 2. All three girls together
One block of girls with boys is units:
Answer: option (4)
Example 15 (JEE Main 2025, 22 Jan Shift 2). In a group of girls and boys, there are two boys and . The number of ways, in which these girls and boys can stand in a queue such that all the girls stand together, all the boys stand together, but and are not adjacent to each other, is
▸ SHOW SOLUTION
Step 1. The two blocks
The girls' block and the boys' block can be placed in orders, and the girls arranged in ways.
Step 2. Inside the boys' block
orders, of which have adjacent:
Step 3. Total
Answer: option (1)
Example 16 (JEE Main 2025, 23 Jan Shift 2). The number of ways, boys and girls can sit in a row so that either all the boys sit together or no two boys sit together, is ______.
▸ SHOW SOLUTION
Step 1. All boys together
Block of boys with girls is units:
Step 2. No two boys together
Arrange the girls (); they leave gaps for boys ():
Step 3. The cases do not overlap
Answer:
Example 17 (JEE Advanced 2015, Paper 1). Let be the number of ways in which boys and girls can stand in a queue in such a way that all the girls stand consecutively in the queue. Let be the number of ways in which boys and girls can stand in a queue in such a way that exactly four girls stand consecutively in the queue. Then the value of is ______.
▸ SHOW SOLUTION
Step 1. The count
Step 2. The count
Choose the girls of the block and order them: . Arrange the boys: . The block and the fifth girl go into different gaps of the gaps (if they shared a gap, all five girls would be together):
Step 3. The ratio
Answer:
Example 18 (IITianForum). Six different consonants and three different vowels are arranged in a row of nine letters. In how many arrangements are there at least two consonants between any two vowels?
▸ SHOW SOLUTION
Step 1. Consonants first
Arrange the consonants: ways. They leave gaps, numbered .
Step 2. Choose the gaps
At least two consonants between two vowels means the chosen gap numbers differ by at least . Choosing of gaps with no two consecutive gives
(Reason: if the gaps are , then are any distinct numbers from to .)
Step 3. Order the vowels
Answer:
Rank of a word in the dictionary
Method
Write the letters in alphabetical order. Go through the word one position at a time. At each position, count the words that agree with the given word so far but have a smaller letter in this position: (number of smaller unused letters) (arrangements of the rest). Add all these counts; the rank is that total plus .
With repeated letters, the arrangements of the rest are , and each kind of smaller letter is counted once.
For the reverse question (which word is at position ), fill one place at a time. Each starting letter covers a block of words; keep adding blocks until the next one would pass , then go to the next place.
Examples
Example 19 (JEE Main 2026, 24 Jan Shift 2). The letters of the word UDAYPUR are written in all possible ways with or without meaning and these words are arranged as in a dictionary. The rank of the word UDAYPUR is
▸ SHOW SOLUTION
Step 1. Alphabetical order
.
Step 2. Position by position
| Fixed part | Smaller letters | Words |
|---|---|---|
| none | ||
| none | ||
| none | ||
Step 3. The rank
Answer: option (1)
Example 20 (JEE Main 2025, 29 Jan Shift 2). If all the words with or without meaning made using all the letters of the word KANPUR are arranged as in a dictionary, then the word at position in this arrangement, is
▸ SHOW SOLUTION
Step 1. First letter
Order . Words starting with , , take places, so the word starts with .
Step 2. Second letter
, , take more, up to . The word starts .
Step 3. Third letter
takes places ( to ). starts at : is and is .
Answer: option (3)
Circular permutations
Round table
In a circular arrangement only the relative order matters: turning everyone one seat round gives the same arrangement. Fix one person; the other fill the remaining seats in a row:
Six persons round a table with A shaded as the fixed person, and two four-bead necklaces abcd and adcb that are mirror images joined by a two-way arrow marked flip
Necklace and garland
A necklace or garland can be turned over, so an arrangement and its mirror image are the same. For distinct beads each arrangement is counted twice in :
For or the mirror image is the same arrangement, so the count is .
Results table
| Situation | Count |
|---|---|
| distinct persons, round table | |
| distinct beads, necklace () | |
| of persons, round table | |
| of beads, necklace () | |
| two particular persons together | |
| two particular persons never together | |
| men, women alternately | |
| men, women, no two women together () | |
| couples, each pair together | |
| seats numbered (or chairs distinct) |
Divide by only when turning the circle gives the same arrangement. If the seats are numbered, or one seat is special (a head of the table, a window), every rotation is a new arrangement and the count is . Divide by only for objects that can be turned over (necklace, garland, beads on a ring), never for persons at a table.
Identical beads on a ring
If some beads are alike, divided by the repeats is wrong in general. When one bead is unique, fix it at the top. The others form a row read clockwise from it. For a necklace, a row and its reverse give the same necklace, except a row that reads the same both ways:
Examples
Example 21 (IITianForum). The letters of the word EQUATION are written round a circle. In how many of these circular arrangements are the letters and not next to each other?
▸ SHOW SOLUTION
Step 1. All circular arrangements
The letters are all different:
Step 2. and next to each other
Tie into one unit: units round the circle in ways, and orders inside the unit:
Answer:
Example 22 (IITianForum). In how many ways can a garland be made from flowers of different colours?
▸ SHOW SOLUTION
Step 1. Circular arrangements
Step 2. A garland can be turned over
Each garland is counted twice:
Answer:
Example 23 (IITianForum). In how many ways can men and women be seated at a round table so that men and women sit alternately?
▸ SHOW SOLUTION
Step 1. Seat the men
Round table: ways. Fixing removes the turning of the table.
Left: ten seats round a table with men M1 to M5 alternating with women W and M1 shaded. Right: the five men seated with the five seats between them marked by crosses
Step 2. Seat the women
The seats between the men are now all different (each has its own pair of neighbours), so the women fill them in ways:
Answer:
Example 24 (JEE Main 2023, 8 Apr Shift 1). The number of ways, in which girls and boys can be seated at a round table so that no two girls sit together, is
▸ SHOW SOLUTION
Step 1. Seat the boys
Step 2. Girls in the gaps
The boys leave gaps; the girls take of them in order:
Step 3. Match with the options
Answer: option (4)
Example 25 (IITianForum). A host invites guests chosen from his friends, two of whom refuse to attend together. The host and the guests then take seats at a round table. In how many ways can the guests be chosen and the six persons be seated?
▸ SHOW SOLUTION
Step 1. Choose the guests
All choices minus those with both of the two friends (then more from the other ):
Step 2. Seat six persons round the table
Step 3. Stages multiply
Answer:
Example 26 (IITianForum). Three brothers, two sisters and three other persons are to be seated at a round table. In how many ways can this be done if the two sisters are together but no two brothers are next to each other?
▸ SHOW SOLUTION
Step 1. Seat everyone except the brothers
Tie the sisters into one unit. The unit and the other persons are units round the table, and the sisters can change places:
Step 2. Brothers in the gaps
The units leave gaps round the table. The brothers take different gaps in order:
Step 3. Total
Answer:
Example 27 (IITianForum). How many different garlands can be made using identical red flowers, identical blue flowers and white flower?
▸ SHOW SOLUTION
Step 1. Fix the white flower
The white flower is unique; put it at the top. Read the other flowers clockwise as a row of :
Step 2. Turning the garland over
Turning over keeps at the top and reverses the row. A row equal to its reverse must have in the middle, and the first two places hold one and one : and . These are their own mirror images; the other rows pair up into garlands.
Six garlands of six flowers, each with the white flower W at the top and three red R and two blue B flowers in a different pattern
Step 3. Count
Answer:
Example 28 (JEE Advanced 2019, Paper 2). Five persons and are seated in a circular arrangement. If each of them is given a hat of one of the three colours red, blue and green, then the number of ways of distributing the hats such that the persons seated in adjacent seats get different coloured hats is ______.
▸ SHOW SOLUTION
Step 1. Which colour patterns are possible
The persons are fixed, so no division by . Two colours alone cannot alternate round an odd circle of . A colour can be used at most twice (three hats of one colour on seats in a circle put two of them side by side). So the colours are used times.
Step 2. Place the single colour
Choose the colour used once ( ways) and the person who gets it ( ways).
Step 3. The other four
The remaining persons form a row round the circle from one neighbour to the other, and the two remaining colours must alternate along it: ways.
Answer:
Combinations
Selection without order
A combination is a selection in which order does not matter. The number of ways of selecting objects from distinct objects is
Reason: each selection of objects can be arranged in ways, so .
| Situation | Count |
|---|---|
| of distinct objects | |
| particular objects always included | |
| particular objects never included | |
| any number, including none | |
| at least one | |
| from two groups, from and from |
At least and at most
"At least of a type" is done in one of two ways: add the cases one by one, or subtract the cases below from the total. Use whichever has fewer cases.
For "at least one woman in a committee of from men and women", the count is wrong: a committee with two women is counted twice, once for each woman picked first. The right count is .
Selection that fixes an order
If the chosen objects must then be put in a forced order (increasing digits, alphabetical order, decreasing values), each selection gives exactly one arrangement. So the count is a combination, not a permutation.
Examples
Example 29 (JEE Main 2025, 22 Jan Shift 1). From all the English alphabets, five letters are chosen and are arranged in alphabetical order. The total number of ways in which the middle letter is 'M' is
▸ SHOW SOLUTION
Step 1. The order is forced
After choosing letters, alphabetical order gives one arrangement. So only the choice matters.
Step 2. Two letters on each side of M
to are letters, to are :
Answer: option (4)
Example 30 (JEE Main 2025, 24 Jan Shift 2). Group A consists of boys and girls, while group B consists of boys and girls. The number of ways in which boys and girls can be invited for a picnic if of them must be from group A and the remaining from group B, is equal to
▸ SHOW SOLUTION
Step 1. Split by the girls from A
Group A gives persons and has only girls. If A gives girls and boys, then B gives girls and boys, so .
Step 2. Count each case
| Girls from A | A | B | Ways |
|---|---|---|---|
The total is .
Answer: option (3)
Example 31 (JEE Main 2025, 7 Apr Shift 1). From a group of batsmen and bowlers, players are to be chosen for a team, which should include at least batsmen and at least bowlers. One batsman and one bowler who are captain and vice-captain respectively of the team should be included. Then the total number of ways such a selection can be made, is
▸ SHOW SOLUTION
Step 1. Two players are already in
Choose more from batsmen and bowlers.
Step 2. The team splits
The team of is , or batsmen and bowlers:
Answer: option (2)
Example 32 (JEE Main 2026, 5 Apr Shift 2). A box contains blue, yellow and red balls. The number of ways of drawing balls containing at least two balls of each colour, is
▸ SHOW SOLUTION
Step 1. Colour counts
With and each at least , the extra balls give as
Step 2. Balls of one colour are different
The options are large, so the balls are taken as different:
The total is .
Step 3. Alike or different
If balls of one colour were alike, a draw would be fixed by alone and the answer would be . Only the reading with different balls matches an option.
Answer: option (1)
Example 33 (JEE Main 2026, 5 Apr Shift 1). Two players and play a series of games of badminton. The player who wins games first wins the series. Assuming no game ends in a draw, the number of ways in which player wins the series is ______.
▸ SHOW SOLUTION
Step 1. The last game
wins the last game played. Before it, has won games and has won games, .
Step 2. Count each case
The wins of among the first games: ways.
Answer:
Example 34 (JEE Main 2026, 23 Jan Shift 2). Let denote the set of -digit numbers such that , and denote the set of -digit numbers having product of its digits equal to . Then is equal to ______.
▸ SHOW SOLUTION
Step 1. The set
Any distinct digits from to can be written in decreasing order in exactly one way, and the first digit is then not :
Step 2. The set
, and no digit is . The digits are or :
Answer:
Example 35 (JEE Advanced 2020, Paper 2). An engineer is required to visit a factory for exactly four days during the first days of every month and it is mandatory that no two visits take place on consecutive days. Then the number of all possible ways in which such visits to the factory can be made by the engineer during to June is ______.
▸ SHOW SOLUTION
Step 1. Days not visited first
The days without a visit are in a row and leave gaps (between them and at the ends).
Top row: days 1 to 15 with days 2, 5, 9 and 13 shaded. Bottom row: the eleven free days as boxes with the four chosen days placed in four of the twelve gaps
Step 2. Visits go into different gaps
Each visit day takes its own gap, so no two visits are next to each other:
Answer:
Example 36 (JEE Advanced 2022, Paper 2). Consider boxes, where each box contains red balls and blue balls. Assume that all balls are distinct. In how many different ways can balls be chosen from these boxes so that from each box at least one red ball and one blue ball are chosen?
▸ SHOW SOLUTION
Step 1. Choices from one box
With at least one red and one blue:
| Balls from the box | Ways |
|---|---|
Step 2. Sizes from the four boxes
Each box gives at least , so the extra balls give sizes in orders or in orders.
Step 3. Total
Answer: option (A)
Properties of combinations
Standard results
| Result | Reason |
|---|---|
| choosing to take is choosing to leave | |
| or | from the result above |
| split by whether one new object is chosen | |
| choose a team, then its captain | |
| from the factorial form | |
| largest at ( even) | the ratio above is up to the middle |
| largest at ( odd) | two equal middle terms |
| adding or removing one fixed object swaps even and odd selections |
The addition rule builds Pascal's triangle: each entry is the sum of the two above it.
Pascal's triangle from row 0 to row 6 with the two entries 10 and 10 of row 5 shaded and arrows to their sum 20 in row 6
Two useful sums
Reason: choose persons from boys and girls; split by the number of boys.
Reason: choose numbers from and split by the largest one chosen.
Examples
Example 37 (JEE Main 2026, 2 Apr Shift 1). The number of elements in the set is
▸ SHOW SOLUTION
Step 1. Reduce
Step 2. The equation
Cancel :
Step 3. The range of
gives , so or :
| pairs | ||
|---|---|---|
Answer: option (2)
Example 38 (JEE Main 2026, 2 Apr Shift 2). If for , , then equals
▸ SHOW SOLUTION
Step 1. Write
The left side is .
Step 2. Pascal's rule three times
Add neighbours in pairs:
Step 3. Compare
, and . So .
Answer: option (C)
Selections from identical objects and divisors
Identical objects
From alike objects you can take of them: ways. So from alike of one kind, alike of a second and alike of a third, with other distinct objects:
This includes the empty selection; subtract for "at least one".
Number and sum of divisors
Write with distinct primes. A divisor takes each prime to times, so
Reason for the sum: expanding gives every divisor exactly once.
| For | Count |
|---|---|
| all divisors | |
| odd divisors | |
| even divisors | |
| divisors that are multiples of | |
| proper divisors (not , not ) | |
| as a product of two factors (unordered) | , or if is a square |
| as a product of two coprime factors (unordered) |
An even divisor must take the prime at least once, so the power of has choices, not . For , all divisors are and even divisors are .
Examples
Example 39 (JEE Main 2019, 12 Jan Shift 1). The number of ways of choosing objects out of objects of which are identical and the remaining are distinct is
▸ SHOW SOLUTION
Step 1. Split by the distinct objects taken
If distinct objects are taken, the other are identical ones, in one way:
Step 2. Half of the full sum
, so the terms to are exactly half of :
Answer: option (2)
Example 40 (JEE Main 2021, 26 Feb Shift 2). A natural number has prime factorization given by where and are such that and , . Then the number of odd divisors of , including , is
▸ SHOW SOLUTION
Step 1. Find and
, so and . With , , .
Step 2. Odd divisors
An odd divisor takes no factor :
Options (1) and (4) are both as printed in the paper; the answer is option (2).
Answer: option (2)
Example 41 (IITianForum). Let . If is the number of even divisors of and is the sum of all the odd divisors of , find .
▸ SHOW SOLUTION
Step 1. Prime factors
Step 2. Even divisors
Step 3. Sum of odd divisors
Answer:
Integer solutions and identical objects into boxes
Non-negative and positive solutions
The number of non-negative integer solutions of is
Reason: write dots and bars in a row. The dots before the first bar give , those between the first and second bar give , and so on. Every row of symbols with bars is one solution.
Seven dots and three bars in a row: two dots, a bar, three dots, two bars together, two dots, read as x1 equals 2, x2 equals 3, x3 equals 0, x4 equals 2
The same number counts the ways of giving identical objects to distinct persons.
| Condition | Number of solutions of |
|---|---|
| put , then | |
| subtract the solutions with some (Example 47) | |
| subtract the smallest case, then count partitions | |
| one term or | fix that variable and add the cases |
The number of solutions with is the coefficient of in , because each bracket picks the value of one . For small numbers, multiplying out or listing patterns is often quicker than inclusion and exclusion.
is for identical objects into distinct boxes. Distinct objects into distinct boxes is . Before using a formula, settle both: are the objects alike, are the boxes alike.
Examples
Example 42 (JEE Main 2026, 23 Jan Shift 2). The number of ways in which oranges can be distributed to four children such that each child gets at least one orange, is
▸ SHOW SOLUTION
Step 1. Positive solutions
with each :
Answer: option (4)
Example 43 (JEE Main 2026, 4 Apr Shift 2). Let . Then is equal to
▸ SHOW SOLUTION
Step 1. Fix
has non-negative solutions, and .
Step 2. Add
Answer: option (3)
Example 44 (JEE Main 2025, 29 Jan Shift 1). Let be the set of seven-digit numbers with the sum of their digits equal to . If the numbers in are formed by using the digits and only, then the number of elements in the set is
▸ SHOW SOLUTION
Step 1. The extra over
Write each digit as with . Then .
Step 2. Patterns of the extras
| Extras | Digits | Arrangements |
|---|---|---|
| five , two | ||
| four , two , one | ||
| three , four |
The total is .
Answer: option (4)
Example 45 (JEE Main 2025, 28 Jan Shift 2). The number of natural numbers, between and , such that the sum of their digits is , is ______.
▸ SHOW SOLUTION
Step 1. Two digits with a given sum
For with digits to : pairs if , and pairs if .
Step 2. By the first digit
| pairs | ||
|---|---|---|
For the numbers run from to , all above .
Answer:
Example 46 (JEE Main 2022, 28 June Shift 2). The number of ways to distribute identical candies among four children so that receives at least and at most candies, receives at least and at most candies, is
▸ SHOW SOLUTION
Step 1. Fix and
If gets and gets , then and share in ways.
Step 2. Add over to
For a fixed , the five values of add to :
Step 3. Add over to
Answer: option (4)
Example 47 (JEE Advanced 2026, Paper 1). The number of ways to distribute identical red pens and identical blue pens among four persons such that each person gets pens, is ______.
▸ SHOW SOLUTION
Step 1. Red pens decide everything
If person gets red pens, the other are blue. So count with ; the blue total is then automatically.
Step 2. Without the upper limit
Step 3. Remove
If , put : has solutions. Any of the persons can be the one, and two persons cannot both have :
Answer:
Example 48 (JEE Advanced 2014, Paper 1). Let be positive integers such that . The number of such distinct arrangements is ______.
▸ SHOW SOLUTION
Step 1. Remove the smallest case
The least possible values are , with sum . Put ; then and .
Step 2. Write as a sum of at most parts
The non-zero in decreasing order form a partition of :
Answer:
Division into groups and distribution of distinct objects
Groups of unequal sizes
The number of ways of dividing distinct objects into three groups of sizes , , (all different) is
Reason: choose the group of , then the group of from the rest: .
Groups of equal sizes
If two or more groups have the same size, the groups have no names, so interchanging them gives the same division. Divide by for every set of equal-size groups:
Six objects a to f grouped in pairs ab, cd, ef, and the same pairs listed in the order cd, ef, ab, with an equals sign between the two pictures
Distributing the groups
If the groups go to distinct persons, first form the groups, then give them out: multiply by the number of ways of handing the groups to the persons. For objects to persons, each:
The four cases of distribution
| Objects | Boxes | Count of ways for objects, boxes |
|---|---|---|
| distinct | distinct | ; no box empty: |
| identical | distinct | ; no box empty: |
| distinct | identical | add the group divisions over all size patterns |
| identical | identical | number of ways of writing as a sum of at most parts |
books into groups of , , is with no extra division, because the sizes already tell the groups apart. Groups of , , need a division by , and groups of by . When the groups are then given to persons, multiply by the number of ways of handing them out, not always by .
Examples
Example 49 (IITianForum). In how many ways can different books be distributed among students so that two of the students get books each and the other two get books each?
▸ SHOW SOLUTION
Step 1. Form the groups
Sizes : two pairs of equal groups.
Step 2. Give the groups to the students
The groups go to students in ways:
Answer:
Example 50 (JEE Main 2026, 6 Apr Shift 2). A building has a ground floor and more floors. Nine persons enter a lift at the ground floor. The lift goes up to the floor. The number of ways in which any persons exit at a floor and the remaining persons exit at a different floor, if the lift does not stop at the first and the second floors, is equal to
▸ SHOW SOLUTION
Step 1. Groups of and
Step 2. Floors for the two groups
Floors to give choices; the group of takes one floor and the group of another: .
Answer: option (3)
Example 51 (JEE Main 2023, 10 Apr Shift 2). Eight persons are to be transported from city to city in three cars of different makes. If each car can accommodate at most three persons, then the number of ways in which they can be transported is
▸ SHOW SOLUTION
Step 1. The only size pattern
persons with at most in a car: .
Step 2. Count
Choose the car that takes ( ways); the cars are different, so the groups are named by their cars:
Answer: option (3)
Example 52 (IIT JEE 2012, Paper 1). The total number of ways in which balls of different colours can be distributed among persons so that each person gets at least one ball is
▸ SHOW SOLUTION
Step 1. Size patterns
or .
Step 2. Groups, then persons
Step 3. Check by the formula
Answer: option (B)
Example 53 (JEE Main 2024, 29 Jan Shift 2). Number of ways of arranging identical books into identical shelves where any number of shelves may remain empty is equal to
▸ SHOW SOLUTION
Step 1. Only the sizes matter
Books and shelves are both identical, so a way is a sum of at most parts equal to .
Step 2. List by the number of parts
| Parts | Sums | Count |
|---|---|---|
The total is .
Answer: option (1)
Example 54 (JEE Main 2024, 1 Feb Shift 2). If is the number of ways five different employees can sit into four indistinguishable offices where any office may have any number of persons including zero, then is equal to
▸ SHOW SOLUTION
Step 1. Offices are alike
Only the groups formed matter, with at most non-empty groups.
Step 2. Count by size pattern
| Sizes | Divisions |
|---|---|
The total is .
Answer: option (3)
Example 55 (JEE Advanced 2020, Paper 2). In a hotel, four rooms are available. Six persons are to be accommodated in these four rooms in such a way that each of these rooms contains at least one person and at most two persons. Then the number of all possible ways in which this can be done is ______.
▸ SHOW SOLUTION
Step 1. Size pattern
persons in rooms, each or : sizes .
Step 2. Rooms with two persons
Choose them: .
Step 3. Fill the named rooms
Answer:
Example 56 (JEE Advanced 2024, Paper 1). A group of students, , is to be divided to form three teams , and of sizes , and , respectively. Suppose that cannot be selected for the team , and cannot be selected for the team . Then the number of ways to form such teams is ______.
▸ SHOW SOLUTION
Step 1. All divisions
Step 2. The unwanted cases
in : . in : . Both: .
Step 3. Inclusion and exclusion
Answer:
Inclusion and exclusion
Two and three conditions
For sets , , of arrangements,
and for three sets
where is the sum over single sets, the sum over pairs and .
To count arrangements with none of the bad properties, subtract from the total.
Every kind used at least once
The number of words of length from given letters in which every letter appears at least once (each of places chooses a letter, and no letter is left out) is
For small numbers, listing the patterns of repeats is just as quick.
"At least one of the digits and appears exactly twice" is a union of two sets: exactly twice, exactly twice. Count each, then subtract the overlap. Mixing "at least" and "exactly" in one step is the usual source of a wrong total.
Examples
Example 57 (JEE Main 2026, 2 Apr Shift 1). The number of seven-digit numbers that can be formed by using the digits and such that each digit is used at least once, is
▸ SHOW SOLUTION
Step 1. Patterns of repeats
places, digits each at least once: the extra places give or .
Step 2. Count each pattern
Step 3. Check by inclusion and exclusion
Answer: option (3)
Example 58 (JEE Advanced 2025, Paper 1). Let be the set of all seven-digit numbers that can be formed using the digits , and . For example, is in , but is NOT in . Then the number of elements in such that at least one of the digits and appears exactly twice in , is equal to ______.
▸ SHOW SOLUTION
Step 1. Zero exactly twice ()
The first digit is not . Place the two zeros in the last places, the other places take or :
Step 2. One exactly twice ()
First digit : the other in places, the rest or : . First digit : two s in ways, the rest or : .
Step 3. Both ()
Digits , first digit not :
Step 4. The union
Answer:
Derangements
Definition and formula
A derangement of objects is an arrangement in which no object is in its own place, for example no letter in its own envelope. The number of derangements is
Reason: by inclusion and exclusion, the arrangements with a chosen set of objects in their own places number , and there are such sets. So , which is the formula above.
Two pictures of four letters L1 to L4 sent to four envelopes E1 to E4 with no letter going to its own envelope: the first swaps two pairs, the second sends each letter to the next envelope and L4 to E1
The values satisfy . Reason: object goes to some place ( choices); then either object goes to place ( ways) or it does not ( ways).
Exactly in the right place
Choose the objects that are correct; the other must all be wrong.
"At least one letter in a wrong envelope" is : only the arrangement with every letter correct is removed. "All letters wrong" is . For letters these are and . Read whether the question says every, at least one, exactly or at least .
Examples
Example 59 (JEE Main 2023, 11 Apr Shift 1). In an examination, students have been allotted their seats as per their roll numbers. The number of ways, in which none of the students is seated on the allotted seat, is ______.
▸ SHOW SOLUTION
Step 1. Derangements of
Answer:
Example 60 (IITianForum). Five balls have five different colours , ball having colour . After one second each ball takes one of these five colours, and the five balls still have five different colours. In how many ways can this happen if exactly two balls keep their own colour?
▸ SHOW SOLUTION
Step 1. The new colouring is an arrangement
Five different colours on five balls is an arrangement of . A ball that keeps its colour is an object in its own place.
Step 2. Choose the two balls that keep their colour
Step 3. The other three all change
Answer:
Example 61 (IITianForum). Six cards and six envelopes are numbered to . The cards are placed one in each envelope so that no card is in the envelope bearing its own number. In how many ways can this be done if card is in envelope and card is in envelope ?
▸ SHOW SOLUTION
Step 1. What is left
Cards go into envelopes . Envelope is already filled, so card has no forbidden envelope; cards , , each have one.
Step 2. Inclusion and exclusion on the three barred cards
Answer:
Example 62 (IITianForum). Let and . Find the number of one-one functions such that for .
▸ SHOW SOLUTION
Step 1. One-one functions are arrangements
A one-one is an ordered choice of different values: in all.
Step 2. A chosen set of fixed values
If for chosen indices, the other elements take different values from the remaining : ways.
Step 3. Inclusion and exclusion
Answer:
Example 63 (JEE Advanced 2014, Paper 2). Six cards and six envelopes are numbered and cards are to be placed in envelopes so that each envelope contains exactly one card and no card is placed in the envelope bearing the same number and moreover the card numbered is always placed in envelope numbered . Then the number of ways it can be done is
▸ SHOW SOLUTION
Step 1. Card goes to envelope
Then cards are deranged: .
Step 2. Card does not go to envelope
Think of envelope as card 's forbidden envelope. Cards into envelopes with each card barred from one envelope: .
Step 3. Check by symmetry
Card goes to each of envelopes to equally often, so the count is .
Answer: option (C)
Example 64 (IITianForum). Eight cards numbered to are placed in eight envelopes numbered to , one card in each, so that no card is in the envelope bearing its own number. In how many of these ways is card in envelope ?
▸ SHOW SOLUTION
Step 1. Symmetry
In the derangements, card goes to each of the envelopes other than envelope equally often (relabelling those envelopes and their cards swaps the cases).
Step 2. Count
Step 3. Check with the method of Example 63
Card in envelope : . Card not in envelope : . The total agrees.
Answer:
Geometrical counting
Points, lines and triangles
| Given | Count |
|---|---|
| points, no three collinear: lines | |
| points, no three collinear: triangles | |
| points with collinear: lines | |
| points with collinear: triangles | |
| diagonals of an -gon | |
| diagonal crossings inside a convex -gon | |
| parallel lines cut by parallel lines: parallelograms |
Reason for the crossings: any vertices form a quadrilateral whose two diagonals cross at one interior point, and each crossing comes from exactly one such set of (when no three diagonals meet at a point).
Left: a regular hexagon A1 to A6 with all its diagonals drawn. Right: four points on a circle joined as a quadrilateral, its two diagonals crossing at a shaded point
Triangles from the vertices of an -gon
| Triangles with | Count |
|---|---|
| any vertices | |
| two sides common with the polygon | |
| exactly one side common | |
| no side common |
Rectangles on a grid and lattice paths
A grid of unit squares has lines one way and the other. A rectangle is fixed by lines of each kind:
The squares of side number .
A grid of 6 by 3 unit squares with two vertical lines and two horizontal lines drawn thick and the rectangle between them shaded
A path from to going one unit right or one unit up at each step has right steps and up steps in some order:
A 6 by 3 grid with a staircase path from O at the lower left to Q at the upper right made of six steps right and three steps up
Examples
Example 65 (JEE Main 2026, 2 Apr Shift 2). Let denote the total number of triangles formed by joining the vertices of an -side regular polygon. If , then the sum of all distinct prime divisors of is
▸ SHOW SOLUTION
Step 1. Pascal's rule
Step 2. Solve
so .
Step 3. Prime divisors
, and .
Answer: option (C)
Example 66 (JEE Main 2019, 10 Apr Shift 2). Suppose that pillars of the same height have been erected along the boundary of a circular stadium. If the top of each pillar has been connected by beams with the top of all its non-adjacent pillars, then the total number of beams is
▸ SHOW SOLUTION
Step 1. All joins minus neighbours
The pillars are vertices of a -gon, and the beams are its diagonals:
Answer: option (2)
Example 67 (JEE Main 2025, 3 Apr Shift 2). Line of slope and line of slope intersect at the origin . In the first quadrant, are points on line and are points on line . Then the total number of triangles, that can be formed having vertices at three of the points , is
▸ SHOW SOLUTION
Step 1. Two collinear sets
carries and the points : points. carries and the points : points.
Two lines L1 and L2 from the origin O with twelve points on L1 and nine on L2, and a shaded triangle with one vertex on L1 and two on L2
Step 2. Remove the collinear triples
Answer: option (2)
Example 68 (IITianForum). A rectangular board is divided into rows and columns of unit squares. How many rectangles on the board are not squares?
▸ SHOW SOLUTION
Step 1. All rectangles
horizontal and vertical lines:
Step 2. Squares
Side gives squares, to :
Answer:
Example 69 (IITianForum). A path from to goes one unit right or one unit up at each step. How many such paths do not pass through the point ?
▸ SHOW SOLUTION
Step 1. All paths
right and up steps:
Step 2. Paths through
to , then to :
Answer:
Sum of numbers formed
Count each digit in each place
Add the numbers place by place. In a given place, find how many of the numbers have each digit there; the sum of that place is , and every place has the same sum when all arrangements are used.
| Digits | Sum of all numbers using all the digits once |
|---|---|
| distinct non-zero digits | with ones |
| distinct digits including | the above minus with ones |
Reason: with distinct digits, each digit is in a given place in numbers. With among them, the arrangements that start with are -digit numbers whose sum is the second term.
Example
Example 70 (JEE Main 2023, 10 Apr Shift 2). The sum of all the four-digit numbers that can be formed using all the digits is equal to ______.
▸ SHOW SOLUTION
Step 1. How often each digit is in one place
Fix a place. Digit there: the rest in ways. Digit there: the rest in ways. Digit there: the rest in ways.
Step 2. Sum of one place
Step 3. All four places
Answer:
Standard counts
| Count | Value |
|---|---|
| of distinct in a row | |
| of distinct, selection | |
| objects, alike | |
| distinct round a table | |
| distinct beads in a necklace () | |
| of round a table | |
| derangements to | |
| exactly in place | |
| distinct into equal groups | |
| distinct to persons equally | |
| distinct into distinct boxes | |
| distinct into distinct boxes, none empty | |
| identical into distinct boxes | |
| identical into distinct boxes, none empty | |
| selections from alike, at least one | |
| divisors of | |
| lattice paths to | |
| of in a row, no two consecutive |
Which counting rule to use
| The question says | Start with |
|---|---|
| stages one after another | multiply |
| separate cases (or) | add, and check the cases do not overlap |
| arrange, order matters | , or |
| choose, order does not matter | |
| chosen objects then put in a fixed order | only |
| repeated letters | , or cases by the pattern of repeats |
| always together | one block, then inside the block |
| never together, no two adjacent | arrange the others, then the gaps |
| dictionary rank or position | count words beginning with smaller letters |
| round table | fix one person, |
| necklace, garland | , then halve |
| at least, at most | add cases, or total minus the complement |
| identical objects to persons | dots and bars |
| distinct objects in groups | , divide by for equal sizes |
| identical objects, identical boxes | list the partitions |
| every kind at least once | patterns of repeats, or inclusion and exclusion |
| nobody in their own place | derangement |
| points, lines, polygons | , then remove the collinear cases |
| grid, shortest paths | choose lines, choose steps |
What JEE asks
JEE Main asks one or two counting questions in every shift. In 2026 the frequent types were the lift and floors questions (Examples 1 and 50), the exponent of a prime in a factorial (Examples 5 and 6), words from a given word with or without repeats (Examples 7 and 10), digits with a divisibility condition (Examples 2 and 3), together and not together (Example 14), dictionary rank (Example 19), distributions of identical objects and integer solutions (Examples 42 and 43), properties of (Examples 37 and 38), every digit used at least once (Example 57) and triangles in a polygon (Example 65). The 2025 papers added numbers between two limits (Examples 4 and 45), the gap method (Examples 15 and 16) and selections with a forced order (Example 29).
JEE Advanced asks fewer but more careful questions: ratios of two counts (Examples 8 and 17), digits in an interval (Example 9), hats round a circle (Example 28), selections from boxes with conditions (Example 36), non-consecutive days (Example 35), rooms and teams with restrictions (Examples 55 and 56), distributions with an upper limit (Example 47), increasing integer solutions (Example 48), inclusion and exclusion on digits (Example 58) and derangements with one card fixed (Example 63).
Quick recall
| Result | Statement |
|---|---|
| Multiplication, addition | and multiplies, or adds |
| Exponent of in | |
| Permutation, combination | |
| Together | block, |
| No two together | |
| Round table, necklace | , |
| Pascal's rule | |
| Divisors | |
| Integer solutions | , positive |
| Equal groups | divide by |
| Onto, boxes | |
| Derangement | |
| Exactly in place | |
| Diagonals, crossings | , |
| Lattice paths |
Without a pen, answer these four: the arrangements of the letters of LEVEL; the ways to seat persons at a round table; the non-negative solutions of ; and . If , , and came quickly, the chapter is in place.
Practise these methods on real exam questions in the doMath Permutations and Combinations chapter. Counting one-one and onto functions is worked out in the Functions note, subsets and the number of relations are in the Sets and Relations note, and sums of with powers of appear in the Binomial Theorem note.