I know this question was already answered (How many integers between 1000 and 9999 inclusive consist of), and I understand the solution. However, I don't understand what's wrong with my approach. I did it from right to left. My reasoning:

Last digit has to be odd, so we have $5$ possibilities. In the tenths place, we can choose whatever we want except for the one already chosen, so we have $9$ possibilities. Similarly, in the hundredths place we have $8$ choices. In the thousands place, we can choose $10 - 3 - 1$ (not including $0$) $= 6$ possibilities, so in total we have $5 * 9 * 8 * 6 = 2160$. Why am I undercounting here?


Because if you've already chosen $0$ before (in the tens or hundreds place), then you're excluding $0$ twice in allowing only $10-3-1=6$ options for the thousands place.

To compensate this, you could count the number of cases where you have a $0$ in the tens or hundreds place. But as in the linked answer, it is easier to just start with the thousands place.

  • $\begingroup$ I see. Thank you! $\endgroup$ – Dumb Dumb Dec 2 '18 at 19:51

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.