68
$\begingroup$

There have been two other questions here and here that are similar to this one, but this changes the rules up a little.

Your job is to approximate $\pi$ using the sequence of digits (in order):

1 2 3 4 5 6 7 8 9

with operators inserted between them (permitted operators listed below). You are to find the best approximation to $\pi$ that you can using the allowed operators and the numbers listed in order as they appear above. You must use all nine digits.

Your score is given by $$ \frac{-\ln\left|1-A/\pi\right|}{n_{ops}} = \frac{\ln\left|\frac{\pi}{\pi-A}\right|}{n_{ops}} $$ where $n_{ops}$ is the number of operators you used, and $A$ is your approximation. So if you managed to get $A=22/7$ and required three operations, then we have $\ln\left|1-A/\pi\right|\approx−7.818$, and so your score would be approximately $2.606$. Larger scores are better.

You may use parentheses, but only to control order of operations - other uses such as binomials or Jacobi symbols are not valid.

Permitted operations:

  • $+$ (plus): standard addition of real or complex numbers.
  • $-$ (minus): standard subtraction of real or complex numbers, or unary negation of real or complex numbers.
  • $\times$ (times): standard multiplication of real or complex numbers. Implied multiplication (e.g. $(1+2)3$) counts as an operation.
  • $/$ or $\div$ (divide): standard division of real or complex numbers (allows division by positive or negative infinity to get zero).
  • $\sqrt{ }$ (square root): standard principle square root of real or complex numbers, with second root (negative if number being square rooted is positive) allowed as $\sqrt[-]{}$ as a single operation.
  • $!$ (factorial): standard factorial for non-negative integer values (i.e. natural numbers) only, cannot be applied to non-natural numbers.
  • $|.|$ (absolute value): standard absolute value for real or complex numbers, equal to $\sqrt{a^2+b^2}$ if the number is of the form $a+bi$ with $a$ and $b$ real and $i$ being the imaginary number.
  • $\lfloor.\rfloor$ (floor): standard round-downwards to integer for real numbers only.
  • $\lceil.\rceil$ (ceil): standard round-upwards to integer for real numbers only.

Permitted operations but counting as three operations:

  • $^\wedge$ (exponentiation): standard exponentiation of real and complex numbers with integer powers only. Note that $0^0$ cannot be used.
  • $\ln(.)$ (natural log): standard natural logarithm of positive real numbers only.

Note the restrictions on some operators - This is primarily to ensure that exact values of $\pi$ cannot be obtained, as well as ensuring that the operations are well-defined.

If you feel that a reasonable operation has been left out, mention it in the comments and I may add it.

Note: There must be at least 1 operation in your answer!

I will also upvote people who obtain high accuracy using many operations, in addition to those who get a good score, and encourage others to do likewise.

I'm also going to keep track of the best answers for each number of operations, up to 10.

$$\begin{matrix} \underline{\text{Operations}} & \underline{\text{Score}} & \underline{\text{User}}\\ 1 & 0.864669301 & \text{pacoverflow}\\ 2 & 1.272568270 & \text{pacoverflow}\\ 3 & 1.501203245 & \text{Ben Frankel}\\ 4 & 2.254197410 & \text{Ben Frankel}\\ 5 & 2.286460415 & \text{Lynn}\\ 6 & 2.713605107 & \text{Lynn}\\ 7 & 2.151734961 & \text{Lynn}\\ 8 & 2.135316968 & \text{Ben Frankel}\\ 9 & 2.063009554 & \text{Ben Frankel}\\ 10 & 2.186087400 & \text{Glen O} \end{matrix}$$ Let me know if I've missed one.

