On this page
Distinct digits, divisible by 5, divisible by 4, at least one repeat: these look like different problems but use one method. Here is each one worked on four-digit numbers, with every count shown.
How does the box method work?
The method rests on one rule. NCERT calls it the fundamental principle of counting: "If an event can occur in m different ways, following which another event can occur in n different ways, then the total number of occurrence of the events in the given order is m×n" (NCERT Class 11 Mathematics, Chapter 6).
Each digit position is an event: draw one box per position, write how many digits can go in it, and multiply. NCERT's Example 3 counts two-digit even numbers made from the digits 1 to 5 by filling the units place first, because only 2 and 4 are allowed there. That habit is the key:
Draw the boxes: thousands, hundreds, tens, units.
Fill the most restricted box first (the first digit cannot be 0; divisibility fixes the last digit or two).
Count what is left for each remaining box.
Multiply. If one restricted box changes the count in another, split into cases and add.
How many four-digit numbers have distinct digits?
The thousands box can hold 1 to 9, so 9 choices. The hundreds box can now use 0, but not the digit already used, so again 9. Then 8 for tens and 7 for units.
The count is 9 × 9 × 8 × 7 = 4536.
The most common wrong answer is 10 × 9 × 8 × 7 = 5040. That total includes strings like 0123, which are really three-digit numbers. There are 9 × 8 × 7 = 504 of them, and 5040 − 504 = 4536, so the two routes agree.
How many of these are divisible by 5?
A number is divisible by 5 when its last digit is 0 or 5 (divisibility rules). Fill the units box first, but notice the two choices behave differently, so split into cases.
Ends in 0: thousands has 9 choices (1 to 9), then hundreds 8 and tens 7. That gives 9 × 8 × 7 = 504.
Ends in 5: thousands cannot be 0 or 5, leaving 8 choices; hundreds 8 and tens 7. That gives 8 × 8 × 7 = 448.
So 504 + 448 = 952. Writing 2 in the units box and multiplying once fails, because a 0 there frees up a choice in the thousands box.
How many are divisible by 4?
A number is divisible by 4 when its last two digits form a number divisible by 4 (divisibility rules). So the restricted part is the last two boxes together.
From 00 to 96 there are 25 such endings. Drop 00, 44 and 88, which repeat a digit, and 22 endings remain. Split them by whether they contain 0:
Six endings contain 0: 04, 08, 20, 40, 60, 80. The thousands box loses only the non-zero digit already used, so 8 choices, then 7 for hundreds. That is 6 × 8 × 7 = 336.
The other 16 endings have no 0. The thousands box cannot take 0 or either used digit, so 7 choices, and hundreds also has 7. That is 16 × 7 × 7 = 784.
The total is 336 + 784 = 1120. As a sanity check, about a quarter of 4536 is 1134, which is close, as it should be.
What changes when digits can repeat?
With repetition allowed, every box after the first has 10 choices, so there are 9 × 10 × 10 × 10 = 9000 four-digit numbers. NCERT makes the same switch with the letters of ROSE: 24 words without repetition, 4 × 4 × 4 × 4 = 256 with it (NCERT Chapter 6).
"At least one digit repeated" is easiest by subtraction: 9000 − 4536 = 4464. The same works with a condition. Four-digit numbers divisible by 5 number 9 × 10 × 10 × 2 = 1800, so those with a repeated digit number 1800 − 952 = 848.
A five-point check before you multiply
Did 0 sneak into the first box?
Did you fill the restricted box (or pair of boxes) first?
Does one box's choice change another box's count? If yes, split into cases.
Does the question say "at least one"? Use the complement.
Is the answer roughly the right fraction of the total (a fifth for 5, a quarter for 4)?
The same box counting drives the column trick for the sum of all numbers formed from given digits and finding the rank of a word in dictionary order; for case-splitting errors, see how to stop double counting.
To practise, the Fermi Problem Library has worked problems with a step-by-step solver that explains the reasoning rather than printing an answer, so you can see where a case split went wrong.



