[Math] How many 5-digit numbers are there with number 2 and 3 following each other. No repetition of digits allowed.

combinatorics

According to the answer sheet:

Case 1:
If number 2 comes first in the 5-digit number, we can choose remaining numbers in 8*7*6 different ways.

Case 2:
The number of ways to place number 2 and 3 after each other so that number 2 doesn't appear first can be formed in 3*7*7*6 ways, because the numbers 2 and 3 can be placed on 3 different places. And we can choose the first number in 7 different ways (can't be 0), and the remaining numbers in 7*6 different ways.

So, I understand the first case. What I don't get is the second case.
Let's say I put the sequence of numbers like this: "_ _ _ 2 3" and decide to pick the third number first (8 ways), then the second number (7 ways) and lastly the first number (5 ways). I won't get the same result, so my question is: why do I have to do this in order, starting from the first digit?

Best Answer

It's not necessarily $5$ ways for the first number. If you'd picked $0$ earlier, then it'd be $6$. On the other hand, starting from the first number avoids this problem.


If you wish to count starting from the third digit or similar, then you need to split it into cases. You'd then get the same result as before.

$$\underbrace{7*6*5}_{\text{No $0$s}}+\underbrace{1*7*6}_{\text{$0$ for third digit}}+\underbrace{7*1*6}_{\text{$0$ for second digit}}=7*7*6$$