$\endgroup$
  • 7
    $\begingroup$ I think you should review your scoring algorithm. If I submit $A=123456789$ with no operations I get an infinite score. If that is not allowed, I could do $A=12^{3456789}$ and get a score a little over $2.86 \cdot 10^6$ $\endgroup$ – Ross Millikan Apr 17 '15 at 16:58
  • 1
    $\begingroup$ I felt free to add a condition to the problem: at least one operation is required! This is to prevent 0 operation from being the best answer. If you don't agree with my edit, simply remove that condition and I'll be happy as well. $\endgroup$ – leoll2 Apr 17 '15 at 17:51
  • 1
    $\begingroup$ @RossMillikan I think I can top that with A = 12^3^4^5^6^7^8^9 ;-) $\endgroup$ – Mark N Apr 17 '15 at 18:00
  • 7
    $\begingroup$ You definitely want $-\ln|\dots|$, not $|\ln|\dots||$. The latter bounces off the y axis and goes back up to infinity when you're really far off. $\endgroup$ – Lynn Apr 17 '15 at 19:28
  • 1
    $\begingroup$ @MarkN: Yes, I thought about that. I tried $12^{3^{456789}}$ but couldn't evaluate the score. $\endgroup$ – Ross Millikan Apr 17 '15 at 20:43

15 Answers 15

54
$\begingroup$

4 ops = 1.9934200404 points:

$1+2+34 \div \sqrt{56789} = 3.1426746469\dots$

Off by 0.00108199.

5 ops = 2.2864604146 points:

$\sqrt{12}-34\cdot \sqrt{56} \div 789 = 3.1416267073\dots$

Off by 0.0000340537.

6 ops = 2.7136051067 points:

$(1+(23+4+5)\div 678)\cdot\sqrt 9 = \frac{355}{113} = 3.14159292035 \dots$

Off by only 0.000000266764(!)

Now we can keep taking square roots of 1 in this expression to get a lower score bound for $n$ operations where $n \geq 6$, namely: $$s_n = -\ln \left( \frac{ 355/113 } \pi - 1 \right) / n$$

Which yields the results:

 7 ops = 2.3259472344 points
 8 ops = 2.0352038301 points
 9 ops = 1.8090700712 points
10 ops = 1.6281630641 points

Oh, and to demonstrate the restrictions in the OP -- if complex logarithms were allowed, I could write $$\ln(-1) \div \sqrt{\lfloor -2/3456789 \rfloor} = i\pi/i = \pi.$$

EDIT: for 7 ops, I found

$$\sqrt{\sqrt{123-\sqrt{4!+5678/9}}}=3.14159355670578 \dots$$

scoring 2.1517349612 points, beating Ben Frankel's score.

$\endgroup$
  • 1
    $\begingroup$ Very impressive, but isn't that actually closer to -200743.9379? $\endgroup$ – squeamish ossifrage Apr 17 '15 at 21:08
  • 1
    $\begingroup$ Err, I had a little typo there. Should be right now. $\endgroup$ – Lynn Apr 17 '15 at 21:15
  • 1
    $\begingroup$ Ah yes, that's better :-D $\endgroup$ – squeamish ossifrage Apr 17 '15 at 21:18
  • 2
    $\begingroup$ You're missing a zero in your "off by" number. It should be 0.000034... $\endgroup$ – GentlePurpleRain Apr 17 '15 at 21:25
  • 1
    $\begingroup$ I found a smaller error using 9 operations, thus passing your lower bound from 9 and on. I can use $n = |n|$ wherever to add operations. $\endgroup$ – Ben Frankel Apr 18 '15 at 22:11
19
$\begingroup$

I wrote a program that approximates an inputted value using inputted digits by checking increasingly complex expressions. These are the best results so far:


10: Score - 1.82589426:

$\sqrt{\sqrt{12\cdot\frac{\sqrt{34}-\sqrt{5}}{6}-7}+\sqrt{89}} \approx 3.141592691$

Accurate to 8 digits.


9: Score - 2.06300955:

$\sqrt{1+\sqrt{\sqrt{2}\cdot\frac{3}{45-\sqrt{6}}\cdot789}} \approx 3.141592626$

Accurate to 8 digits.


8: Score - 2.13531697:

$\sqrt{1+\frac{\sqrt{23}-\sqrt{4\cdot56}}{78}+9} \approx 3.141592773$

Accurate to 7 digits.


7: Score - 2.06840056:

$\sqrt{123\frac{\sqrt{\sqrt{4}+56-7}}{89}} \approx 3.1415943$

Accurate to 6 digits.


6: Score - 2.14803568:

