[Math] Find the sum of all 4-digit numbers formed by using the digits 1, 2, 3, 4, 5

permutations

…and where no digit is to be repeated in any 4-digit number.

Yes, I am aware of similar questions on this site, but none of the answers gave me insight as to how this works.

I would like an answer in ridiculously simple terms, like explaining it to a 5 year old.

One answer:

Total numbers formed using those 5 digits is 5P4. i.e. 120 numbers.

Since all digits will equally occupy the unit's place, therefore 1
will occur 24 times in unit's place. Similarly 2 will occur 24 times
in unit's place. So on and so forth. Therefore sum of all digits in
unit's place will be equal to 24 x (1+2+3+4+5)=24 x 15.

Similarly sum of all digits in ten's place will be equal to 24 x 150.

Therefore total sum of all numbers =24 x (15+150+1500+15000)=399960 .

Why is there the sum (1 + 2 + 3 + 4 + 5)? Am I misreading the question? Does "no digit is to be repeated in any 4-digit number" mean that there shouldn't be a number like 4432, or does it mean that a number should not be repeated in the same "unit slot"?

Best Answer

Your answer is trying to say that when you write out all 120 numbers, it will look something like this:

1234

1235

...

2134

2135

...

5123

5124

There will be 24 ones in the thousands place, 24 twos in the thousands place, etc. This is because once we set a certain number in the thousands place (e.g. one), then we have 24 distinct four digit numbers.

So we calculate the sum of the 120 valid 4 digit numbers by first looking at the sum of the digits in the thousands place. This sum is $$1000 * 24 * 1 + 1000 * 24 * 2 + 1000 * 24 * 3 + 1000 * 24 * 4 + 1000 * 24 * 5$$

The 1000 comes from looking at the sum of the digits in the thousands' place. The solution you provided factored this result as $1000 * 24 * (1+2+3+4+5)$.

Now that we've calculated the sum of the digits in the thousands' place, we can do the same for the hundreds' place, tens' place, and ones' place similarly:

Hundreds' Place: $100 * 24 * (1+2+3+4+5)$

Tens' Place: $10 * 24 * (1+2+3+4+5)$

Ones' Place: $1 * 24 * (1+2+3+4+5)$

Adding these values together, we get the answer, which is 399960.