# Conflict of methods :- "How many 3 digit natural numbers less than 1000 and divisible by 5 are there such that all digits are distinct "?

Now to tackle the above problem . I am listing below 2 methods below I used to solve it and I got the correct answer using the latter one :-

Restrictions given are:-
1. No digit is repeated

2. Number is divisible by 5

Method 1:-
Total number of 3 digit numbers using restriction 1 can be formed as follows

$$1^{st}$$ digit $$2^{nd}$$ digit $$3^{rd}$$ digit
all digits except
0 are possible
restriction 1 restriction 1
9 cases 9 cases , 1 taken already 8 cases , 2 taken already

total cases = 9 * 9 * 8 = 648

Total number of 3 digit numbers using restriction 1 but not divisible by 5 can be formed as follows

$$1^{st}$$ digit $$2^{nd}$$ digit $$3^{rd}$$ digit
all digits except
0 are possible (chosen after $$2^{nd}$$ and $$3^{rd}$$ digit)
after selecting third place use restriction 1 0 and 5 not possible
8 cases 9 cases , 1 taken already 8 cases

total cases = 8 * 9 * 8 = 576

Now to find numbers divisible by 5 = (Total numbers) - (Numbers not divisible by 5) = 648 -576 = 72

Method 2:- We make 2 cases for all required 3 digit numbers:- (Pertaining to restrictions above)

1. Number ends with 0 = 9*8=72
2. Number ends with 5 = 8*8=64
Total numbers= 72+64 = 136

### WHERE AM I WRONG IN METHOD 1 ?

• I thought $3$ digit natural numbers were always less than $1000$. Aug 6 at 17:30
• @Yorch not if it's 3 digits in another higher base in theory. Aug 6 at 23:57

I agree with your second method, and it is probably how I would have attempted the problem.

One problem with your first method is that if you pick the $$2$$nd and $$3$$rd digit and they are both nonzero, then you will have $$7$$ choices left for the first digit. Similarly, if the $$2$$nd digit is zero, then there are $$8$$ choices for the third digit. With the order of choosing digits that you have done, you must do casework.

You are kind of lucky in this problem because the restrictions on the third digit (i.e. cannot be $$0$$ or $$5$$) include the restrictions on the first digit (cannot include $$0$$). The best order (the one that does not require casework) should select in this order: third digit, first digit, second digit.

There are $$\boxed{8}$$ ways to select the third digit. Since we have $$9$$ options for the first digit, but one of these options will always be chosen as the third digit, there are $$\boxed{8}$$ ways to select the first digit.

We have always now already chosen $$2$$ out of $$10$$ of the options for the second digit. Hence, there are $$\boxed{8}$$ ways to select the second digit.

Your answer is now $$9\cdot 9\cdot 8-8\cdot 8\cdot 8=648-512=\boxed{136}$$

In you approach, you did not think of $$2$$ different cases:

• 2nd digit is $$0$$ or is not $$0.$$

It is easier (in Method 1) to count the possible digits in order 3-1-2. This gives $$8\times 8 \times 8$$ numbers non-divisible by $$5.$$