$123\times(\sqrt{4}+\sqrt{5/67})/89 \approx 3.141585$

Accurate to 5 digits.


5: Score - 2.28646041:

$\sqrt{12}-34\cdot\frac{\sqrt{56}}{789} \approx 3.141627$

Accurate to 4 digits. (Mauris reached this first)


4: Score - 2.25419741:

$\sqrt{\frac{1234}{56+78-9}} \approx 3.141974$

Accurate to 4 digits.


3: Score - 1.50120325:

$\frac{1234}{567}-8+9 \approx 3.176367$

Accurate to 2 digits.


2: Score - 1.27256827:

$\frac{1}{2345}\cdot6789 \approx 2.895096$

Error of ~0.25. (pacoverflow reached this first)


1: Score - 0.86466930:

$\frac{12345}{6789} \approx 1.818383$

Error of ~1.3. (pacoverflow reached this first)

$\endgroup$
  • $\begingroup$ Your calculation seems to be backwards, in terms of score. The score is 0.651964286 (which is the inverse of the number you gave). I think your computer code might have had a bug in it. $\endgroup$ – Glen O Apr 18 '15 at 10:26
  • $\begingroup$ @GlenO, are you sure? I've tried a few times to recalculate the score of 3.17 with 3 ops but I get the same result. EDIT: Also if pacoverflow is off by 0.16 with 3 ops and he gets ~0.9 score then I am off by 0.035 so I shouldn't get ~0.65 score. $\endgroup$ – Ben Frankel Apr 18 '15 at 10:32
  • $\begingroup$ Oops, just noticed I used "log" on my PC's calculator, assuming it would be ln. It's log_10. So you're right. Sorry about that. $\endgroup$ – Glen O Apr 18 '15 at 10:37
  • $\begingroup$ +1, I was wondering if there was anything better for n=1,2,3. $\endgroup$ – pacoverflow Apr 18 '15 at 16:51
18
$\begingroup$

