Two important topics of permutations and combinatoric


JEE Main · Permutation and Combination

2 Counting Tricks Every JEE Student Should Know: 66 and 66,660

How many ways can 10 be split into three whole numbers? What do all 24 numbers made from 1, 2, 3, 4 add up to? Both look like hours of listing. Both take under a minute with the right idea.

By learn4math · 9 min read · Class 11 Maths · JEE Main and JEE Advanced

Trick 1 · Stars and bars

How many solutions does \(x + y + z = 10\) have?

We want whole-number solutions, so zero is allowed: \(x, y, z \ge 0\). For example \((3, 5, 2)\), \((0, 0, 10)\) and \((4, 0, 6)\) all work. This exact question appears again and again in JEE Main previous year questions on permutation and combination.

You could try listing them, but there are a lot, and it's very easy to miss one. Instead, we turn the equation into a picture.

Step 1: draw 10 stars

Each star is one unit of the 10. Now add 2 bars anywhere in the row. The bars cut the stars into three groups:

Stars before the first bar are \(x\), stars between the bars are \(y\), and stars after the second bar are \(z\). So this picture means \((x, y, z) = (3, 5, 2)\). Bars at the very start, ||★★★★★★★★★★, mean \((0, 0, 10)\).

Step 2: one picture = one solution

Every arrangement of stars and bars gives exactly one solution, and every solution gives exactly one arrangement. Mathematicians call this a bijection. So instead of counting solutions, we can count arrangements, which is much easier.

Try it: move the bars

Each tap places the 2 bars somewhere new. See how many different solutions you can find.

Step 3: count the arrangements

There are \(10 + 2 = 12\) symbols in a row. An arrangement is fixed as soon as we decide which 2 of the 12 places hold bars:

\[\binom{12}{2} = \frac{12 \times 11}{2} = 66\]

Answer: \(x + y + z = 10\) has 66 non-negative integer solutions.

The JEE trap: what if \(x, y, z \ge 1\)?

If every variable must be positive, the answer changes. Give each variable 1 star first. That uses 3 stars and leaves 7 to share freely, with 2 bars:

\[\binom{7 + 2}{2} = \binom{9}{2} = 36\]

Common mistake: answering 66 when the question says "positive integers". Always check whether zero is allowed.

The general formula

Splitting \(n\) identical things into \(k\) groups (the number of solutions of \(x_1 + x_2 + \cdots + x_k = n\)):

\[\begin{gathered}x_i \ge 0:\quad \binom{n+k-1}{k-1} \\[6pt] x_i \ge 1:\quad \binom{n-1}{k-1}\end{gathered}\]

More examples using the same trick

QuestionWorkingAnswer
Number of terms in \((a+b+c)^{10}\)Each term \(a^x b^y c^z\) has \(x+y+z=10\): \(\binom{12}{2}\)66
\(a+b+c+d = 8\), all \(\ge 0\)\(\binom{8+3}{3} = \binom{11}{3}\)165
20 identical chocolates to 4 children, each gets at least 1\(\binom{19}{3}\)969
\(x+y+z=10\) with each \(x, y, z \le 5\)\(66 - 3\binom{6}{2} = 66 - 45\) (remove cases where one variable is 6 or more)21

Every answer on this page was also checked by a computer program that lists all the cases.

Trick 2 · Sum of numbers

What is \(1234 + 1243 + \cdots + 4321\)?

Using the digits 1, 2, 3 and 4, each exactly once, write every possible 4-digit number. What is their total? This is another favourite in JEE Main and NCERT Class 11 Maths.

Step 1: how many numbers are there?

4 choices for the first digit, then 3, then 2, then 1:

\[4 \times 3 \times 2 \times 1 = 4! = 24 \text{ numbers}\]

Step 2: look at one column, not 24 rows

Here are all 24 numbers. Tap the button to colour the thousands digit.

Fix the digit 1 in front: the other 3 digits can be arranged in \(3! = 6\) ways. The same is true for 2, 3 and 4. So each digit appears exactly 6 times in every place, and every column adds to:

\[6\,(1 + 2 + 3 + 4) = 6 \times 10 = 60\]

Step 3: add the place values

\[\begin{gathered}60 \times 1000 + 60 \times 100 + 60 \times 10 + 60 \times 1 \\ = 60 \times 1111 = 66{,}660\end{gathered}\]

Answer: the sum of all 24 numbers is 66,660.

Check it another way: pairing

Pair each number with a partner made by swapping \(1 \leftrightarrow 4\) and \(2 \leftrightarrow 3\). For example, 1243 pairs with 4312. In every column the two digits add to 5, so every pair adds to 5555:

\[\begin{gathered}1243 + 4312 = 5555 \\ 12 \text{ pairs} \times 5555 = 66{,}660\end{gathered}\]

Careful: "reversing" the number does not work. \(1243 + 3421 = 4664\), not 5555. The swap must be \(d \to 5 - d\).

The general formula

For \(n\) different non-zero digits, each used once:

\[\begin{gathered}\text{Sum} = (n-1)! \times (\text{sum of digits}) \\ \times\ \underbrace{11\ldots1}_{n \text{ ones}}\end{gathered}\]

If 0 is one of the digits, numbers starting with 0 are not real 4-digit numbers, so subtract them. For the digits 0, 1, 2, 3:

\[\begin{gathered}3! \times 6 \times 1111 - 2! \times 6 \times 111 \\ = 39{,}996 - 1{,}332 = 38{,}664\end{gathered}\]

Type 2 to 7 different digits (0 is allowed). Try 123, 0123 or 12345.

More examples

DigitsWorkingSum
1, 2, 3 (3-digit numbers)\(2! \times 6 \times 111\)1,332
1, 2, 3, 4, 5 (5-digit numbers)\(4! \times 15 \times 11111\)39,99,960
0, 1, 2, 3 (4-digit numbers)\(39{,}996 - 1{,}332\)38,664

Watch the two Shorts

x + y + z = 10 → 66 solutions

1234 + … + 4321 = 66,660

Practice questions (tap to see the answer)

1. How many non-negative solutions does \(a + b + c + d = 6\) have?

\(\binom{6+3}{3} = \binom{9}{3} = 84\).

2. In how many ways can 12 identical balls go into 3 different boxes so that no box is empty?

\(\binom{11}{2} = 55\).

3. Find the sum of all 3-digit numbers made from 2, 5, 8 without repetition.

\(2! \times 15 \times 111 = 3330\).

4. Why do we divide by 2 in \(\binom{12}{2} = \frac{12 \times 11}{2}\)?

The two bars are identical, so choosing place 3 then place 9 is the same as choosing place 9 then place 3.

Frequently asked questions

Why is the stars and bars method correct?

Every arrangement of 10 stars and 2 bars gives exactly one solution, and every solution gives exactly one arrangement, so the two counts are equal.

What changes if the variables must be positive?

Give each variable 1 first, then share what is left. For \(x+y+z=10\) the answer drops from 66 to 36.

Does the 66,660 trick work with a zero?

Not directly. Numbers starting with 0 must be removed; see the 0, 1, 2, 3 example above, which gives 38,664.

#StarsAndBars#PermutationAndCombination#JEEMain#JEEAdvanced#Class11Maths#learn4math

Found all 66 solutions yet? Scroll up and keep moving the bars!

Subscribe to learn4math on YouTube for a new JEE maths trick every week.

Leave a comment

Questions, corrections or feedback — all welcome.

Post a Comment

0 Comments