This is a famous problem from 1882, to which a prize of $1000 was awarded for the best solution.
The task is to arrange the seven numbers 4, 5, 6, 7, 8, 9, and 0, and eight dots, in such a way that an addition of two or more numbers approximates 82 as closely as possible.
Each of the numbers can be used only once.
The dots can be used in two ways: as decimal point and as symbol for a recurring decimal.
For example, the fraction 1/3 can be written as:
.
. 3
The dot on top of the three denotes that this digit is repeated infinitely. If a group of numbers needs to be repeated, two dots are used: one to denote the beginning of the recurring part and one to denote the end of it. For example, the fraction 1/7 can be written as:
. .
. 1 4 2 8 5 7
(Note that '0.5' is written as '.5'.)
How close can you get to the number 82?
(In reply to
even closer... by Tristan)
"I bet Charlie could write a program for this. "
Believe me, I've thought about it. But the 32,432,400 distinct permutations of 7 distinct digits and 8 dots gives one pause, especially considering that one has to throw in a few +'s as well.
Just considering the permutations of 7 different digits, 8 dots and 3 +signs gives 26,464,838,400 possibilities. Although some may be nonsensical, such as two plus signs in a row, or a repetition dot other than just before a +, there's also the possibility of just two +'s, or of four +'s.
But if anyone can think of an algorithm that could work this out in reasonable time, I'd be interested.

Posted by Charlie
on 20031224 16:17:47 