Score = 2,176,716,257 (That's not a typo)

I think you want to fix your scoring formula.

Here's my attempt:

123456789!

And here's the proof of my score:

Thank you, Wolfram Alpha
In the screenshot, note that $log$ denotes the natural log as explained on the right.
Screenshot

If you don't fix the formula, you run into a problem with infinite scores because...

Adding factorials makes $n_{ops}$ grow linearly but $A$ grow at a much faster rate.
My next guesses would all yield higher scores:
(123456789!)!
((123456789!)!)!
(((123456789!)!)!)!

$\endgroup$
16
$\begingroup$

This one isn't in order, but I can't resist offering it up anyway:

$\dfrac{\ln((8\times5!)^3+(2\times\sqrt{9})!+4!)}{\sqrt{7\times6+1}}$

14 ops, but off by just $4\times 10^{-14}$! The catch here is:

43 (which shows up in the denominator) is a so-called Heegner Number, so $e^{\pi\sqrt{43}}$ is very close to an integer - specifically, to $960^3+744$.

$\endgroup$
14
$\begingroup$

Score = 1.187987428

Here's my first effort, off by 0.00827 with 5 operators:

$$\sqrt{\sqrt{(1234 \times 56\ /\ 78)\ /\ 9}} = 3.14986$$

$\endgroup$
12
$\begingroup$

I figured I'd have a go at it myself. Here's an approximation I found:

$\sqrt{\sqrt{123+4-5\times6+\frac7{8+9}}} \approx 3.14161421087308 \approx \pi+0.000021557$

with 8 operations. Score = 1.486190839099123

UPDATE: here's a new one:

$\sqrt{\sqrt{\frac12+\frac{3!+4}{5+6}+7+89}}\approx 3.141592652582646 \approx \pi - 0.000000001007147$

with 10 operations. Score = 2.186087400111085. This one is based on an expression given by Ramanujan, $\pi\approx\sqrt[4]{\frac{2143}{22}}$.

$\endgroup$
  • 1
    $\begingroup$ That 10 operation one is extremely cool! $\endgroup$ – Lynn Apr 19 '15 at 16:43
  • $\begingroup$ Also, regarding Ramanujan's approximation, it can also be written like this: $$\large\pi\approx \sqrt{\sqrt{3^4+\frac{19^2}{78-56}}}$$ which uses all the digits from $1$ to $9$ too (but not in order). That is a special approximation :D $\endgroup$ – Mr Pie Sep 9 '18 at 9:02
10
$\begingroup$

Attempt with 4 operators: (Score = 0.978898573)

$$\sqrt{\sqrt{\sqrt{\sqrt{123456789}}}} = 3.20420$$ (off by 0.06261)

Attempt with 3 operators: (Score = 0.991181027)

(1+2345+6)/789 = 2.98098 (off by 0.16060)

Attempt with 2 operators: (Score = 1.272568270)

(1/2345)*6789 = 2.89509 (off by 0.24649)

Attempt with 1 operator: (Score = 0.864669301)

12345/6789 = 1.81838 (off by 1.32320)

$\endgroup$
5
$\begingroup$

If I understand the rules correctly, you can get arbitrarily large scores: We have a sequence $A_k$ where for each $k$, the number of operations is $42 + 5k$, and the limit of the score of $A_k$ is infinity as $k$ goes to infinity:

Let $x!_k$ represent $k$ iterations of the factorial, e.g. $3!_2 = (3!)!=6!= 720$. According to the rules of the puzzle, using $!_k$ requires $k$ operations. Then we have $$ \pi \approx A_k = \left[1 + 2 \times \left(- \log\lceil \sqrt{3!_k}\rceil + \lfloor\sqrt{\sqrt{4}}\rfloor\right)\div(\lfloor\sqrt{\lceil\sqrt 5\rceil!_k}\rfloor!)\right]^{\lceil\sqrt{\lceil\sqrt 6\rceil!_k} \rceil!} \times \lfloor\sqrt{\lceil\sqrt 7\rceil!_k}\rfloor!\times \lceil\sqrt{\lceil\sqrt 8\rceil!_k} \rceil!\div \lceil\sqrt{\sqrt{9}}\rceil$$ has $n_{ops} = 42 + 5k$ (I may have miscounted the 42 fixed operations, but it suffices to say $n_{ops} = c+5k$). The score of $A_k$ goes to infinity as $k$ goes to infinity.

Claim: There exists $r\in \mathbb{R}$ such that $$\frac{-\log|1 - A_k/\pi|}{42 + 5k} > \frac{r}{42 + 5k} + 3!_{k-3}$$ for all $k$ sufficiently large.

Proof:

We recall some facts: Firstly, $n!$ is never a perfect square for $n>1$ (this follows from Bertrand's postulate). Second, Stirling's approximation tells us that $$\pi = \lim_{n\rightarrow\infty} \frac{e^{2n} n!^2}{2 n ^{2n+1}}$$ The difference goes to 0 approximately like $\frac{c}{n}$ for some constant $c$. Since it's not necessary to get precise bounds on the limit here, I'll only use $$|\pi - \frac{e^{2n} n!^2}{2 n ^{2n+1}}| < \frac1{\sqrt n}$$ for $n$ sufficiently large. We will also use the approximation for $e^x$ by $$\lim_{m\rightarrow\infty}(1 + \frac{x}{m})^m = e^x$$ The difference here is approximately $e^x x^2/(2m)$ (According to WolframAlpha). We manipulate the Stirling's approximation for $\pi$: \begin{eqnarray}\pi &\approx& \frac{e^{2n} n!^2}{2 n ^{2n+1}} = \frac{e^{2n} n! (n-1)!}{2 n^{2n}}\\&=& \frac{(e/n)^{2n} n!(n-1)!}{2}\\ &=& \frac{e^{2(-\log(n) + 1)n}n!(n-1)!}2\tag{1}\end{eqnarray} Now we use the approximation for $e^x$ by $(1+x/m)^m$, taking $m = n!$ to ensure that this is converging to $e^x$ much faster than the exponent $2(-\log(n) + 1)n$ diverges to negative infinity. Since $n!$ diverges much faster than $n$ we have $$e^{2(-\log(n) + 1)n} \sim \left(1 + \frac{2(-\log(n) + 1)n}{n!}\right)^{n!}$$ We substitute this into (1) to obtain \begin{eqnarray}\pi &\approx&\frac{e^{2(-\log(n) + 1)n}n!(n-1)!}2 \\&=& \frac{\left(1 + \frac{2(-\log(n) + 1)n}{n!}\right)^{n!}n!(n-1)!}2\\&=& \frac{\left(1 + \frac{2(-\log(n) + 1)}{(n-1)!}\right)^{n!}n!(n-1)!}2\tag{2}\end{eqnarray} The error goes to $0$ faster than $\frac{1}{\sqrt{n}}$. Now we are ready to apply to this to $A_k$. Let $u_k = \lceil\sqrt{3!_k}\rceil$. Since the factorial is never a perfect square, $\lfloor\sqrt{3!_k}\rfloor = u_k-1$. This allows us to simplify $A_k$: \begin{eqnarray}A_k &=& \left[1 + 2 \times \left(- \log\lceil \sqrt{3!_k}\rceil + \lfloor\sqrt{\sqrt{4}}\rfloor\right)\div(\lfloor\sqrt{\lceil\sqrt 5\rceil!_k}\rfloor!)\right]^{\lceil\sqrt{\lceil\sqrt 6\rceil!_k} \rceil!} \times \lfloor\sqrt{\lceil\sqrt 7\rceil!_k}\rfloor!\times \lceil\sqrt{\lceil\sqrt 8\rceil!_k} \rceil!\div \lceil\sqrt{\sqrt{9}}\rceil\\&=& \frac{\left[1 + \frac{2\left(- \log\lceil \sqrt{3!_k}\rceil + \lfloor\sqrt{\sqrt{4}}\rfloor\right)}{\lfloor\sqrt{\lceil\sqrt 5\rceil!_k}\rfloor!}\right]^{\lceil\sqrt{\lceil\sqrt 6\rceil!_k} \rceil!} \lfloor\sqrt{\lceil\sqrt 7\rceil!_k}\rfloor! \lceil\sqrt{\lceil\sqrt 8\rceil!_k} \rceil!}{\lceil\sqrt{\sqrt{9}}\rceil}\nonumber\\&=& \frac{\left[1 + \frac{2\left(- \log\lceil \sqrt{3!_k}\rceil + 1\right)}{\lfloor\sqrt{\lceil\sqrt 5\rceil!_k}\rfloor!}\right]^{\lceil\sqrt{\lceil\sqrt 6\rceil!_k} \rceil!} \lfloor\sqrt{\lceil\sqrt 7\rceil!_k}\rfloor! \lceil\sqrt{\lceil\sqrt 8\rceil!_k} \rceil!}{2}\\&=& \frac{\left[1 + \frac{2\left(- \log\lceil \sqrt{3!_k}\rceil + 1\right)}{\lfloor\sqrt{3!_k}\rfloor!}\right]^{\lceil\sqrt{3!_k} \rceil!} \lfloor\sqrt{3!_k}\rfloor! \lceil\sqrt{3!_k} \rceil!}{2}\\&=& \frac{\left[1 + \frac{2\left(- \log u_k + 1\right)}{(u_k - 1)!}\right]^{u_k!} (u_k - 1)! u_k!}{2}\end{eqnarray} Comparing to the expression in (2), we see that $|A_k - \pi|$ will go to $0$ faster than $1/\sqrt{u_k}$, in particular, there should be a positive constant $c$ such that $|A_k - \pi| < c/\sqrt{u_k}$ for all $k$. Hence we have the score $$\frac{\ln|\frac{\pi}{\pi - A_k}|}{n_{ops}} = \frac{\ln|\frac{\pi}{\pi - A_k}|}{42 + 5k} = \frac{\ln{\pi} - \ln{|\pi - A_k|}}{42 + 5k} > \frac{\ln{\pi} - \ln{c} + \ln{\sqrt{u_k}}}{42 + 5k} = \frac{\ln{\pi} - \ln{c}}{42+5k} + \ln\left({u_k^{1/(84 + 10k)}}\right)$$ Observe that, because of how fast factorials diverge, for sufficiently large $k$: $$u_k = \lceil\sqrt{3!_k}\rceil \ge \sqrt{3!_k} \ge 3!_{k-1} (\ge 3!_{k-2})^{84 + 10k} \ge (\exp(3!_{k-3}))^{84 + 10k}$$ hence for $r = \ln{\pi} -\ln{c}$ we have $$\frac{\ln|\frac{\pi}{\pi - A_k}|}{n_{ops}} > \frac{r}{42+5k} + \ln\left({u_k^{1/(84 + 10k)}}\right) \ge \frac{r}{42 + 5k} + \ln\left(\left((\exp(3!_{k-3}))^{84 + 10k}\right)^{1/(84+10k)}\right) = \frac{r}{42 + 5k} + 3!_{k-3}$$ as desired. $\blacksquare$

UPDATE: I have found a more precise way to bound the error (will fill in details if anyone is interested). Also, rearranging my original solution slightly can shave off a few operations. Long story short, I can now give a concrete answer, which I suspect may be the highest score possible for under 100 operations:

97 operations; Score > $10^{10^{10^{10^{10^{10^{10^{10^{10^{10}}}}}}}}}$

$$ \left(\left[1 - \left(2\times\log\lceil\sqrt{3!!!!!!!!!!!!}\rceil -\sqrt{4}\right)\div\left(\big\lfloor\sqrt{\lceil\sqrt{5}\rceil !!!!!!!!!!!!}\big\rfloor!\right)\right]^{\big\lceil\sqrt{\lceil\sqrt{6}\rceil !!!!!!!!!!!!}\big\rceil !} \div\big\lfloor\sqrt{7}\big\rfloor\right)\times\big\lceil\sqrt{\lceil\sqrt{8}\rceil !!!!!!!!!!!!}\big\rceil!\times\big\lfloor\sqrt{(\sqrt{9}) !!!!!!!!!!!!}\big\rfloor!$$

New contributor
Dark Malthorp is a new contributor to this site. Take care in asking for clarification, commenting, and answering. Check out our Code of Conduct.
$\endgroup$
3
$\begingroup$

Not sure if decimal are allowed, but here's my attempt

1 operator, score 1.1765956249508713525610395676804...

$$123.4/56.789 \approx 2.17295603 \approx \pi - 0.96863662$$

3 operator, score 2.06714352383430453303221463889...

$$(1234/56)/(\lfloor7.89\rfloor) \approx 3.14795918 \approx \pi + 0.00636653 $$

$\endgroup$
3
$\begingroup$

Slightly simplifying Dark Malthorp's remarkable solution, we get: $$\pi \approx A_k = \left[1 - \left( 2 \cdot \log\lceil \sqrt{3!_k}\rceil + \sqrt{4}\right)\div(\lfloor\sqrt{\lceil\sqrt 5\rceil!_k}\rfloor!)\right]^{\lceil\sqrt{\lceil\sqrt{6}\rceil!_k} \rceil!} \div \lfloor\sqrt 7\rfloor \cdot \lceil\sqrt{\lceil\sqrt 8\rceil!_k} \rceil!\cdot \lfloor\sqrt{\sqrt{9}!_k}\rfloor!$$ which has $34+5k$ operations. Also, the approximation is bounded by $\pi < A_k < \pi\cdot(1+1/6\sqrt{3!_k})$, which is an astoundingly close approximation to $\pi$ when $k \geq 3$.

For convenience for reading and for calculating (with small k), the formula for can be simplified to: $$A = \frac{\left[1 - \frac{2\left(\log{n} - 1)\right)}{(n-1)!} \right]^{n!}}{2} n! (n-1)!$$ where $n = \lceil\sqrt{3!_k}\rceil$

39 operations ($k = 1$):
We have $n = 3$, and $$A = \left[1 - \left( 2 \cdot \log\lceil \sqrt{3!}\rceil + \sqrt{4}\right)\div(\lfloor\sqrt{\lceil\sqrt 5\rceil!}\rfloor!)\right]^{\lceil\sqrt{\lceil\sqrt{6}\rceil} \rceil!} \div \lfloor\sqrt 7\rfloor \cdot \lceil\sqrt{\lceil\sqrt 8\rceil!} \rceil!\cdot \lfloor\sqrt{\sqrt{9}!}\rfloor! = 3.21826$$ for a score of 0.0952...not particularly impressive. However, it does validate the bounds on the estimate: $$\pi < A_1 = 3.21826 < 3.355 = \pi\cdot\left(1+\frac{1}{6\sqrt 3!}\right)$$

44 operations ($k = 2$):
We have $n = \lceil\sqrt{3!!}\rceil = 27$. The calculation gets much more difficult than with $k=1$, but it's still tractable. I did it using MPFR (Multiple Precision Floating-Point Reliably) in R:

1 - (2*log(mpfr(27,200))-2)/factorial(mpfr(26,200)))^factorial(mpfr(27,200))*   
factorial(mpfr(27, 200)) * factorial(mpfr(26, 200))/2

