$3$-digit numbers are formed by arranging three of the digits $1$, $2$, $3$, $4$ and $5$

Three-digit numbers are formed by arranging three of the digits $$1$$, $$2$$, $$3$$, $$4$$ and $$5$$. No digit may be used more than once. Find the number of three-digit numbers if there exists at least $$1$$ prime number in the $$3$$ digits.

I have found the answer to be $$3C1 \cdot 4P2 = 36$$, but the correct answer is $$60$$. Can someone help with this?

Thought process: one of the digits must be $$2, 3$$ or $$5$$ so $$3C1 = 3$$ ways and remaining $$2$$ digits to choose from the $$4$$ digits remaining, hence $$4P2 = 12$$.

• Find the number of three-digit numbers with no digit used more than once. Subtract the number of examples where there are no prime digits. Part of the calculation is trivial Feb 17, 2022 at 8:54
• Your approach would count the three-digit numbers with no digit used more than once, where the first digit is prime. But it would miss cases like $432$ Feb 17, 2022 at 8:56

Three of the five numbers in the set $$S = \{1, 2, 3, 4, 5\}$$ are prime numbers. Therefore, any three-digit number formed using three distinct digits of the set will contain at least one prime number. Thus, the number of three-digit numbers which contain at least one prime number in the three digits is $$5 \cdot 4 \cdot 3 = 60$$

Note: Be careful of choosing a representative of a set, then selecting additional elements from the remaining numbers of the set. This leads to multiple counting.

You chose one of the three prime numbers as a representative of the set. As Henry pointed out in the comments, you did not choose its position. There are three ways to do so. If you then multiply by the $$P(4, 2) = 4 \cdot 3$$ ways of filling in the remaining numbers, you would get $$3 \cdot 3 \cdot 4 \cdot 3 = 108$$ which is more than the total number of three-digit numbers with distinct digits which can be formed using the numbers in set $$S$$.

As pointed out above, it is not possible to form a number which does not contain at least one prime.

Exactly one prime appears among the three distinct digits: There are three ways to select one of the three prime numbers in the set $$S$$. There is one way to select both of the nonprime numbers in the set $$S$$. There are $$3!$$ ways to permute the three distinct digits. Hence, there are $$\binom{3}{1}\binom{2}{2}3!$$ such numbers.

Exactly two primes appear among the three distinct digits: There are $$\binom{3}{2}$$ ways to select two of the three primes in the set $$S$$, two ways to select one of the two nonprimes in the set $$S$$, and $$3!$$ ways to permute the three distinct digits. Hence, there are $$\binom{3}{2}\binom{2}{1}3!$$ such numbers.

Exactly three primes appear among the three distinct digits: There is one way to select all three primes and $$3!$$ ways to permute the digits. Hence, there are $$\binom{3}{3}\binom{2}{0}3!$$ such numbers.

Total: Since the three cases are mutually exclusive and exhaustive, there are $$\binom{3}{1}\binom{2}{2}3! + \binom{3}{2}\binom{2}{1}3! + \binom{3}{3}\binom{2}{0}3! = 60$$ three-digit numbers which can be formed by using three distinct digits of the set $$S = \{1, 2, 3, 4, 5\}$$ which contain at least one prime.

Had you remembered to take the position of your designated prime into account, you would have counted each number with two primes twice, once for each way of designating one of the two primes as the prime number among its digits, and each number with three primes three times, once for each way of designating one of the three digits as the prime digit. Note that $$\binom{3}{1}\binom{2}{2}3! + \color{red}{\binom{2}{1}}\binom{3}{2}\binom{2}{1}3! + \color{red}{\binom{3}{1}}\binom{3}{3}\binom{2}{0}3! = \color{red}{108}$$