On this page
When you need to select items from a mixed group where some objects are identical, the standard combinations formulas for distinct objects will not work. If you try to use nCr on identical items, you will overcount wildly.
How do you select from one set of identical objects?
If you have p identical objects, the objects themselves cannot be told apart. The only thing you can change is how many you choose. You cannot pick a "different" two apples if all the apples are identical.
You can select 0, 1, 2, all the way up to p objects. This means there are exactly p + 1 ways to choose any number of objects from the set. If the question states you must choose at least one object, you simply drop the "zero" choice. That leaves exactly p ways.
According to the JEE combinations guide by BYJU'S, the number of ways to select r objects from n identical objects is always 1. The total number of ways to select zero or more is n + 1.
What is the formula for multiple identical sets?
When a problem gives you several groups of identical objects, you multiply the independent choices for each group together.
If you have p identical objects of one kind, q identical objects of another, and r of a third, you have:
p + 1 choices for the first type
q + 1 choices for the second type
r + 1 choices for the third type
By the fundamental principle of counting, the total number of possible selections is (p + 1)(q + 1)(r + 1).
If the problem asks for the number of ways to select *at least one* object in total, you must subtract the single case where you chose zero objects from every set.
The formula is: (p + 1)(q + 1)(r + 1) − 1.
How does this work with an example?
In how many ways can you select at least one fruit from 3 identical apples and 2 identical bananas?
For the apples (p = 3), you have 4 choices: you can take 0, 1, 2, or 3.
For the bananas (q = 2), you have 3 choices: you can take 0, 1, or 2.
The total choices are 4 × 3 = 12. Subtracting the empty case leaves exactly 11 ways.
If you are struggling to spot which rules apply, the Fermi Concept Library has every concept in mathematics, each with its own lesson and its place in the map.
How does this match counting divisors?
The formula (p + 1)(q + 1)(r + 1) might look familiar. It is exactly the formula used to find the number of divisors of a natural number.
Every integer greater than 1 breaks down into a unique set of prime factors. For example, 360 is written as 2³ × 3² × 5¹.
To build a divisor of 360, you are essentially selecting from a pile of identical prime numbers: you have 3 identical twos, 2 identical threes, and 1 identical five.
According to CP-Algorithms, the number of divisors is found by adding 1 to each exponent and multiplying them together. For 360, that gives (3 + 1)(2 + 1)(1 + 1) = 4 × 3 × 2 = 24 divisors.
This is exactly the same logic as our fruit example. The selection where you choose zero twos, zero threes, and zero fives corresponds to the divisor 1 (since 2⁰ × 3⁰ × 5⁰ = 1). If you want the number of proper divisors (divisors strictly greater than 1), you subtract that single empty selection. This gives the exact same (p + 1)(q + 1)(r + 1) − 1 formula. Mathematics is highly connected; a rule for picking identical fruits is the identical rule for finding factors.
What if you also have distinct objects?
Exams often mix identical and distinct objects. For example, you might be asked to select at least one item from p identical apples, q identical bananas, and n completely different, distinct fruits (like a mango, a papaya, and a kiwi).
For the identical objects, the rule does not change: you have (p + 1)(q + 1) choices.
For each of the n distinct objects, you are making an independent yes-or-no decision. You have exactly 2 choices for the mango (take it or leave it), 2 choices for the papaya, and 2 choices for the kiwi. This gives 2ⁿ possible choices for the distinct part.
To find the total number of selections, multiply the choices together: (p + 1)(q + 1) × 2ⁿ.
Finally, if the problem requires you to select at least one object overall, you must subtract the single case where you said "no" to everything. The final formula becomes:
(p + 1)(q + 1) × 2ⁿ − 1.