which gives $$A = \left[1 - \left( 2 \cdot \log\lceil \sqrt{3!!}\rceil + \sqrt{4}\right)\div(\lfloor\sqrt{\lceil\sqrt 5\rceil!!}\rfloor!)\right]^{\lceil\sqrt{\lceil\sqrt{6}\rceil!} \rceil!} \div \lfloor\sqrt 7\rfloor \cdot \lceil\sqrt{\lceil\sqrt 8\rceil!!} \rceil!\cdot \lfloor\sqrt{\sqrt{9}!!}\rfloor! = 3.16104$$ for a score of 0.1156...still not very impressive, but provides another validation of the bounds: $$\pi < A_2 = 3.16104 < 3.16111 = \pi\cdot\left(1+\frac{1}{6\sqrt{3!!}}\right)$$

49 operations ($k = 3$): With $k=3$, the direct calculations become intractable because $n = \lceil\sqrt{3!!!}\rceil \approx 1.61\times 10^{873}$, which we'd need to take the factorial of and then put it in the exponent--not going to happen. However, Dark Malthorp's proof gives valid bounds on the approximation that are not impossible to calculate for $k=3$: $$\pi < A_3 < \pi\cdot\left(1+\frac{1}{6\sqrt{3!!!}}\right)$$ which gives $$\pi < A = \left[1 - \left( 2 \cdot \log\lceil \sqrt{3!!!}\rceil + \sqrt{4}\right)\div(\lfloor\sqrt{\lceil\sqrt 5\rceil!!!}\rfloor!)\right]^{\lceil\sqrt{\lceil\sqrt{6}\rceil!!} \rceil!} \div \lfloor\sqrt 7\rfloor \cdot \lceil\sqrt{\lceil\sqrt 8\rceil!!!} \rceil!\cdot \lfloor\sqrt{\sqrt{9}!!!}\rfloor! = 3.1415926535897932384...\approx \pi + 10^{-873}$$ accurate to nearly 1000 digits. This gives a score of around 41.07.

