[Math] How many four digit numbers, in which all digits are distinct, contain at least one of 2 and 4 and have no leading zeros

combinatorics

First off, I'm not quite sure what this question is asking (there are a lot of very vague questions in the textbook I'm using and it's caused me some frustration), and I'm assuming one interpretation of the wording.

This is the question:

How many integers between 1,000 and 10,000 are there with distinct digits and at least one of 2 and 4 must appear?

I'm taking it to mean at least one 2 AND at least one 4 must appear. It can also be interpreted as at least one of either 2 or 4, such that a number containing one two and no fours is valid. If there is a specific reason why one interpretation is better than the other, please let me know.

Assuming the first interpretation:

Since 10,000 does not include 2 nor 4, it can be ignored and the question boils down to what I put as the title. To figure out the rest of the question, I scribbled this down (not anything formal):

Let A be a digit whose value is either 2 or 4.
Let B be a digit whose value is neither 2 nor 4.

The different combinations of four digit numbers with distinct digits and at
least one 2 and at least one 4 are represented by the sequences:

BBAA, BABA, BAAB, ABBA, ABAB, AABB

This gives me: $$(7 * 7 * 2 * 1) + (7 * 2 * 7 * 1) + (7 * 2 * 1 * 7) +$$
$$(2 * 8 * 7 * 1) + (2 * 8 * 1 * 7) + (2 * 1 * 8 * 7) = 630$$

The second interpretation doesn't really change the method much, it just results in this instead (10,000 is also ignored here):

Let A be a digit whose value is either 2 or 4.
Let B be a digit whose value is not that of A.

BBBA, BBAB, BABB, ABBB

Which gives me:

$$(8 * 8 * 7 * 2) + (8 * 8 * 2 * 7) + (8 * 2 * 8 * 7) + (2 * 9 * 8 * 7) = 3696$$

Are these answers, and by extension my method of obtaining them, correct?

Best Answer

My interpretation of the text in the body of the post is that the only bad numbers are those that miss both $2$ and $4$. We calculate the number of good numbers, so that you can compare with your second calculation.

First forget about the $2$, $4$ stuff. If we have no restriction, then the number of numbers with distinct digits, from $1000$ to $9999$, is $(9)(9)(8)(7)$.

The number of bad numbers with distinct digits (so missing both $2$ and $4$) is $(7)(7)(6)(5)$.

Subtract.