1
$\begingroup$

I am working on a problem that involves the following:

One must find three numbers, integers and/or decimals, that multiply to ten.

Here's the catch:

You must use all integers, $0-9$, in the answer! So $1\times 2\times 5$ does not work.

I do not want the answer.

Instead, I ask if anyone has any ideas to which I can get as close to 10 as possible. The hint in the problem is that you cannot get to ten exactly, but close to it.

Right now, I have $1\times 2\times 5.0346789 = 10.0...$ Again, I do not want the answer, only a mathematical way to get to the answer. I cannot determine why I would be assigned this problem if it had no relation to mathematics.

Decimals ($\rm0.xxx$) count as use of the $0$, and you can place the zero at the end ($\rm x.xxx0$), too

  • 0
    I don't think there's anything better than brute-force: trying all ways of assigning the digits 0-9 to three sets and permutations within the sets. (Essentially, trying all permutations of: the ten digits 0-9, two *s, and up to three .s.) (Of course, once you fix two, the third can be determined easily, but beyond that...)2011-10-16
  • 0
    Shreevatsa, do you have any idea how much work that could be?2011-10-16
  • 1
    @GerryMyerson: Yes. A rough upper bound is $10!$ (permutations of the digits) $\times$ $9 \choose 2$ (where to place the dividers to split them into three), which is less than 200 million (multiplied by some constant amount of work to place the decimal points, and all that)... should be easily doable on any decent computer. (In case your question was rhetorical: I wasn't even considering doing it by hand, and that was the point of my previous comment. I don't see how you can solve "get *as close to 10 as possible*", at least for general n instead of 10, without brute force / computer help.)2011-10-16
  • 1
    Are exponentials (as in, say, $3^{456}$) allowed as one of the numbers?2011-10-16
  • 0
    @GerryMyerson: For instance, I don't think that it is easy, by hand, to arrive at solutions like $0.274 \times 5.983 \times 6.1 \approx 9.9999862$ or $0.26 \times 5.38 \times 7.149 \approx 10.0000212$ (neither of which is optimal BTW, because the OP doesn't want the answer).2011-10-16

2 Answers 2

3

You could try programming a search that factors integers that are close to powers of $10$, and then examines the factors for their digits.

For example, $100002$ factors as $2\times3\times7\times2381$. Searching through possible triples of divisors, $6\times7\times 2381$ has unique digits (but is missing $4$, $5$, and $9$). If all digits were accounted for, this would lead to to $10.002=6\times7\times0.02381$.

(I'm not sure from your post if you are allowed to repeat digits, like how $0$ is repeated in this example.)

The search parameters would be which powers of $10$ you would examine, and also constraints on how far away from that power of $10$ you would roam. If digits aren't supposed to be repeated, I think $10^a$ with $a$ in $\left\{9,10,11\right\}$ would be appropriate. (And at this level, factoring shouldn't take the program too long.)

  • 0
    Very good answer! The only problem I am having is that I don't really understand how to factor in a programming language. I know many (C, C++, Java, Python - don't like it) but I really cannot find any material that gives me information on factoring in a program. Also, the numbers cannot be repeated :(2011-10-16
  • 0
    @nmagerko: the simple approach to factoring is to have a list of primes (http://en.wikipedia.org/wiki/Prime_number_sieve has some info) then do trial division. As you are only interested in numbers up to $10^{10}$ you only need to divide by primes up to $10^5$. There aren't that many-9592, so it will run quickly.2011-10-16
  • 0
    I found it! By rearranging the numbers in the example problem, I found the answer... too bad @ShreevatsaR put the answer on here EVEN THOUGH I ASKED EVERYONE NOT TO. Found it about ten days ago though; thanks for your help Ross and Alex2011-10-31
2

So, you've started with $1\times2\times5$, and you've varied the 5 a little bit. Maybe you could try varying two of the three numbers, or all three of them.

  • 0
    I have tried this, but it seems like the numbers only get larger from the variations of these numbers. I feel like I'm just missing something simple2011-10-16
  • 3
    If you vary the 2 up a bit, and the 5 down a bit, you can certainly do better than the 10.069... that you currently have.2011-10-16
  • 0
    1*2.053*4.8796 is what I have so far, and I think I am getting the hang of it, but do I still have to vary more to get what you are at?2011-10-16