How many $10$-digit numbers (allowing initial digit to be zero) in which only $5$ of the $10$ possible digits are represented?

204 Views Asked by At

The answer I found was $$(5^{10}-|\text{only}~4~\text{digits}|-|\text{only}~ 3|-|\text{only}~ 2|-|\text{only}~1|) \cdot C(10,5)=$$ where

$|\text{only}~1~\text{digit}| = 1^{10} \cdot C(10,1)$

$|\text{only}~2| = (2^{10}-|\text{only}~1|) \cdot C(10,2)$

$|\text{only}~3| = (3^{10}-|\text{only}~2|-|\text{only}~1|) \cdot C(10,3)$ ...etc

$5^{10}$ is supposed to represent the number of $10$ digit numbers which only use $5$ or fewer of $10$ distinct digits, just as there are $2^{10}$ binary strings of length $10$. I am subtracting from $5^{10}$ the number of strings which only contain $4$ distinct digits, $3$ distinct digits, $2$ distinct digits, and $1$ distinct digit, so I get the number of strings that use exactly $5$ distinct digits. I multiply by $C(10,5)$ because there are $C(10,5)$ ways to choose $5$ distinct digits. $|\text{only}~ 1|$ means the number of strings of length $10$ with exactly $1$ distinct digit.

For some reason I am not getting the right answer. Can someone tell me what I am doing wrong and post the correct answer please?

2

There are 2 best solutions below

0
On

Your $C(10,5)$ chooses which five digits will be used. When you want to select the strings that use only one digit, you only want to subtract the ones that use one of these five digits, so it should be $C(5,1)$

0
On

In what follows, I will address the following question (which appears to be the intended one):

In how many $10$-digit strings are exactly five of the ten possible digits represented?

There are $\binom{10}{5}$ ways to select which five digits are included in the string and $5$ choices for each of the ten positions in the string, which gives $$\binom{10}{5}5^{10}$$ strings that may be formed using five digits. From these, we must subtract those strings which use fewer than five of those digits.

There are $\binom{5}{1}$ ways to exclude one of those five-digits from the string and $4$ ways to fill each of the ten positions in the string with the remaining digits. Hence, of the $5^{10}$ strings that can be formed with the particular set of five digits we have chosen, $\binom{5}{1}4^{10}$ exclude one of those digits. This gives us a running count of $$\binom{10}{5}\left[5^{10} - \binom{5}{1}4^{10}\right]$$

However, we have subtracted too much since we have subtracted each string from which two of the five digits are missing twice, once for each way we could have designated one of those digits as missing. Thus, we must add them back.

There are $\binom{5}{2}$ ways to exclude two of the five selected digits and $3$ ways to fill each of the ten positions in the string with the remaining digits. Hence, of the $5^{10}$ strings that can be formed with the particular set of five digits we have chosen, $\binom{5}{2}3^{10}$ exclude two of those digits. This gives us a running count of $$\binom{10}{5}\left[5^{10} - \binom{5}{1}4^{10} + \binom{5}{2}3^{10}\right]$$

However, now we have added too much since we have not excluded strings in which three of the five selected digits are excluded. This is because we subtracted such strings three times, once for each way we could have designated one of the digits as the missing digit, and added them three times, once for each of the $\binom{3}{2}$ ways we could have designated two of the digits as the missing digits. Thus, we must subtract those strings in which three of the digits are missing.

There are $\binom{5}{3}$ ways to exclude three of the five selected digits and $2$ ways to fill each of the ten positions in the string with the remaining digits. Hence, of the $5^{10}$ strings that can be formed with the particular set of five digits we have chosen, $\binom{5}{3}2^{10}$ exclude three of those digits. This gives us a running count of $$\binom{10}{5}\left[5^{10} - \binom{5}{1}4^{10} + \binom{5}{2}3^{10} - \binom{5}{3}2^{10}\right]$$

However, we have subtracted too much. We subtracted strings from which four of the five selected digits are excluded four times, once for each of the four ways we could have designated one of the missing digits as the missing digit; then added them six times, once for each of the $\binom{4}{2}$ ways we could have designated two of the missing digits as the missing digit; then subtracted them four more times, once for each of the $\binom{4}{3}$ ways we could have designated three of the missing digits as the missing digits. Therefore, we have excluded strings from which four of the selected digits are missing twice. However, we only want to exclude them once, so we must add them back.

There are $\binom{5}{4}$ ways to exclude four of the five selected digits and $1$ way to fill each of the ten positions in the string with the remaining digit. Hence, of the $5^{10}$ strings that can be formed with the five digits we have chosen, $\binom{5}{4}1^{10}$ exclude four of those digits. This gives us a running count of $$\binom{10}{5}\left[5^{10} - \binom{5}{1}4^{10} + \binom{5}{2}3^{10} - \binom{5}{3}2^{10} + \binom{5}{4}1^{10}\right]$$

Since it is not possible to form a string if we exclude all five of the selected digits, the number of $10$-digit strings in which exactly five of the ten possible digits are represented is $$\binom{10}{5}\left[5^{10} - \binom{5}{1}4^{10} + \binom{5}{2}3^{10} - \binom{5}{3}2^{10} + \binom{5}{4}1^{10}\right]$$ This argument is based on the Inclusion-Exclusion Principle.