If in a 10-digit number, the first four digits are either exactly the same as the next four digits or the last four digits. How many such 10 digit numbers are there?

My attempt:

First I consider the case with first four and next four are same. For the first four places, we have $9\times 10\times 10\times 10$ ways of choosing digits as zero cant come in first digit.

The digits for next four places are already choosen as they are the same. The remaining two places can be filled in $10\times 10$ ways.

Therefore total is $9\times 10^5$ ways.

Since the second case first four and last four digits are same, the answer will again be $9\times 10^5$ ways.

Therefore, total numbers are $2\times 9\times 10^5$. However, correct ans is $9\times 10^5-90$ .

Why am I wrong?

  • 4
    $\begingroup$ What about 1010101010? Here, both criteria are met. How many such examples are there? $\endgroup$ Feb 16, 2020 at 10:58
  • 2
    $\begingroup$ How do you know you're wrong? If you have the correct answer available, please include it in the body of your question so that readers need not spend time re-deriving it. $\endgroup$
    – Blue
    Feb 16, 2020 at 11:05
  • 2
    $\begingroup$ Do you literally mean "either ... or" (i.e. exclusive or, not both)? Or do you mean inclusive or (could also be both)? $\endgroup$
    – joriki
    Feb 16, 2020 at 11:06
  • 1
    $\begingroup$ In what category lies the number $1111111111$? Is it allowed or not? $\endgroup$ Feb 16, 2020 at 11:25
  • $\begingroup$ So should I subtract 90 from it? $\endgroup$ Feb 16, 2020 at 13:21


You must log in to answer this question.

Browse other questions tagged .