How many numbers with six digits(Basically from 100 000 to 999 999) have exactly two equal digits and the rest are all different?
What I tried: first digit can't be a zero, so the number would have 5 digits.
I have at least 2 cases, the repeated digit is in the first slot or on another
first slot has the repeated digit:
I have 9 numbers to place on the first slot(an on the other repeated digit), and then I have 5C1 places to put the second repeated number, then I have 9*8*7*6 ways to place the other numbers. So first case:9 * 5 * 9A4 = 136080
not first slot has the repeated digit:
5C2 places to put the repeated digits(all except the first) and I have 10 digits to use, then I have two cases. I can have the number 0(zero) or not(this will cause trouble because I can't place the number 0 on the first slot, so I divided in two more cases)
There is not a zero: Easy, 8A4(8*7*6*5)
There is a zero: Hmmm, the first digit can't be a zero, so I have 8(I have 8 because I can't use the number 0 nor the repeated number) options left, then for the other 3 places I want to have a zero, otherwise I was just repeating the last case,I want 3 numbers, have a zero, so I want to pick two numbers, 7C2(7 possibilities, because out of 10 I used 0, the repeated and the first slot number), okay I have 3 numbers without order, so I do 3! or 3A3 to arrange them.
So the second case: 5C2 * 10 [8A4 + 8*7C2*3!] = 268800
So my solutions: 136080 + 268800 = 404880
However there is another solution that seems to be correct but gives a different result : 5C2 * 9A4 + 9[5C1*9A4 + 5C2*8*8*7*6] = 408240 Explaining briefly: 5C2 * 9A4, this case, the repeated number is 0, and is not on the first slot.
9*5C1*9A4, this case ocuppy the first slot(repeated number), I have 9 numbers/possibilities for the first slot and the repeated number, then 9 numbers left for all the other places 9A4
9*5C2*8*8*7*6, 9 numbers for the two choosen spots(not the first slot, there are 9 numbers and not 10, because that case is already done, it's the first case), then for the first slot I can't have number zero so 8, then for the other 3 slots I have 8*7*6, so that's the thought process.....
Which is the correct one, or are both wrong?