Distributing Identical and Distinct Objects: Stars and Bars Made Clear (JEE)

You have 10 identical laddoos and 4 children. Another day you have 5 different books and 3 students. Both say "distribute", yet one answer is a combination and the other is a power. Which formula applies, and why? This post settles that for good. It matters for JEE (Mathematics), under Permutations and Combinations in Class 11.
Quick Summary
Identical objects into distinct boxes: the answer is C(n + r − 1, r − 1), where n is the number of objects and r the number of boxes.
If every box must get at least one: C(n − 1, r − 1).
Distinct objects into distinct boxes (any box may stay empty): rⁿ.
Distinct objects into groups of fixed sizes: n! ÷ (a! × b! × …), then divide by k! for every k groups of equal size that are unlabelled.
The one question to ask first
Before touching a formula, ask two things: are the objects identical or different? and are the boxes labelled or interchangeable? Everything else follows from these.
Identical objects, distinct boxes: the stars and bars idea
Since the objects are identical, only how many each box gets matters. So we are counting the solutions of x₁ + x₂ + … + xᵣ = n, where each x is the number in one box (a whole number, zero allowed).
Picture the n objects as stars in a row. To split them among r boxes, place r − 1 dividers (bars) among them. For example, with 5 stars and 3 boxes, ★★|★|★★ means 2, 1, 2. Every arrangement of n stars and r − 1 bars in a row gives exactly one distribution, and vice versa. The total positions are n + r − 1, and we choose which r − 1 of them are bars. Hence the count is C(n + r − 1, r − 1), where C(a, b) = a! ÷ (b! × (a − b)!).
If each box must get at least one, first hand one object to every box. That uses r objects and leaves n − r to distribute freely among r boxes: C((n − r) + r − 1, r − 1) = C(n − 1, r − 1). The same trick handles "at least 2 each": give 2 to each box first, then distribute what remains.
Distinct objects, distinct boxes
Here every object makes its own independent choice of box. Each of the n objects has r options, so the total is r × r × … (n times) = rⁿ. With the condition "every box non-empty" you need inclusion–exclusion, which is a separate topic; for exams, the unrestricted case is the common one.
Dividing into groups
To split n distinct objects into groups of sizes a, b, c (a + b + c = n), choose the first group, then the second from what is left, and so on: n! ÷ (a! × b! × c!). If two or more groups have the same size and the groups are not named, swapping them gives the same split, so divide by k! for k equal-sized groups. If the groups are labelled (for example, given to named people), do not divide.
Worked examples
Example 1. In how many ways can 10 identical laddoos be given to 4 children?
Here n = 10 objects and r = 4 boxes, identical objects, distinct children.
Count = C(10 + 4 − 1, 4 − 1) = C(13, 3).
C(13, 3) = (13 × 12 × 11) ÷ (3 × 2 × 1) = 1716 ÷ 6 = 286.
If every child must get at least one: C(9, 3) = (9 × 8 × 7) ÷ 6 = 84. If every child must get at least two: give 8 first, leaving 2, so C(2 + 3, 3) = C(5, 3) = 10.
Example 2. Find the number of ways to split 5 different books into groups of 2, 2 and 1.
Labelled groups: 5! ÷ (2! × 2! × 1!) = 120 ÷ 4 = 30.
The two groups of size 2 are indistinguishable when groups are unnamed, so divide by 2!: 30 ÷ 2 = 15.
If the groups are given to three named students (who get 2, 2, 1 books), the answer stays at 30 ways for a fixed assignment of sizes; counting which student gets the single book multiplies by 3, giving 90.
Example 3. 5 different books to 3 students with no restriction: 3⁵ = 243.
Mistakes students actually make
Using rⁿ for identical objects, or C(n + r − 1, r − 1) for distinct ones. Check "identical or different?" first.
Swapping n and r in the formula. The bars number r − 1 (one fewer than the boxes), never n − 1 in the unrestricted case.
Forgetting to divide by k! for equal-sized unlabelled groups, or dividing when the groups are labelled.
Handling "at least m each" by subtracting afterwards. Give the minimum first, then distribute the remainder.
Missing that "number of non-negative integer solutions" is the same problem in disguise.
How it is asked in JEE
"Number of non-negative integer solutions of x + y + z = 12" (answer C(14, 2) = 91).
Distribution of identical balls or sweets with minimum conditions.
Splitting people or objects into teams, with and without team names.
Counting integers with a fixed digit sum, which reduces to bars and stars with an upper limit on each digit.
Pro Tip: Convert every wording to "solutions of x₁ + … + xᵣ = n". If the lower limit on each variable is m, substitute yᵢ = xᵢ − m so that the new variables start at zero, then apply the basic formula. Sukriti NeetJee students often find that this single substitution handles almost every "at least" and "at most" variant, and an upper limit is handled by subtracting the cases that break it.
Frequently Asked Questions
Why are there r − 1 bars for r boxes?
Each bar is a wall between two neighbouring boxes. Three boxes in a row need two walls between them, and in general r boxes need r − 1 walls.
Can a box stay empty in the formula C(n + r − 1, r − 1)?
Yes. Two bars may sit next to each other or at an end, which represents an empty box. When every box must be non-empty, use C(n − 1, r − 1) instead.
When do I divide by k! while grouping?
Divide only when k groups have the same size and are not distinguished by name or by who receives them. If the groups go to named people or labelled boxes, swapping them gives a different distribution, so no division is needed.
What if the objects are distinct but the boxes are identical?
Then you are counting partitions of a set. For small cases list the group sizes and use the grouping formula with the k! division. Large cases of this type are rare in JEE.
Is this the same as finding the number of integer solutions to an equation?
Yes, exactly. Each variable stands for one box, and its value is the number of objects it receives. The method is identical.
Stuck on a distribution problem? Drop it in the comments and we will work through it together, and share this with a fellow JEE aspirant who mixes up the two formulas.

Comments