[Math] Find the sum of all 4 digit numbers which are formed by the digits 1,2,5,6

permutations

I have researched and found 2 approaches but haven't understood both.Can anyone explain it clearly or probably with any real world example?

Approach 1

Four digit numbers $ = 4 \cdot 3 \cdot 2 \cdot 1 = 24$ ways we can form a four digit number. Since it's a 4 digit number, each digit will appear $6= 24/4$ times in each of units, tens, hundreds, and thousands place. Therefore, the sum of digits in the units place is $6(1+2+5+6)=84$.

Why they are adding $1+2+5+6$?

Similarly sum of digits at tens,hundreds,thousands place is $84$

Required sum of all numbers $= 84+ 84 \cdot 10+ 84 \cdot 100+ 84 \cdot 1000=93324$

Approach 2

I found it here:

Find the sum of all 4-digit numbers formed by using digits 0, 2, 3, 5 and 8?

Though I have understood the 2 approaches, I am not able to understand the question.

Best Answer

In this answer I presume that all digits $1,2,5,6$ must be present in the number.

There are $4!=24$ such numbers.

We can index them with $i=1,\dots,24$ and write each of them as $$n_{i}=a_{i}+10b_{i}+100c_{i}+1000d_{i}$$ where $\left\{ a_{i},b_{i},c_{i},d_{i}\right\}=\{1,2,5,6\} $

Then $$\sum_{i=1}^{24}n_{i}=\sum_{i=1}^{24}a_{i}+10\sum_{i=1}^{24}b_{i}+100\sum_{i=1}^{24}c_{i}+1000\sum_{i=1}^{24}d_{i}$$

$\left\{ i\mid a_{i}=1\right\} $, $\left\{ i\mid a_{i}=2\right\} $, $\left\{ i\mid a_{i}=5\right\} $ and $\left\{ i\mid a_{i}=6\right\} $ have equal cardinality $\frac{24}4=6$ so: $$\sum_{i=1}^{24}a_{i}=6.1+6.2+6.5+6.6=6(1+2+5+6)=84$$

This can also be applied for $b,c$ and $d$ and finally we find: $$\sum_{i=1}^{24}n_{i}=84+10.84+100.84+1000.84=1111.84=93324$$

Does this really answers your question? If not, then please let me know.