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:-No digit is repeated
- 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
Method 2:-
We make 2 cases for all required 3 digit numbers:- (Pertaining to restrictions above)
- Number ends with 0 = 9*8=72
- Number ends with 5 = 8*8=64
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}$