# How many 10-digit numbers whose first four digits match either the next four digits or the last four digits?

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?

• What about 1010101010? Here, both criteria are met. How many such examples are there? Feb 16, 2020 at 10:58
• 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.
– Blue
Feb 16, 2020 at 11:05
• Do you literally mean "either ... or" (i.e. exclusive or, not both)? Or do you mean inclusive or (could also be both)? Feb 16, 2020 at 11:06
• In what category lies the number $1111111111$? Is it allowed or not? Feb 16, 2020 at 11:25
• So should I subtract 90 from it? Feb 16, 2020 at 13:21