4
$\begingroup$

Given numbers 1,2,...n, the goal of this puzzle is to make a number as close to the mathematical constant $\ln(2) ≈ 0.69314718055$ as possible.


Rules

  • You can only use the four mathematical operations $+,-,\times,/$ and parentheses/brackets $()[]$.
  • It is not required to use all of the numbers.
  • You cannot concatenate (stick) the numbers together. (i.e. you can't get $12$ from $1,2$)

Examples:

$n$ Approximation Error
1 1 $3.068\cdot10^{-1}$
2 $\frac12=0.5$ $1.931\cdot10^{-1}$
3 $\frac23=0.\overline6$ $2.6481\cdot10^{-2}$
7 $\frac7{6+4+(1/(3\times2+5))}=\frac{77}{111}=0.\overline{693}$ $5.4651\cdot10^{-4}$
8 $\frac7{6+4+(2/(3\times8+1-5))}=\frac{70}{101}=0.\overline{6930}$ $7.7873\cdot10^{-5}$

Give your best approximation for n=1, 2, 3...20. (Give a possibly different answer for each n)


If anyone is curious I am currently only aware of optimal solutions for $n=1,2...8$.


Related
Related

$\endgroup$
6
  • 1
    $\begingroup$ Are we allowed to use decimal points? Like .5, .2, etc. Also can we put a minus sign (-) in front of a number to change its sign? $\endgroup$ Mar 13 at 5:32
  • 1
    $\begingroup$ Some discoveries for n = 9: [(7*8)+(9*1)-4]/[6*5*3-2] = 61/88 = 0.693(18) which gives an error of: 3.4637621872946056E-5 [2*9*7+(5*1)]/[6*8*4-3] = 131/189 = 0.(693121) which gives an error of: 2.54874382521475E-5 $\endgroup$ Mar 13 at 6:51
  • 1
    $\begingroup$ A new one for n=9: (1*2*4*8)/(5*6*9+7) = 192/277 = 0.(693140794223826714801444043321299638989169675090252707581227436823104) giving an error of 6.386336118602287E-6 The only possible better solution now would be to achieve 253/365, which I am attempting now $\endgroup$ Mar 13 at 7:18
  • $\begingroup$ Clarification: for any k in [1..n], each possible value of k can be used only once? $\endgroup$ Mar 13 at 10:35
  • $\begingroup$ @TLEontest77 No, decimal points have never been allowed in these math puzzles $\endgroup$
    – CrSb0001
    Mar 13 at 12:16

1 Answer 1

2
$\begingroup$

An approach (hinted at by @michaelmoschella in the comments) is to use the fraction approximation algorithm [insert citation].

Something like this: table

Here we start with 0/1, 1/1, and 1/0 ($=\infty$). Then we look which side our target number is in (left or right). Those numbers become the new boundaries, and the new middle numerator (denominator) is the sum of the new outer numerators (denominators).

I've highlighted the "best" rows, which tend to be the last best so far (so when it's the best so far, but the next row is not).

See here for the calcs.

So, for example, going after 445/642 is a reasonably fruitful exercise (7.63E-7).

$445 = (9\times10-1)\times5$

$642 = (11\times10-3)\times6$

Oh, but whoops, I've repeated the 10. But I could replace that we $(8+2)$.

So I get ($n=11$): $\frac{(9\times10-1)\times5}{(11\times(8+2)-3)\times6}$

I doubt it's the best, but it's a start.

Of course, the above is great for fractions, but we're here allowed to do more than that, so there may also be better approaches altogether.

You can also see $\frac{4+3}{2*5}$ for $n=5$ has an error of 6.85E-3.

$\endgroup$
1
  • $\begingroup$ You realize that it's only recommended to give a different answer for each n (e.g. n=3 can have the same sol. as n=4, as 2/3 is optimal for both) $\endgroup$
    – CrSb0001
    Mar 14 at 12:45

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.