New contributor
Rex Eupseiphos is a new contributor to this site. Take care in asking for clarification, commenting, and answering. Check out our Code of Conduct.
$\endgroup$
2
$\begingroup$

SCORE: 1.116831135 (7 Ops)

(1-2) * (34-56) / 7 * (-8 + 9) = 22/7

SCORE: 0.977227243 (8 Ops)

((1+2) * 3)/4/(5+6)/7/8/9 = 22/7

SCORE: 1.5636 (5 Ops) Thanks @Glen O.

(⌊1234/56⌋/7)*(-8+9) = 22/7

$\endgroup$
  • $\begingroup$ I figured I'd give you a nudge towards a further improvement. $\lfloor 1234/56\rfloor = 22$. (for that matter, it's not far from being 22, so you might be able to drop the floor operation and get an even better score) $\endgroup$ – Glen O Apr 18 '15 at 8:37
  • $\begingroup$ Also, you've used log_10 rather than ln in your score calculation. Your scores should be 0.977227108 for 8 ops and 1.116830981 for 7 ops. $\endgroup$ – Glen O Apr 18 '15 at 12:18
  • $\begingroup$ @Glen O: ln|1−A/π| = -7.818. So the calculation is correct.Right? I used the example in the problem. Also do update my name in the top 10 answers :) $\endgroup$ – thepace Apr 19 '15 at 12:15
  • $\begingroup$ That is the correct logarithm. And then you negate it and divide it by the number of operations, giving 1.116831135 for the 7 ops case and 0.977227243 for the 8 ops case. The scores you listed in your answer are the values you get if you use log_10 rather than ln. $\endgroup$ – Glen O Apr 19 '15 at 13:36
  • $\begingroup$ And I'm not sure what you mean about the top 10 answers. Perhaps you didn't notice, but it's not a top 10 - it's best answer for each number of operations. The only answer your score beats is the 1 op answer, which obviously your answers aren't (1 op answers, that is). $\endgroup$ – Glen O Apr 19 '15 at 13:38
