## 1047: "Approximations"

This forum is for the individual discussion thread that goes with each new comic.

Moderators: Moderators General, Magistrates, Prelates

### Re: 1047: "Approximations"

Toam wrote:The fundamental charge one is wrong (and I'm surprised no one has mentioned it?).

3/(14*π^π^π) = 2.6566x10-6 C

So I guessed maybe a typo and tried:

3/((14π)^π^π) = 1.8139x10-16 C

Which is closer in comparison, but still no where near.

You're evaluating 3/(14 (\pi^\pi)^\pi) = 3/(14 \pi^{\pi^2}), not 3/(14 \pi^{\pi^\pi}).
uwcsDemo

Posts: 1
Joined: Mon Mar 14, 2011 7:24 am UTC

### Re: 1047: "Approximations"

For all the chemists out there, Avagadro's Constant is about 25!/26 to 1 part in 106.

Posts: 1
Joined: Fri Apr 27, 2012 1:33 am UTC

### Re: 1047: "Approximations"

Units are m^3/(kg s^2)
Measured value of G = 6.67384(80)e-11 = 6.67384e-11 +/- 8e-15 = (6.67304e-11 to 6.67464e-11)
XKCD's approximate value of G = e^-((pi - 1)^(pi + 1))
To a high degree of accuracy:
Code: Select all
pi = 3.1415926535897932384626433832795pi + 1 = 4.1415926535897932384626433832795e = 2.7182818284590452353602874713527pi - 1 = 2.1415926535897932384626433832795(pi - 1)^(pi + 1) = 23.43027491992439e^(-(pi - 1)^(pi + 1)) = 6.6736110685055e-11

This easily falls within the range which our measurements indicate as probable for the actual value of G, which exists but is currently unknown.

We're in agreement then.
"I would therefore take the liberty of suggesting that, in the next edition of your excellent poem, the erroneous calculation to which I refer should be corrected ... "
JimsMaher

Posts: 105
Joined: Wed Mar 14, 2012 5:14 pm UTC

### Re: 1047: "Approximations"

My favorite calculator trick is
Start with the date of the Battle of Hastings (that's 1066 for non Brits)
Divide by 11
take the square root twice
And you get pi, accurate to about one part in a billion.

As a formula, pi^4 = 2143/22
misterajc

Posts: 1
Joined: Fri Apr 27, 2012 4:28 am UTC

### Re: 1047: "Approximations"

Pretty cool comic. But now I'm desperately longing for a thing I didn't even know I needed before: RIES. However, I'm a total noob and I'm not able to compile the code provided on Rob Munafo's page. (Countless error messages …) The page reads: "ries was first created for Linux1, but is is easily ported to Mac OS X, and nearly any OS with a C compiler." Any OS …
Is there any chance I can get a compiled version that I can run on Windows?
ZD3000

Posts: 1
Joined: Thu Apr 26, 2012 6:57 pm UTC
Location: Germany

### Re: 1047: "Approximations"

While much less accurate than pi*10^7 (at only about 1 in 20), the length of a year is pretty close to 2^25 seconds. A handy rule of thumb when you're estimating running times for brute-force searches...
nickovs

Posts: 1
Joined: Fri Apr 27, 2012 2:46 pm UTC

### Re: 1047: "Approximations"

to convert between miles-per-gallon (the US standard) and liters-per-100km (European):

235/x = y

...works both ways...
demerson3

Posts: 1
Joined: Wed Apr 25, 2012 8:13 pm UTC

### Re: 1047: "Approximations"

Has anyone mentioned 22/7 as an approximation for pi? It's good for rough calculations, and it's within 0.002 of the actual value.
JimmyTMalice

Posts: 6
Joined: Fri Apr 27, 2012 5:48 pm UTC

### Re: 1047: "Approximations"

My first impression was "the most flagrant example of needing to get a life that I've seen in forever"... sorry Randall.

Then I read the comments, and thought that perhaps getting such nerd hormones flowing had some virtue in itself.

But then again maybe not.

Getting to something with content - if you can make a set of "approximations" that is dense to 1 in 1000, say (that is, if you can create cute expressions for values up to y such that the gap between expressions are less than y/1000), is there any content to the statement that you have found such an "approximation"?

But then again, the cancer stuff (particularly the tattoo thing) make me want to forgive all.

Be relatively happy.

(pick a number at random - congratulations! you are now in a state of statistical sin)
aljohnso

Posts: 5
Joined: Sat Aug 28, 2010 8:17 pm UTC

### Re: 1047: "Approximations"

A propos of nothing...the entropy of the Secret Santa distribution is log(\pi +\frac{6}{11})to one part in 80,000
Last edited by Widmerpool on Wed May 02, 2012 4:22 pm UTC, edited 1 time in total.

Widmerpool
Three for the price of one!

Posts: 37
Joined: Sat Apr 28, 2012 6:57 am UTC

### Re: 1047: "Approximations"

ZD3000 wrote:Pretty cool comic. But now I'm desperately longing for a thing I didn't even know I needed before: RIES. However, I'm a total noob and I'm not able to compile the code provided on Rob Munafo's page. (Countless error messages …) The page reads: "ries was first created for Linux1, but is is easily ported to Mac OS X, and nearly any OS with a C compiler." Any OS …
Is there any chance I can get a compiled version that I can run on Windows?

There is now an online lookup service on the RIES web page. Type in your number and hit the Submit button. I coded it up this afternoon, and yes, /I used regular expressions/.

An earlier reply in this topic gave a link, or type in mrob.com/ries

To address the Windows situation more directly: contact me (contact links on the bottom of my webpage) and we can look at it. RIES only uses basic libraries (malloc, printf, ...) so there probably isn't much needed to get it working.
Robert Munafo - http://mrob.com - @mrob_27

Yᴇꜱ, I'ᴍ ᴍᴇɴᴛɪᴏɴᴇᴅ ɪɴ хᴋᴄᴅ ʙᴜᴛ Rᴀɴᴅᴀʟʟ ᴀɴᴅ I ʜᴀᴠᴇɴ'ᴛ ᴄᴏᴍᴍᴜɴɪᴄᴀᴛᴇᴅ ᴅɪʀᴇᴄᴛʟʏ;
ʙᴜᴛ ʟɪᴋᴇ ʜɪᴍ, I ʜᴀᴠᴇ ᴀ ᴘᴀꜱꜱɪᴏɴ ꜰᴏʀ ꜱᴇʟꜰ-ᴘᴜʙʟɪꜱʜᴇᴅ ᴡᴏʀᴋ ᴛʜᴀᴛ ᴏɴʟʏ ʜᴀᴘᴘᴇɴꜱ ᴛᴏ ʙᴇɴᴇꜰɪᴛ ᴏᴛʜᴇʀꜱ

mrob27

Posts: 97
Joined: Tue Jun 28, 2011 2:19 am UTC
Location: Cambridge, USA

### Re: 1047: "Approximations"

ZD3000 wrote:Pretty cool comic. But now I'm desperately longing for a thing I didn't even know I needed before: RIES. However, I'm a total noob and I'm not able to compile the code provided on Rob Munafo's page. (Countless error messages …) The page reads: "ries was first created for Linux1, but is is easily ported to Mac OS X, and nearly any OS with a C compiler." Any OS …
Is there any chance I can get a compiled version that I can run on Windows?

Since you've come as far as "countless error messages", your noobness can't be that bad.
Solution possibilities in order of hardness:
* Install cygwin + gcc, compile it out of the box
* Install mingw, code asprintf yourself (allocate a buffer and sprintf the string concatenation into it)
* Visual studio is hardest, because it's too dumb to grok C99-style variable declarations in the middle of code, and the error message (C2143) does not say that this is the problem. It also doesn't have asprintf.

PS: I've sent patches for all of that to Mr. Munafo.
Markus__1

Posts: 31
Joined: Wed Apr 20, 2011 6:42 pm UTC

### Re: 1047: "Approximations"

"2) if you ever find yourself raising log(anything)^e or taking the pi-th root of anything, set down the marker and back away from the whiteboard; something has gone horribly wrong."
See http://www.tweedledum.com/rwg/idents.htm
--rwg
Bill Gosper

Posts: 1
Joined: Sun Apr 29, 2012 8:19 am UTC

### Re: 1047: "Approximations"

When I read strip 688, I thought that there was no way it could any nerdier. How wrong I was!

In other words, I really like this one.
klausok

Posts: 14
Joined: Mon Feb 14, 2011 1:27 pm UTC

### Re: 1047: "Approximations"

Markus__1 wrote:Since you've come as far as "countless error messages", your noobness can't be that bad.
Solution possibilities in order of hardness:
* Install cygwin + gcc, compile it out of the box
* Install mingw, code asprintf yourself (allocate a buffer and sprintf the string concatenation into it)
* Visual studio is hardest, because it's too dumb to grok C99-style variable declarations in the middle of code, and the error message (C2143) does not say that this is the problem. It also doesn't have asprintf.

PS: I've sent patches for all of that to Mr. Munafo.

Thank you Markus__1 for your patches. I have verified that they work on my system at least and they are now part of the source code available at mrob.com/ries (see "RIES Source Code" link). Compatibility with lots of systems is a primary goal so it's great to get rid of that asprintf.
Robert Munafo - http://mrob.com - @mrob_27

Yᴇꜱ, I'ᴍ ᴍᴇɴᴛɪᴏɴᴇᴅ ɪɴ хᴋᴄᴅ ʙᴜᴛ Rᴀɴᴅᴀʟʟ ᴀɴᴅ I ʜᴀᴠᴇɴ'ᴛ ᴄᴏᴍᴍᴜɴɪᴄᴀᴛᴇᴅ ᴅɪʀᴇᴄᴛʟʏ;
ʙᴜᴛ ʟɪᴋᴇ ʜɪᴍ, I ʜᴀᴠᴇ ᴀ ᴘᴀꜱꜱɪᴏɴ ꜰᴏʀ ꜱᴇʟꜰ-ᴘᴜʙʟɪꜱʜᴇᴅ ᴡᴏʀᴋ ᴛʜᴀᴛ ᴏɴʟʏ ʜᴀᴘᴘᴇɴꜱ ᴛᴏ ʙᴇɴᴇꜰɪᴛ ᴏᴛʜᴇʀꜱ

mrob27

Posts: 97
Joined: Tue Jun 28, 2011 2:19 am UTC
Location: Cambridge, USA

### Re: 1047: "Approximations"

Bill Gosper wrote:"2) if you ever find yourself raising log(anything)^e or taking the pi-th root of anything, set down the marker and back away from the whiteboard; something has gone horribly wrong."
See http://www.tweedledum.com/rwg/idents.htm
--rwg

Yeah, I didn't want to challenge Randall directly on this one, (in fact he hasn't answered my initial email about RIES so I think he may be too busy), but...

When RWG and I were working on RIES earlier this year, this issue of wacky expressions like "the pi-th root of 4" came up, and we concluded (along with others in an email discussion) that RIES was more useful if it includes these expressions in its searchspace.

As a long-term TODO item, I hope to add a facility for users to specify patterns that get matched (quasi-regexp-like) against subexpressions in their internal FORTH format. Then such things as a complexity score bias can be attached to matched patterns. The difficulty in implementation comes from the fact that this would totally destroy the pruning efficiency, and thus the performance of the overall RIES alrogithm.
Robert Munafo - http://mrob.com - @mrob_27

Yᴇꜱ, I'ᴍ ᴍᴇɴᴛɪᴏɴᴇᴅ ɪɴ хᴋᴄᴅ ʙᴜᴛ Rᴀɴᴅᴀʟʟ ᴀɴᴅ I ʜᴀᴠᴇɴ'ᴛ ᴄᴏᴍᴍᴜɴɪᴄᴀᴛᴇᴅ ᴅɪʀᴇᴄᴛʟʏ;
ʙᴜᴛ ʟɪᴋᴇ ʜɪᴍ, I ʜᴀᴠᴇ ᴀ ᴘᴀꜱꜱɪᴏɴ ꜰᴏʀ ꜱᴇʟꜰ-ᴘᴜʙʟɪꜱʜᴇᴅ ᴡᴏʀᴋ ᴛʜᴀᴛ ᴏɴʟʏ ʜᴀᴘᴘᴇɴꜱ ᴛᴏ ʙᴇɴᴇꜰɪᴛ ᴏᴛʜᴇʀꜱ

mrob27

Posts: 97
Joined: Tue Jun 28, 2011 2:19 am UTC
Location: Cambridge, USA

### Re: 1047: "Approximations"

Giallo wrote:If you want something nice, try computing:
\sqrt[3]{1+\sqrt{\frac{28}{27}}} + \sqrt[3]{1 - \sqrt{\frac{28}{27}}}

\sqrt[3]{1+\sqrt{\frac{28}{27}}} + \sqrt[3]{1 - \sqrt{\frac{28}{27}}} = x

1+\sqrt{\frac{28}{27}} +1 - \sqrt{\frac{28}{27}} + 3(\sqrt[3]{1+\sqrt{\frac{28}{27}}} + \sqrt[3]{1 - \sqrt{\frac{28}{27}}})(\sqrt[3]{1+\sqrt{\frac{28}{27}}}\cdot \sqrt[3]{1 - \sqrt{\frac{28}{27}}}) = x^3

2 + 3x(\sqrt[3]{1 - \frac{28}{27}}) = x^3

2 + 3x(-\frac{1}{3}) = x^3

2 - x = x^3

x^3 + x - 2 = 0

(x-1)(x^2+x+2) = 0

Since x^2+x+2 is a quadratic without real roots, x = 1 is the answer.
phenomist

Posts: 1
Joined: Mon Apr 30, 2012 4:31 am UTC

### Re: 1047: "Approximations"

houseofadams wrote:For all the chemists out there, Avagadro's Constant is about 25!/26 to 1 part in 106.

I prefer (4!)! It's not as accurate, but much more compact.
drachefly

Posts: 20
Joined: Thu Apr 23, 2009 3:25 pm UTC

### Re: 1047: "Approximations"

loberto wrote:More accurate (exact I think) for feet in one meter: 1250/381. 1250 feet equals 381 meters, and is the exact height of the Empire State Building.

39.37 cm/12 in (for US. Survey feet, the only right kind of feet)

0.3048m = 1 international foot (the wrong foot)

-says the surveyor
"Greyarcher":Trying to build a proper foundation for knowledge is blippery.
"JimsMaher":Squirrels are crazy enough to be test pilots.
The Velocirapture is Imminent!

eran_rathan

Posts: 1168
Joined: Fri Apr 09, 2010 2:36 pm UTC
Location: rapidly approaching c, in some other reference frame

### Re: 1047: "Approximations"

eran_rathan wrote:
loberto wrote:More accurate (exact I think) for feet in one meter: 1250/381. 1250 feet equals 381 meters, and is the exact height of the Empire State Building.

39.37 cm/12 in (for US. Survey feet, the only right kind of feet)

0.3048m = 1 international foot (the wrong foot)

-says the surveyor

3 meters is 10 feet. Off by 1.6%. It isn't cute but it's a far easier approximation than 5/e'th root of pi
The Law of Fives is true. I see it everywhere I look for it.
J Thomas
Everyone's a jerk. You. Me. This Jerk.^

Posts: 1190
Joined: Fri Sep 23, 2011 3:18 pm UTC

### Re: 1047: "Approximations"

eran_rathan wrote:
39.37 cm/12 in (for US. Survey feet, the only right kind of feet)

0.3048m = 1 international foot (the wrong foot)

-says the surveyor

Your conversion implies that 1 US survey foot = 0.3937 m, which is MUCH larger than 1 international foot = 0.3048 m. But the US survey foot is actually only 2 parts per million larger than the international foot. See...

http://www.ngs.noaa.gov/faq.shtml#Feet

I think you meant 1 m = 39.37 in (for the US survey foot, not for the international foot).

Posts: 9
Joined: Wed Aug 12, 2009 8:42 pm UTC

### Re: 1047: "Approximations"

phenomist wrote:
Spoiler:
Giallo wrote:If you want something nice, try computing:
\sqrt[3]{1+\sqrt{\frac{28}{27}}} + \sqrt[3]{1 - \sqrt{\frac{28}{27}}}

\sqrt[3]{1+\sqrt{\frac{28}{27}}} + \sqrt[3]{1 - \sqrt{\frac{28}{27}}} = x

1+\sqrt{\frac{28}{27}} +1 - \sqrt{\frac{28}{27}} + 3(\sqrt[3]{1+\sqrt{\frac{28}{27}}} + \sqrt[3]{1 - \sqrt{\frac{28}{27}}})(\sqrt[3]{1+\sqrt{\frac{28}{27}}}\cdot \sqrt[3]{1 - \sqrt{\frac{28}{27}}}) = x^3

2 + 3x(\sqrt[3]{1 - \frac{28}{27}}) = x^3

2 + 3x(-\frac{1}{3}) = x^3

2 - x = x^3

x^3 + x - 2 = 0

(x-1)(x^2+x+2) = 0

Since x^2+x+2 is a quadratic without real roots, x = 1 is the answer.

Exactly
It has been found by del Ferro, if I remember correctly, using the formula for the roots of cubics.
"Ich bin ein Teil von jener Kraft, die stets das Böse will und stets das Gute schafft."
Giallo

Posts: 226
Joined: Sat Jan 01, 2011 11:31 pm UTC
Location: ETH, Zürich, Switzerland

### Re: 1047: "Approximations"

For maximum confusion, I would place the Rent method at 1 in 366, making the other one accurate to within 1 in 300. Also I always thought Jenny's constant was -4442, making -4444 accurate to within 1 in 2221 (sadly not 2222).
Not R

Posts: 3
Joined: Tue May 01, 2012 6:24 pm UTC
Location: Kingston, NY

### Re: 1047: "Approximations"

Fun fact; when entering "cos(pi/7) + cos(3pi/7) + cos(5pi/7) = 1/2" into WolframAlpha and viewing the maximum number of digits. If you alternate between "fewer digits" and "more digits," it switches between 4.9 repeating and 5.0 repeating randomly.
Exhibit A: http://i.imgur.com/gpAzK.png
SirH3nry

Posts: 1
Joined: Wed May 02, 2012 2:58 pm UTC

### Re: 1047: "Approximations"

My favorite approximation is probably this one:
π = ln(-1)/i
I hear it's accurate to 1 in ∞!

Patrick
pmackey

Posts: 1
Joined: Thu May 03, 2012 3:32 pm UTC

### Re: 1047: "Approximations"

Here's a whole bunch more (mostly numerical, not many constants/unit conversions):

http://en.wikipedia.org/wiki/Mathematical_coincidence
chewbakken

Posts: 9
Joined: Thu May 03, 2012 5:46 pm UTC

### Re: 1047: "Approximations"

pmackey wrote:My favorite approximation is probably this one:
π = ln(-1)/i
I hear it's accurate to 1 in ∞!

Patrick

Only if you define well your branch of log... If you use the "classical" ln, the ln(-1) is not even defined. You can also define branches of log where ln(-1) = π(2n + 1) with n any integer.
"Ich bin ein Teil von jener Kraft, die stets das Böse will und stets das Gute schafft."
Giallo

Posts: 226
Joined: Sat Jan 01, 2011 11:31 pm UTC
Location: ETH, Zürich, Switzerland

### Re: 1047: "Approximations"

A simple one...
\pi^2 \approx 10

(one part in 76)
flipwook

Posts: 1
Joined: Fri May 11, 2012 9:15 am UTC

### Re: 1047: "Approximations"

My preferred approximation is a bit obscure - in the suburb where I used to live, phone numbers were 8 digits long and (some) started with 9869. So 9869 6044 is, presumably, someone's phone number in that suburb. And 9.8696044 is, to a pretty good approximation, pi^2.
pollywog wrote:
Wikihow wrote:* Smile a lot! Give a gay girl a knowing "Hey, I'm a lesbian too!" smile.
I want to learn this smile, perfect it, and then go around smiling at lesbians and freaking them out.

ConMan

Posts: 1321
Joined: Tue Jan 01, 2008 11:56 am UTC
Location: Where beer does flow, and men chunder.

### Re: 1047: "Approximations"

Apologies if this one was suggested already, but:

355/113 = π (3ppm)
Greywolf

Posts: 2
Joined: Tue May 22, 2012 10:32 pm UTC

### Re: 1047: "Approximations"

I didn't see anyone mentioning this... g (acceleration of gravity on earth) is approximately pi^2 (in m/s^2)
fmotoki

Posts: 1
Joined: Mon Jul 02, 2012 11:00 pm UTC

### Re: 1047: "Approximations"

Giallo wrote:
phenomist wrote:
Spoiler:
Giallo wrote:If you want something nice, try computing:
\sqrt[3]{1+\sqrt{\frac{28}{27}}} + \sqrt[3]{1 - \sqrt{\frac{28}{27}}}

\sqrt[3]{1+\sqrt{\frac{28}{27}}} + \sqrt[3]{1 - \sqrt{\frac{28}{27}}} = x

1+\sqrt{\frac{28}{27}} +1 - \sqrt{\frac{28}{27}} + 3(\sqrt[3]{1+\sqrt{\frac{28}{27}}} + \sqrt[3]{1 - \sqrt{\frac{28}{27}}})(\sqrt[3]{1+\sqrt{\frac{28}{27}}}\cdot \sqrt[3]{1 - \sqrt{\frac{28}{27}}}) = x^3

2 + 3x(\sqrt[3]{1 - \frac{28}{27}}) = x^3

2 + 3x(-\frac{1}{3}) = x^3

2 - x = x^3

x^3 + x - 2 = 0

(x-1)(x^2+x+2) = 0

Since x^2+x+2 is a quadratic without real roots, x = 1 is the answer.

Exactly
It has been found by del Ferro, if I remember correctly, using the formula for the roots of cubics.

Indeed. I guess the expression you posted is of historical significance, but why not give some prettier cubic root expressions that avoid the use of fractions, eg,

(100+sqrt(7803))^(1/3) + (100-sqrt(7803))^(1/3) = 8
and
(9+sqrt(80))^(1/3) + (9-sqrt(80))^(1/3) = 3

[I've used that ugly format so that the expressions can be easily checked in the Google Calculator.]

PM 2Ring

Posts: 2960
Joined: Mon Jan 26, 2009 3:19 pm UTC
Location: Mid north coast, NSW, Australia

### Re: 1047: "Approximations"

e = \sqrt[pi]{ \sqrt[i]{-1} }

It's not outside the realm of sensible math.
sswam

Posts: 1
Joined: Wed Jul 25, 2012 6:27 am UTC

### Re: 1047: "Approximations"

Another one: the temperature of the universe (or at least it's CMB radiation) is e K, accurate to almost 1 in 400.
chewbakken

Posts: 9
Joined: Thu May 03, 2012 5:46 pm UTC

### Re: 1047: "Approximations"

On Jenny's Constant:
Coderjoe wrote:The actual outcome of Randall's approximation has no end, due to the use of \pi. The result, out to 22 places is 867.5309019854097558275225 (and actually continues with 4961.. instead of that 5).

I guess something weird happened with your copy & paste operation, since it appears that you've lost a couple of digits. I get
867.5309019816854097558275224961431838440297231328116937715658956
1760603903591897835403126064595054279713689805052485005005... etc

PM 2Ring

Posts: 2960
Joined: Mon Jan 26, 2009 3:19 pm UTC
Location: Mid north coast, NSW, Australia

### Re: 1047: "Approximations"

Another approximation: the apparent size of the Sun (from the Earth) equals the apparent size of the Moon (again, from the Earth).
"The position was well put indeed in a famous speech by Jzbl to the graduates of the Central Saturnian University, when he said that it was a source of great pride to him that although hardly anybody knew anything any longer, everybody now knew how to find out everything."

bmonk

Posts: 622
Joined: Thu Feb 18, 2010 10:14 pm UTC

Previous