Difference between revisions of "217: e to the pi Minus pi"

Explain xkcd: It's 'cause you're dumb.
Jump to: navigation, search
(Explanation)
(More correct term)
(12 intermediate revisions by 6 users not shown)
Line 4: Line 4:
 
| title    = e to the pi Minus pi
 
| title    = e to the pi Minus pi
 
| image    = e_to_the_pi_minus_pi.png
 
| image    = e_to_the_pi_minus_pi.png
| imagesize =
 
 
| titletext = Also, I hear the 4th root of (9^2 + 19^2/22) is pi.
 
| titletext = Also, I hear the 4th root of (9^2 + 19^2/22) is pi.
 
}}
 
}}
  
 
==Explanation==
 
==Explanation==
"e" is a mathematical constant that is about equal to 2.71828182846. π is about equal to 3.14159265359.
 
  
Computers use "floating point" numbers to store decimals. As noted in the comic, e^π - π is 19.999099979. However, Hat Guy's teammates' algorithms truncate to 3 decimal digits — giving a result of 19.999. Yet the programmers thought that 19.999 should come out to 20 unless they had errors in their algorithms (they did not; 19.999 would be the correct result).
+
''e'' is a mathematical constant roughly equal to 2.71828182846. ''π'' is another, roughly equal to 3.14159265359. Both are {{w|transcendental number}}s.
ACM is the Association for Computing Machinery; it sponsors the International Collegiate Programming Contest.
 
  
:In the title text, another mathematical coincidence is presented. The 4th root of (9^2 + 19^2/22) is 3.1415926525, which is extremely close to pi (≈3.1415926535).
+
The first panel discusses {{w|Gelfond's constant|''e''<sup>''π''</sup>}} - ''π'', which is around 19.999099979 -- very close to 20.  [[Black Hat]] explains how he tricked a programming team into believing that ''e''<sup>''π''</sup> - ''π'' is ''exactly'' 20, and that if the system they were building didn't agree, there were errors in the code. This made them waste a lot of time trying to find a nonexistent bug until they realized that Black Hat was lying.
 +
 
 +
{{w|Floating point}} numbers are how computers store real numbers -- or rather, approximate them: a true real number requires infinite amounts of data to represent. The "floating-point handlers" would be the code performing the ''e''<sup>''π''</sup> - ''π'' calculation.
 +
 
 +
ACM is the {{w|Association for Computing Machinery}}, sponsoring the {{w|ACM International Collegiate Programming Contest|International Collegiate Programming Contest}}.
 +
 
 +
Some random facts about the math here:
 +
 
 +
* ''e''<sup>''π''</sup> - ''π'' is an irrational number, but this is not a trivial fact. It was proven by {{w|Yuri Valentinovich Nesterenko}} in the late 20th century.
 +
* The mysterious almost-equation is believed to be a {{w|mathematical coincidence}}, or a numerical relationship that "just happens" with no satisfactory explanation. It can be rearranged to (π + 20)<sup>i</sup> ≈ -i, so cos(ln(π + 20)) ≈ -1. Piling on a few more cosines gives cos(π cos(π cos(ln(π + 20)))) ≈ -1, which is off by less than 10<sup>-35</sup>!
 +
* The title text gives another coincidence: ∜(+ 19²/22) 3.1415926525, close to ''π''.
 +
 
 +
A much later comic, [[1047: Approximations]], puts forth quite a few more mathematical coincidences.
  
 
==Transcript==
 
==Transcript==
 
:Cueball: Hey, check it out: e^pi-pi is 19.999099979. That's weird.
 
:Cueball: Hey, check it out: e^pi-pi is 19.999099979. That's weird.
 
:Black Hat: Yeah. That's how I got kicked out of the ACM in college.
 
:Black Hat: Yeah. That's how I got kicked out of the ACM in college.
:Cueball: . . . what?
+
:Cueball: ...what?
 
:Black Hat: During a competition, I told the programmers on our team that e^pi-pi was a standard test of floating-point handlers--it would come out to 20 unless they had rounding errors.
 
:Black Hat: During a competition, I told the programmers on our team that e^pi-pi was a standard test of floating-point handlers--it would come out to 20 unless they had rounding errors.
 
:Cueball: That's awful.
 
:Cueball: That's awful.
 
:Black Hat: Yeah, they dug through half their algorithms looking for the bug before they figured it out.
 
:Black Hat: Yeah, they dug through half their algorithms looking for the bug before they figured it out.
  
{{comic discussion}}  
+
{{comic discussion}}
<!-- Include any categories below this line-->
 
 
[[Category:Comics featuring Cueball]]
 
[[Category:Comics featuring Cueball]]
 
[[Category:Comics featuring Black Hat]]
 
[[Category:Comics featuring Black Hat]]
 
[[Category:Math]]
 
[[Category:Math]]
 +
[[Category:Programming]]

Revision as of 14:00, 18 February 2014

e to the pi Minus pi
Also, I hear the 4th root of (9^2 + 19^2/22) is pi.
Title text: Also, I hear the 4th root of (9^2 + 19^2/22) is pi.

Explanation

e is a mathematical constant roughly equal to 2.71828182846. π is another, roughly equal to 3.14159265359. Both are transcendental numbers.

The first panel discusses eπ - π, which is around 19.999099979 -- very close to 20. Black Hat explains how he tricked a programming team into believing that eπ - π is exactly 20, and that if the system they were building didn't agree, there were errors in the code. This made them waste a lot of time trying to find a nonexistent bug until they realized that Black Hat was lying.

Floating point numbers are how computers store real numbers -- or rather, approximate them: a true real number requires infinite amounts of data to represent. The "floating-point handlers" would be the code performing the eπ - π calculation.

ACM is the Association for Computing Machinery, sponsoring the International Collegiate Programming Contest.

Some random facts about the math here:

  • eπ - π is an irrational number, but this is not a trivial fact. It was proven by Yuri Valentinovich Nesterenko in the late 20th century.
  • The mysterious almost-equation is believed to be a mathematical coincidence, or a numerical relationship that "just happens" with no satisfactory explanation. It can be rearranged to (π + 20)i ≈ -i, so cos(ln(π + 20)) ≈ -1. Piling on a few more cosines gives cos(π cos(π cos(ln(π + 20)))) ≈ -1, which is off by less than 10-35!
  • The title text gives another coincidence: ∜(9² + 19²/22) ≈ 3.1415926525, close to π.

A much later comic, 1047: Approximations, puts forth quite a few more mathematical coincidences.

Transcript

Cueball: Hey, check it out: e^pi-pi is 19.999099979. That's weird.
Black Hat: Yeah. That's how I got kicked out of the ACM in college.
Cueball: ...what?
Black Hat: During a competition, I told the programmers on our team that e^pi-pi was a standard test of floating-point handlers--it would come out to 20 unless they had rounding errors.
Cueball: That's awful.
Black Hat: Yeah, they dug through half their algorithms looking for the bug before they figured it out.


comment.png add a comment! ⋅ comment.png add a topic (use sparingly)! ⋅ Icons-mini-action refresh blue.gif refresh comments!

Discussion

Asserting that the programmers' algorithms truncated to three decimal digits is an unsupported and unnecessary extrapolation. Most floating-point implementations use binary, not decimal, and 19.999099979 looks very much like a rounding error in binary floating-point that has accumulated over several operations. Daddy (talk) 12:39, 29 April 2013 (UTC)

Fixed. Xhfz (talk) 22:57, 16 August 2013 (UTC)

The "not good at math" might be too harsh, if they've (tried to) read the floating point spec. Depending on precision and rounding regime and order of operations, I could easily imagine the "equation" to be true ... and therefore a test that you were rounding "properly", even when it wasn't intuitive.

The third bullet-point above needs changing... (9^2+(19^2/22))=97.4090909091 which is close to pi to the fourth power, so it should be (as noted in the text) (9^2+(19^2/22))^1/4 Squirreltape (talk) 19:27, 25 February 2014 (UTC)

Actually, in-case you didn't notice, it says "∜(9² + 19²/22)", not just the sum on its own. I checked the sum on my calculator, and it is equal to what the page is saying. "∜(9² + 19²/22)" means "4th root of (9^2+19^2/22)" (What the title text is saying), or on Windows Calculator, "(9^2+19^2/22) yroot(4)" (Basically what the sum is saying). So, the 3rd bullet point is correct. --Katavschi (talk) 22:48, 23 April 2014 (UTC)

It says above that (π + 20)^i ≈ -i, but this should be (π + 20)^i ≈ -1. Proof: π + 20 ≈ e^π => (π + 20)^i ≈ (e^π)^i = e^(πi) = -1.

The ACM competitions are famous for being under tight time pressure. Making your own team waste time would absolutely get you kicked out (and make enemies) Mountain Hikes (talk) 04:40, 23 September 2015 (UTC)

"If they thought about the mathematics"

hm, are you saying it is obvious that e^ pi - pi is not 20? How would you know without approximating it? The sum of two irrationals is not necessarily irrational. 162.158.34.194 01:58, 26 October 2015 (UTC)

approximate e^pi using slightly bigger numbers than e and pi (say e: 2.7183 and pi: 3.1416) and subtract a value that is slightly smaller than pi (say 3.1415). The result is less than 20 and a upper limit for e^pi - pi 141.101.93.49 19:59, 22 August 2016 (UTC)

the title text was close; the real identity is e^(π - 2) = π 173.245.52.165 05:39, 7 April 2021 (UTC)

The approximation in the title text(the first quantity) is an approximation provided by Ramanujan. Sarah the Pie(yes, the food) (talk) 21:09, 22 February 2022 (UTC)