1
$\begingroup$

With the incorrect scoring method:

((((12!^3!^4!^5!^6!^7!^8!^9!)!)!)!)!...... resulting in a pi that far..far away but gives the highest of scores!

Second Attempt: 10 operators (Score = 0.524352512)

1/(2^3) + |-4+5-6+7-8+9| = 3.125 (off by 0.01659)

First attempt: 4 operators (Score = 0.665238338)

(1/2)+3-(456/789) = 2.92205 (off by 0.21953)

$\endgroup$
  • $\begingroup$ Your second attempt uses exponentiation, which costs 3 operations. So it's actually 12 operations, not 10. $\endgroup$ – Glen O Apr 18 '15 at 9:26
  • $\begingroup$ Following on from my previous comment, you can actually reduce it back to 11 operations by using $2+3!$ (for two operations) instead of 2^3. $\endgroup$ – Glen O Apr 19 '15 at 3:41
0
$\begingroup$

1 operation score 2.2538864...

12 / 3.456789 ≈ π + 0.329837026

$\endgroup$
  • $\begingroup$ The decimal point is not a valid operation, and would have to count as one. $\endgroup$ – boboquack Feb 10 '18 at 23:40
  • $\begingroup$ @boboquack There is no such claim on the question. The question does not forbid non natural numbers. $\endgroup$ – Bruno Costa Feb 10 '18 at 23:47
  • 3
    $\begingroup$ "Your job is to approximate π using the sequence of digits (in order): 1 2 3 4 5 6 7 8 9 with operators inserted between them (permitted operators listed below)." Since the decimal point is between two of your digits, it must be an operator, as that is the only thing you are allowed to do to the digits. However, it is not listed as one of the permitted operators, therefore it must be forbidden. $\endgroup$ – boboquack Feb 11 '18 at 0:08
  • $\begingroup$ What I am arguing is that the number1.234 has the digits 1 to 4 in sequence and doesn't have any operator. There is no operator between number 1 and 2 since 1 and 2 are part of the same number. $\endgroup$ – Bruno Costa Feb 11 '18 at 0:18
  • $\begingroup$ Then under what condition are you allowed to add a decimal point? $\endgroup$ – boboquack Feb 11 '18 at 0:42
0
$\begingroup$

1st ops:

$1+2-3-4+5-6+7+\sqrt{\sqrt{\sqrt{\sqrt{8+9}}}} = 3.1937216143839002$

$\endgroup$
  • 4
    $\begingroup$ Fixed square root symbols for you, but why is this labeled "1st ops"? There are 12 operations here, and you didn't include your score. $\endgroup$ – Rubio Feb 11 '18 at 19:33
-2
$\begingroup$

 14 Operations - score 0.16088866261

$\sqrt((6!)/(8\times5))-(\sqrt(\sqrt(34)-\sqrt(21)))+\ln(\sqrt((9-7)))\approx3.47190671012$

$\endgroup$
  • 8
    $\begingroup$ I'm not one of the downvoters, but I think you've neglected an important rule of the question that is present in all other answers: the numbers 1 though 9 should be used in that order. In your answer it's 6,8,5,3,4,2,1,9,7 instead of 1,2,3,4,5,6,7,8,9.. $\endgroup$ – Kevin Cruijssen Jun 8 '16 at 13:11

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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