# Counting - Combinations of $4$ digit numbers and their sums.

We form all possible $4$-digit numbers using $1,2,3,4,5$.

1. How many such numbers are possible?
2. What is the sum of all these 4-digit numbers?
3. How do the answers change if we use $1,1,2,3,4$ instead.

My try:

1. $5$ choices for each position. Therefore $5\cdot5\cdot5\cdot5= 625$

2. $4$ choices as $1$ is repeated $2$ times. Therefore $4\cdot4\cdot4\cdot4 = 256$.

I am stuck on part (2). I have no idea about it.

• I believe you misinterpreted the question. The third part of the question suggests that the listed digits are to be used without repetition. – N. F. Taussig Feb 18 '16 at 12:07

I believe you have misinterpreted the question. The third part of the question suggests that the listed digits are to be used without repetition. With that interpretation in mind, let's proceed.

How many four digit numbers can be formed using the digits $1, 2, 3, 4, 5$?

To form a four-digit number, we select four of the five digits, then place them in order, which can be done in $$\binom{5}{4} \cdot 4! = 5 \cdot 4 = 120$$ ways.

What is the sum of these $4$-digit numbers?

By symmetry, each of the five digits is used in each position $$\frac{120}{5} = 24$$ times. Hence, the sum is $$24(1 + 2 + 3 + 4 + 5)(10^3 + 10^2 + 10^1 + 10^0) = 24 \cdot 15 \cdot 1111 = 399 960$$

How do the answers change if we use $1, 1, 2, 3, 4$?

There are two possibilities.

1. There are four distinct digits.
2. The digit $1$ is used twice.

There are $4! = 24$ ways of arranging the four distinct digits $1, 2, 3, 4$.

If the digit $1$ is used twice, we must select two of the four positions to be occupied by a $1$. We then have three choices for the leftmost open position and two choices for the remaining position. Hence, the number of four-digit numbers that can be formed using the digits $1, 1, 2, 3, 4$ if the digit $1$ is repeated is $$\binom{4}{2} \cdot 3 \cdot 2 = 6 \cdot 3 \cdot 2 = 36$$ Hence, the number of four-digit numbers that can be formed using the digits $1, 1, 2, 3, 4$ is $$4! + \binom{4}{2} \cdot 3 \cdot 2 = 24 + 36 = 60$$

To determine the sum of these $60$ numbers, we consider cases.

Four distinct digits are used: By symmetry, each of the four digits $1, 2, 3, 4$ is used in each position $$\frac{4!}{4} = \frac{24}{4} = 6$$ times. Hence, the sum of the four-digit numbers formed with the four distinct digits $1, 2, 3, 4$ is $$6(1 + 2 + 3 + 4)(10^3 + 10^2 + 10^1 + 10^0) = 6 \cdot 10 \cdot 1111 = 66660$$ In each of the $36$ four-digit numbers formed with the digits $1, 1, 2, 3, 4$ in which the digit $1$ is used twice, half of the digits used are $1$'s. By symmetry, the digit $1$ must appear $$\frac{36}{2} = 18$$ times in each position. By symmetry, the digits $2, 3, 4$ must appear $$\frac{18}{3} = 6$$ times in each position. Thus, the sum of the four-digit numbers formed using the digits $1, 1, 2, 3, 4$ in which $1$ appears twice is \begin{align*} 18(10^3 & + 10^2 + 10^1 + 10^0) + 6(2 + 3 + 4)(10^3 + 10^2 + 10^1 + 10^0)\\ & = 18 \cdot 1111 + 6 \cdot 9 \cdot 1111\\ & = 18 \cdot 1111 + 54 \cdot 1111\\ & = 72 \cdot 1111\\ & = 79992 \end{align*} Since the two cases are mutually exclusive, the sum of all the four-digit numbers that can be formed using the digits $1, 1, 2, 3, 4$ is $$66660 + 79992 = 146652$$

• Yes, this is a valid point. +1 – Jimmy R. Feb 18 '16 at 12:39

Assuming that repetition of digits is allowed (although the formulation of question 3. suggests the contrary, see other answer), you correctly found that there are $625$ 4-digit numbers with the digits $1,2,3,4,5$. These numbers are of the form $$10^3d_{k,3}+10^2d_{k,2}+10^1d_{k,1}+10^0d_{k,0}$$ with $k=1,2,\dots625$ and therefore their sum is equal to $$\sum_{k=1}^{625}\left(10^3d_{k,3}+10^2d_{k,2}+10^1d_{k,1}+10^0d_{k,0}\right)=\sum_{j=0}^{3}10^j\sum_{k=1}^{625}d_{k,j}$$ Now, due to symmetry each digit is used in each position exactly as frequently as any other number, i.e. $625/5=125$ times, giving that $$\sum_{k=1}^{625}d_{k,j}=125(1+2+3+4+5)=125(15)=1875$$ for any $j=0,1,2,3$. Hence \begin{align}\sum_{j=0}^{3}10^j\sum_{k=1}^{625}d_{k,j}&=\sum_{j=0}^{3}10^j\cdot1875=\left(10^3+10^2+10^1+10^0\right)\cdot1875=2083125\end{align} You need to this also for question 3. where you need simply to change $5$ to $1$. Your answer $(256)$ in the first part of 3. is also correct.

• How can it be only 7500? – max Feb 18 '16 at 10:59
• I calculated the sum of the digits, not the sum of the numbers, but this is not the question. Sorry, let me correct this. – Jimmy R. Feb 18 '16 at 11:00
• @max Sorry for the confusion before. Does it make sense now? – Jimmy R. Feb 18 '16 at 11:10
• I believe you misinterpreted the question. The third part of the question suggests that the listed digits are to be used without repetition. – N. F. Taussig Feb 18 '16 at 12:07
• I suggest that you add a statement at the beginning of your answer stating that you interpreted the question to mean that digits could be repeated. – N. F. Taussig Feb 18 '16 at 12:41