# Math Help - Permutation Help!

1. ## Permutation Help!

Problem:
---------
There are 120 five-digit numbers that can be formed by permuting the digits 1,2,3,4 and 5 (for example, 12345, 13254, 52431). What is the sum of all of these numbers?

--------
399 960

I can't get this question...I don't know what to do...
All I think of doing is 120P5 = 2.29 x 10^10 .... but that's wrong

2. I hope that I am wrong. How about that?
But I think that this is really a programming question as opposed to a mathematical problem.

I really don’t see it as otherwise. But number theory is my weakness.

3. Ah, this is a very nice problem, and there is an elegant solution.

For each permutation, there is another one that can be added to it so that the sum equals 66666.
Examples: For 12345, there exists exactly one other permutation that sums with it to 66666, and that is 54321.
For 13245 it is 53421, for 34251 it is 32415.

I don't have a formal proof for this, but after some consideration it does seem very intuitively correct.

Therefore, since we have sixty pairs of these permutations, the sum is 66666*60 = 399960.

4. Originally Posted by DivideBy0
Ah, this is a very nice problem, and there is an elegant solution.

For each permutation, there is another one that can be added to it so that the sum equals 66666.
Examples: For 12345, there exists exactly one other permutation that sums with it to 66666, and that is 54321.
For 13245 it is 53421, for 34251 it is 32415.

I don't have a formal proof for this, but after some consideration it does seem very intuitively correct.

Therefore, since we have sixty pairs of these permutations, the sum is 66666*60 = 399960.
I think I get your 66666 theory...but I don't get how you get the number 60 to multiply with?

5. Originally Posted by Macleef
I think I get your 66666 theory...but I don't get how you get the number 60 to multiply with?
There are 120 permutations so there are 60 pairs of summing permutations if each permutation goes with exactly one other.

(12345 + 54321) = 66666,
(12354 + 54312) = 66666,
(12534 + 54132) = 66666,
...
...
...
60 times

I'm quite surprised I found this, I usually miss this kind of stuff.

6. Hello, Macleef

There's no quick formula for this.

There are 120 five-digit numbers that can be formed by permuting
. . the digits 1,2,3,4 and 5. .(Examples: 12345, 13254, 52431).
What is the sum of all of these numbers?

Imagine listing the 120 permutations . . .

. . $\begin{array}{c}12345 \\ 12354 \\ 12435 \\ 12453 \\ \vdots \\ 54321\end{array}$

We will find that, in each column, the 1 appears $\frac{1}{5}$ of the time: 24 times,
. . the 2 appears 24 times,
. . the 3 appears 24 times, etc.

So each column adds up to: . $24(1 + 2 + 3 + 4 + 5) \:=\:360$

. . $\begin{array}{c}\qquad\qquad360 \\ \qquad\quad360 \\ \qquad360 \\ \quad360 \\ 360\\ \quad---- \\ \quad399960 \end{array}$