My approach :
I divided it into 2 cases firstly :Case 1) the numbers having no 0s and Case 2)the numbers having a 0 in them
so Case 1 :
choosing 3 digits out of 7 in 7c3 ways = 35 ways
now arranging the 4 digits in 4!/(2!) ways
therefore number of ways = 35 * 12 = 420
Now Case 2 :
Here we have selected one 0 , now remaining 2 digits can be chosen in 7c2 ways =21 ways
now arranging the 4 numbers we get ( 4!/2!) - 3! = 6 ways
giving total of 126 numbers
therefore my answer is coming out to be 420 + 126 = 546 numbers
But the answer is given as 1764 numbers, Can someone guide me on where am I going wrong , and how to correct
$\endgroup$ 23 Answers
$\begingroup$A neat way of solving without cases, using probability, is to first compute including leading $0's$ and multiply by $\frac78$ to exclude them.
Thus $\binom42\cdot 8\cdot7\cdot6\times\frac78 = 1764$
$\endgroup$ 6 $\begingroup$Case 1
"choosing 3 digits out of 7 in 7c3 ways = 35 ways"
choosing which of the 3 digits is repeated give as $35\cdot 3 = 105$ ways to have four digits where exactly three are unique.
"now arranging the 4 digits in 4!/(2!) ways"
"therefore number of ways = $\require{cancel}$$\cancel{35}105 * 12 = \cancel{420}1260$"
Case 2a
"Here we have selected one 0 , now remaining 2 digits can be chosen in 7c2 ways =21 ways"
Choosing which number is repeated. Case 2a: there are $21\cdot 1 = 21$ ways the $0$ is repeated. Case 2b: there are $21\cdot 2 = 42$ ways a number other than the $0$ is repeated.
now arranging the 4 numbers we get ( 4!/2!)= 12 ways but we must subtract the ones where a $0$ is in the first digit.
Case 2a: the first non-zero has $3$ choices of positions and the second has $2$ choices of position so there are $6$ positions where $0$ is in the first position. [We can verify that $00ab, 00ba, 0a0b, 0b0a, 0ab0, 0ba0$]. So there are $12-6 = 6$ ways.
Case 2b: There are ${3\choose 2}= 3$ ways to choose the positions for the $2$ repeating digits in three positions [$0aab, 0aba, 0baa$]. So there are $12-3 = 9$ ways.
So 2a: $21\times 6 = 126$. ANd $2b = 42\times 9 = 378$.
So $1260 + 126 + 378 = 1764$
$\endgroup$ $\begingroup$In case 1 (no zeros): Suppose you have chosen three digits, say, $\{1,2,5\}$. Choose one of them to appear twice ($3$ choices). Then choose the two places where it appears, $\binom{4}{2}=6$ choices. Then choose which way the remaining two digits fill the remaining two places, $2$ choices. You should have $3 \times 6 \times 2 = 36$ choices, not 12. (You seem to have forgotten the choice of which digit appears twice.)
You might have a similar mistake in case 2. Check it out.
$\endgroup$