# Maximum Result with Digits

You have digits from $$0$$ to $$9$$, where you need to use every digit only once, and you have only one operator (multiplication, $$*$$). You may combine/join digits to create a bigger number as shown below:

$$5,673*984,210=5,583,423,330$$

So

What is the highest result you can get?

• Is it allowed to use operator * more then once? – z100 Dec 8 '16 at 22:48

This is not really an independent answer; just an explanation of why the answer given by Levieux is optimal. (Of course it's easy to check by computer, but you might prefer to have a more human-comprehensible explanation.)

First of all, obviously each number's digits must be in descending order because if not, reordering one number's digits to be in descending order increases that number while leaving the other unchanged.

Next, write the two numbers one above the other with most significant digits aligned. (Pad with zeros if you need to.) Then apart from the first digit, the smaller number's digits must be larger than the corresponding digits of the larger number because otherwise swapping two digits for which this isn't true increases the product. (Because if $$\delta$$ is the difference between the digits taking place value into account, then we are replacing $$ab$$ with $$(a-\delta)(b+\delta)=ab+\delta(a-b-\delta)=ab+\delta(a'-b')$$ where $$a',b'$$ are the new numbers, and we still have $$a'>b'$$.)

So we have a situation like this:

$$\begin{array} \\ 9 & \rightarrow & \bullet & \rightarrow & \bullet & \rightarrow & \bullet & \rightarrow & \bullet \\ \downarrow & & \uparrow & & \uparrow & & \uparrow & & \uparrow \\ \bullet & \rightarrow & \bullet & \rightarrow & \bullet & \rightarrow & \bullet & \rightarrow & \bullet \end{array}$$

where arrows mean $$\geqslant$$ and you should think of the pattern continuing indefinitely to the right where there are infinitely many zeros.

But we could take this diagram and shift the lower number left one place, making it the larger number, and then all but the leftmost vertical arrow would reverse. (Because we would still have a maximal product, so the reasoning above applies "with roles reversed".) In other words, we actually have this (again, continuing infinitely to the right, or at least until whichever number is longer runs out):

$$\begin{array} \\ 9 & \rightarrow & \bullet & \rightarrow & \bullet & \rightarrow & \bullet & \rightarrow & \bullet \\ \downarrow & & \uparrow & \searrow & \uparrow & \searrow & \uparrow & \searrow & \uparrow \\ \bullet & \rightarrow & \bullet & \rightarrow & \bullet & \rightarrow & \bullet & \rightarrow & \bullet \end{array}$$

and now I want to draw attention to the fact that we have a chain connecting all the digits:

$$\begin{array} \\ 9 & & \bullet & & \bullet & & \bullet & & \bullet \\ \downarrow & & \uparrow & \searrow & \uparrow & \searrow & \uparrow & \searrow & \uparrow \\ \bullet & \rightarrow & \bullet & & \bullet & & \bullet & & \bullet \end{array}$$

and therefore only one way to fill them in, which is the one in Levieux's answer.

[EDITED because @mathreshka kindly pointed out a small error, which I have now fixed. Thanks!]

• this is the answer i was looking for. Thanks for detailed explanation. – Oray Dec 8 '16 at 21:43
• Nice, great explanation! I was trying to write down some kind of proof/explanation, but didn't really know where to start. – Levieux Dec 8 '16 at 21:50
• This is excellent, but leaves out one detail; you have not shown that the two numbers should be 5 digits each. – frodoskywalker Dec 8 '16 at 23:12
• @frodoskywalker: Levieux's answer provides a counterexample to your claim that they have to each be 5 digits. – Ben Voigt Dec 8 '16 at 23:13
• Right. You can move the 0 from one to the other. But what it does show is that the numbers have to be 9642 and 87531 with a zero on the end of one of them. – Gareth McCaughan Dec 9 '16 at 0:15

$96,420 * 87,531 = 8,439,739,020$
$9,642 * 875,310 = 8,439,739,020$ as well