<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>The Endeavour &#187; Math</title>
	<atom:link href="http://www.johndcook.com/blog/category/math/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.johndcook.com/blog</link>
	<description>The blog of John D. Cook</description>
	<lastBuildDate>Fri, 10 Feb 2012 23:03:26 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.4</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Jinc function</title>
		<link>http://www.johndcook.com/blog/2012/02/01/jinc-function/</link>
		<comments>http://www.johndcook.com/blog/2012/02/01/jinc-function/#comments</comments>
		<pubDate>Thu, 02 Feb 2012 03:32:03 +0000</pubDate>
		<dc:creator>John</dc:creator>
				<category><![CDATA[Math]]></category>

		<guid isPermaLink="false">http://www.johndcook.com/blog/?p=10600</guid>
		<description><![CDATA[This afternoon I ran across the jinc function for the first time.
The sinc function is defined by
sinc(t) = sin(t) / t.
The jinc function is defined analogously by
jinc(t) = J1(t) / t
where J1 is a Bessel function. Bessel functions are analogous to sines, so the jinc function is analogous to the sinc function.
Here&#8217;s what the sinc [...]]]></description>
			<content:encoded><![CDATA[<p>This afternoon I ran across the <strong>jinc</strong> function for the first time.</p>
<p>The <strong>sinc</strong> function is defined by</p>
<p style="padding-left: 30px;">sinc(<em>t</em>) = sin(<em>t</em>) / <em>t</em>.</p>
<p>The<strong> jinc</strong> function is defined analogously by</p>
<p style="padding-left: 30px;">jinc(<em>t</em>) = J<sub>1</sub>(<em>t</em>) / <em>t</em></p>
<p>where J<sub>1</sub> is a Bessel function. Bessel functions are analogous to sines, so the <strong>jinc</strong> function is analogous to the <strong>sinc</strong> function.</p>
<p>Here&#8217;s what the <strong>sinc</strong> and <strong>jinc</strong> functions look like.</p>
<p><span id="more-10600"></span></p>
<p style="text-align:center"><img src="http://www.johndcook.com/sinc_jinc.png" alt="" width="400" height="271" /></p>
<p>The<strong> jinc</strong> function is not as common as the <strong>sinc</strong> function. For example, both Mathematica and SciPy have built-in functions for <strong>sinc</strong> but not for <strong>jinc</strong>. [There are actually two definitions of <strong>sinc</strong>. Mathematica uses the definition above, but SciPy uses sin(π<em>t</em>)/π<em>t</em>. The SciPy convention is more common in digital signal processing.]</p>
<p>As I write this, Wikipedia has an entry for <strong>sinc</strong> but not for <strong>jinc</strong>. Someone want to write one?</p>
<p>For small <em>t</em>, <strong>jinc</strong>(<em>t</em>) is approximately cos(<em>t</em>/2) / 2. This approximation has error O(<em>t</em><sup>4</sup>), so it&#8217;s very good for small <em>t</em>, useless for large <em>t</em>.</p>
<p style="text-align:center"><img src="http://www.johndcook.com/jinc_small_arg.png" alt="" width="400" height="271" /></p>
<p>For large values of <em>t</em>, <strong>jinc</strong>(<em>t</em>) is like a damped, shifted cosine. Specifically,</p>
<p style="text-align:center"><img src="http://www.johndcook.com/jinc_asymptotic.png" alt="\mbox{jinc}(t) \sim \cos\left( |t| - \frac{3\pi}{4}\right) \sqrt{\frac{2}{\pi |t|^3}}" width="232" height="51" /></p>
<p>with an error that decreases like O( |<em>t</em>|<sup>-2</sup> ).</p>
<p style="text-align:center"><img src="http://www.johndcook.com/jinc_large_arg.png" alt="" width="400" height="271" /></p>
<p>Like the <strong>sinc</strong> function, the <strong>jinc</strong> function has a simple Fourier transform. Both transforms are zero outside the interval [-1, 1]. Inside this interval, the transform of <strong>sinc</strong> is a constant, √(π/8). On the same interval, the transform of <strong>jinc</strong> is √(2/π) √(1 &#8211; ω<sup>2</sup>).</p>
<p><strong>Update</strong>: <a href="http://www.johndcook.com/blog/2012/02/02/how-to-compute-jincx/">How to compute jinc(x)</a></p>
<p><strong>Related posts</strong>:</p>
<p><a href="http://www.johndcook.com/blog/2010/09/15/visualize-bessel-functions/">How to visualize Bessel functions</a><br />
<a href="http://www.johndcook.com/blog/2010/09/27/diagram-of-bessel-functions/">Diagram of Bessel function relationships</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.johndcook.com/blog/2012/02/01/jinc-function/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Wiggle paradox</title>
		<link>http://www.johndcook.com/blog/2012/01/31/wiggle-paradox/</link>
		<comments>http://www.johndcook.com/blog/2012/01/31/wiggle-paradox/#comments</comments>
		<pubDate>Tue, 31 Jan 2012 13:10:54 +0000</pubDate>
		<dc:creator>John</dc:creator>
				<category><![CDATA[Math]]></category>

		<guid isPermaLink="false">http://www.johndcook.com/blog/?p=10574</guid>
		<description><![CDATA[Sometimes a graph looks wiggly because it&#8217;s actually quite flat.
This isn&#8217;t much of a paradox; the resolution is quite simple. A graph may look wiggly because the scale is wrong. If the graph is flat, graphing software may automatically choose narrow vertical range, accentuating noise in the graph. I haven&#8217;t heard a name for this, [...]]]></description>
			<content:encoded><![CDATA[<p>Sometimes a graph looks wiggly because it&#8217;s actually quite flat.</p>
<p>This isn&#8217;t much of a paradox; the resolution is quite simple. A graph may look wiggly because the scale is wrong. If the graph is flat, graphing software may automatically choose narrow vertical range, accentuating noise in the graph. I haven&#8217;t heard a name for this, though I imagine someone has given it a name.</p>
<p>Here&#8217;s an extreme example. The following graph was produced by the Mathematica command <code>Plot[Gamma[x+1] - x Gamma[x], {x, 0, 1}]</code>.</p>
<p style="text-align:center"><img src="http://www.johndcook.com/noise.png" alt="" width="400" height="224" /></p>
<p>This is unsettling the first time you run into it, until you notice the vertical scale. In theory, Γ(<em>x</em> + 1) and <em>x</em> Γ(<em>x</em>) are exactly equal. In practice, a computer returns slightly different values for the two functions for some arguments. The differences are on the order of 10<sup>-15</sup>, the limit of floating point precision. Mathematica looks at the range of the function being plotted and picks the default vertical scaling accordingly.</p>
<p>In the example above, the vertical scale is 15 orders of magnitude smaller than the horizontal scale. The line is smooth as glass. Actually, it&#8217;s <strong>much smoother than glass</strong>. An angstrom is only 10 orders of magnitude smaller than a meter, so you wouldn&#8217;t have to look at glass under nearly as much magnification before you see individual atoms. At a much grosser scale you&#8217;d see imperfections in the glass.</p>
<p>The graph above is so jagged that it demands our attention. When the horizontal axis is closer to the proper scale, say off by a factor of 5 or 10, the problem can be more subtle. Here&#8217;s an example that I ran across yesterday.</p>
<p style="text-align:center"><img src="http://www.johndcook.com/badscale.png" alt="" width="400" height="271" /></p>
<p>The curves look awfully jagged, but this is just simulation noise. The function values are probabilities, and when viewed on a scale of probabilities the curves look unremarkable.</p>
<p style="text-align:center"><img src="http://www.johndcook.com/goodscale.png" alt="" width="400" height="271" /></p>
]]></content:encoded>
			<wfw:commentRss>http://www.johndcook.com/blog/2012/01/31/wiggle-paradox/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>Boundary conditions are the hard part</title>
		<link>http://www.johndcook.com/blog/2012/01/24/boundary-conditions/</link>
		<comments>http://www.johndcook.com/blog/2012/01/24/boundary-conditions/#comments</comments>
		<pubDate>Tue, 24 Jan 2012 15:29:30 +0000</pubDate>
		<dc:creator>John</dc:creator>
				<category><![CDATA[Math]]></category>
		<category><![CDATA[Differential equations]]></category>

		<guid isPermaLink="false">http://www.johndcook.com/blog/?p=10490</guid>
		<description><![CDATA[What we call &#8220;differential equations&#8221; are usually not just differential equations. They also have associated initial conditions or boundary conditions.
With ordinary differential equations (ODEs), the initial conditions are often an afterthought. First you find a full set of solutions, then you plug in initial conditions to get a specific solution.
Partial differential equations (PDEs) have boundary [...]]]></description>
			<content:encoded><![CDATA[<p>What we call &#8220;differential equations&#8221; are usually not just differential equations. They also have associated initial conditions or boundary conditions.</p>
<p>With ordinary differential equations (ODEs), the initial conditions are often an afterthought. First you find a full set of solutions, then you plug in initial conditions to get a specific solution.</p>
<p>Partial differential equations (PDEs) have boundary conditions (and maybe initial conditions too). Since people typically learn ODEs first, they come to PDEs expecting boundary values to play a role analogous to ODEs. In a very limited sense they do, but in general boundary values are quite different.</p>
<p>The hard part about PDEs is not the PDEs themselves; the hard part is the boundary conditions. Finding solutions to differential equations in the interior of a domain is easy compared to making the equations have the specified behavior on the boundary.</p>
<p>No model can take everything into account. You have to draw some box around that part of the world that you&#8217;re going to model and specify what happens when your imaginary box meets the rest of the universe. That&#8217;s the hard part.</p>
<p><strong>Related posts</strong>:</p>
<p><a href="http://www.johndcook.com/blog/2011/01/07/three-views-of-differential-equations/">Three views of differential equations</a><br />
<a href="http://www.johndcook.com/blog/2012/01/04/nonlinear-is-not-a-hypothesis/">Nonlinear is not a hypothesis</a><br />
<a href="http://www.johndcook.com/blog/2009/08/11/approximating-a-solution-that-doesnt-exist/">Approximating a solution that does not exist</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.johndcook.com/blog/2012/01/24/boundary-conditions/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Oscillating Fibonacci ratios</title>
		<link>http://www.johndcook.com/blog/2012/01/20/oscillating-fibonacci-ratios/</link>
		<comments>http://www.johndcook.com/blog/2012/01/20/oscillating-fibonacci-ratios/#comments</comments>
		<pubDate>Fri, 20 Jan 2012 13:30:04 +0000</pubDate>
		<dc:creator>John</dc:creator>
				<category><![CDATA[Math]]></category>

		<guid isPermaLink="false">http://www.johndcook.com/blog/?p=10480</guid>
		<description><![CDATA[You may know that ratios of consecutive Fibonacci numbers tend to the golden ratio in the limit. But do know how they tend to the limit? The ratio oscillates, one above the golden ratio, the next below, each getting closer. The plot shows F(n+1) / F(n) where F(n) is the nth Fibonacci number. The height [...]]]></description>
			<content:encoded><![CDATA[<p>You may know that ratios of consecutive Fibonacci numbers tend to the golden ratio in the limit. But do know <em>how</em> they tend to the limit? The ratio oscillates, one above the golden ratio, the next below, each getting closer. The plot shows <em>F</em>(<em>n</em>+1) / <em>F</em>(<em>n</em>) where <em>F</em>(<em>n</em>) is the <em>n</em>th Fibonacci number. The height of the horizontal line is the golden ratio.</p>
<p style="text-align:center"><img src="http://www.johndcook.com/fibonacci_ratios.png" alt="plot" width="400" height="302" /></p>
<p>We can prove that the ratio oscillates by starting with the formula</p>
<p style="text-align:center"><img src="http://www.johndcook.com/fibonacci_formula.png" alt="F(n) = \frac{ \phi^n - (-1)^n \phi^{-n} }{ \sqrt{5} }" width="168" height="42" /></p>
<p>where φ = (1 + √5)/2 is the golden ratio.</p>
<p>From there we can work out that</p>
<p style="text-align:center"><img src="http://www.johndcook.com/fibonacci_ratio_phi_diff.png" alt="\frac{F(n+1)}{F(n)} - \phi = (-1)^n \frac{ \phi + \phi^{-1}}{\phi^{2n} + (-1)^{n+1}}" width="262" height="41" /></p>
<p>This shows that when <em>n</em> is odd, <em>F</em>(<em>n</em>+1) / <em>F</em>(<em>n</em>) is below the golden ratio and when <em>n</em> is even it is above. It also shows that the absolute error in approximating the golden ratio by <em>F</em>(<em>n</em>+1) / <em>F</em>(<em>n</em>) goes down by a factor of about φ<sup>2</sup> each time <em>n</em> increases by 1.</p>
<p><strong>Related posts</strong>:</p>
<p><a href="http://www.johndcook.com/blog/2008/02/15/honeybee-geneology/">Honeybee genealogy</a><br />
<a href="http://www.johndcook.com/blog/2008/04/23/fibonacci-numbers-at-work/">Fibonacci numbers at work</a><br />
<a href="http://www.johndcook.com/blog/2009/05/19/golden-ratio-rational-approximation/">Breastfeeding and the golden ratio</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.johndcook.com/blog/2012/01/20/oscillating-fibonacci-ratios/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>Six analysis and probability diagrams</title>
		<link>http://www.johndcook.com/blog/2012/01/17/six-math-diagrams/</link>
		<comments>http://www.johndcook.com/blog/2012/01/17/six-math-diagrams/#comments</comments>
		<pubDate>Tue, 17 Jan 2012 11:27:06 +0000</pubDate>
		<dc:creator>John</dc:creator>
				<category><![CDATA[Math]]></category>
		<category><![CDATA[Bayesian]]></category>
		<category><![CDATA[Probability and Statistics]]></category>
		<category><![CDATA[Special functions]]></category>

		<guid isPermaLink="false">http://www.johndcook.com/blog/?p=10263</guid>
		<description><![CDATA[Here are a few diagrams I&#8217;ve created that summarize relationships in analysis and probability. Click on a thumbnail image to go to a page with the full image and explanatory text.
Special functions

Gamma and related functions

Probability distributions

Conjugate priors

Convergence theorems

Bessel functions

]]></description>
			<content:encoded><![CDATA[<p>Here are a few diagrams I&#8217;ve created that summarize relationships in analysis and probability. Click on a thumbnail image to go to a page with the full image and explanatory text.</p>
<p><strong>Special functions</strong></p>
<p><a href="http://www.johndcook.com/special_function_diagram.html"><img class="alignnone" src="http://www.johndcook.com/special_function_diagram.png" alt="" width="200" /></a></p>
<p><strong>Gamma and related functions</strong></p>
<p><a href="http://www.johndcook.com/gamma_identities.html"><img class="alignnone" src="http://www.johndcook.com/gamma_identities.png" alt="" width="200" /></a></p>
<p><strong>Probability distributions</strong></p>
<p><a href="http://www.johndcook.com/distribution_chart.html"><img class="alignnone" src="http://www.johndcook.com/distribution_chart.gif" alt="" width="200" /></a></p>
<p><strong>Conjugate priors</strong></p>
<p><a href="http://www.johndcook.com/conjugate_prior_diagram.html"><img class="alignnone" src="http://www.johndcook.com/conjugate_prior_diagram.gif" alt="" width="200" /></a></p>
<p><strong>Convergence theorems</strong></p>
<p><a href="http://www.johndcook.com/modes_of_convergence.html"><img class="alignnone" src="http://www.johndcook.com/dominatedconvergence.gif" alt="" width="200" /></a></p>
<p><strong>Bessel functions</strong></p>
<p><a href="http://www.johndcook.com/Bessel_functions.html"><img class="alignnone" src="http://www.johndcook.com/bessel_diagram_min.png" alt="" width="200" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.johndcook.com/blog/2012/01/17/six-math-diagrams/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Roman numeral puzzle</title>
		<link>http://www.johndcook.com/blog/2012/01/14/roman-numeral-puzzle/</link>
		<comments>http://www.johndcook.com/blog/2012/01/14/roman-numeral-puzzle/#comments</comments>
		<pubDate>Sat, 14 Jan 2012 16:36:49 +0000</pubDate>
		<dc:creator>John</dc:creator>
				<category><![CDATA[Math]]></category>
		<category><![CDATA[Regular expressions]]></category>

		<guid isPermaLink="false">http://www.johndcook.com/blog/?p=10456</guid>
		<description><![CDATA[I noticed an ad for Super Bowl XLVI on a pizza box this morning. The Roman numeral XLVI does not repeat any character. This brought up a couple questions.

How many Roman numerals are possible if you&#8217;re not allowed to repeat a character?
Could you write a (reasonably short) regular expression to find all such numbers?

You can [...]]]></description>
			<content:encoded><![CDATA[<p>I noticed an ad for Super Bowl XLVI on a pizza box this morning. The Roman numeral XLVI does not repeat any character. This brought up a couple questions.</p>
<ul>
<li>How many Roman numerals are possible if you&#8217;re not allowed to repeat a character?</li>
<li>Could you write a (reasonably short) regular expression to find all such numbers?</li>
</ul>
<p>You can post your solutions to either question in the comments.</p>
<p>There has never been universal agreement on the rules for constructing Roman numerals, so your solution would depend on your choice of rules. For our purposes here, assume the valid characters are I, V, X, L, C, D, and M. Also, assume any character can be subtracted from a larger character. For example, you can assume IL is a valid representation of 49.</p>
<p>For a more challenging problem, you can use the more restrictive subtraction rules.</p>
<ol>
<li>I can be subtracted from V and X only.</li>
<li>X can be subtracted from L and C only.</li>
<li>C can be subtracted from D and M only.</li>
<li>V, L, and D can never be subtracted.</li>
</ol>
<p><strong>Other puzzle posts</strong>:</p>
<p><a href="http://www.johndcook.com/blog/2011/11/29/renaissance-math-problem/">A Renaissance math puzzle</a><br />
<a href="http://www.johndcook.com/blog/2010/01/14/technology-history-quiz/">Technology history quiz</a><br />
<a href="http://www.johndcook.com/blog/2011/03/07/a-little-math-puzzle/">A log puzzle</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.johndcook.com/blog/2012/01/14/roman-numeral-puzzle/feed/</wfw:commentRss>
		<slash:comments>25</slash:comments>
		</item>
		<item>
		<title>Nonlinear is not a hypothesis</title>
		<link>http://www.johndcook.com/blog/2012/01/04/nonlinear-is-not-a-hypothesis/</link>
		<comments>http://www.johndcook.com/blog/2012/01/04/nonlinear-is-not-a-hypothesis/#comments</comments>
		<pubDate>Wed, 04 Jan 2012 11:33:19 +0000</pubDate>
		<dc:creator>John</dc:creator>
				<category><![CDATA[Math]]></category>
		<category><![CDATA[Differential equations]]></category>

		<guid isPermaLink="false">http://www.johndcook.com/blog/?p=10378</guid>
		<description><![CDATA[I studied nonlinear PDEs in grad school. My advisor, Ralph Showalter, would remind us occasionally what &#8216;nonlinear&#8217; means.
&#8220;Nonlinear&#8221; is not a hypothesis but the lack of a hypothesis.
He meant a couple things by this. First, when people say &#8220;nonlinear,&#8221; they often mean &#8220;not necessarily linear.&#8221; That is, they use &#8220;nonlinear&#8221; as a generalization of linear. [...]]]></description>
			<content:encoded><![CDATA[<p>I studied nonlinear PDEs in grad school. My advisor, Ralph Showalter, would remind us occasionally what &#8216;nonlinear&#8217; means.</p>
<blockquote><p>&#8220;Nonlinear&#8221; is not a hypothesis but the lack of a hypothesis.</p></blockquote>
<p>He meant a couple things by this. First, when people say &#8220;nonlinear,&#8221; they often mean &#8220;not necessarily linear.&#8221; That is, they use &#8220;nonlinear&#8221; as a generalization of linear. If a statement doesn&#8217;t hold for linear equations, it can&#8217;t hold more generally. So try the linear case first.</p>
<p>Second, and more importantly, you usually have to specify in what way an equation is nonlinear before you can say anything useful. If you&#8217;re not assuming linearity, what <em>are</em> you assuming? Maybe you need to assume a function is convex. Or maybe you need to assume an upper or lower bound on a function&#8217;s growth. In any case, focus on what you <em>are</em> assuming rather than what you are <em>not</em> assuming, and make your assumptions explicit.</p>
<p><strong>Related post</strong>: <a href="http://www.johndcook.com/blog/tag/differential-equations/">Three views of differential equations</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.johndcook.com/blog/2012/01/04/nonlinear-is-not-a-hypothesis/feed/</wfw:commentRss>
		<slash:comments>9</slash:comments>
		</item>
		<item>
		<title>25% of 18th century science</title>
		<link>http://www.johndcook.com/blog/2012/01/03/25-of-18th-century-science/</link>
		<comments>http://www.johndcook.com/blog/2012/01/03/25-of-18th-century-science/#comments</comments>
		<pubDate>Tue, 03 Jan 2012 18:42:55 +0000</pubDate>
		<dc:creator>John</dc:creator>
				<category><![CDATA[Math]]></category>
		<category><![CDATA[History]]></category>

		<guid isPermaLink="false">http://www.johndcook.com/blog/?p=10316</guid>
		<description><![CDATA[According to historian Clifford Truesdell,
… in a listing of all of the mathematics, physics, mechanics, astronomy, and navigation work produced in the 18th century, a full 25% would have been written by Leonard Euler.
Source
Other posts about Euler:
Publish or perish
Even perfect numbers
Platonic solids end Euler&#8217;s formula
Mathematical genealogy 
]]></description>
			<content:encoded><![CDATA[<p>According to historian Clifford Truesdell,</p>
<blockquote><p>… in a listing of all of the mathematics, physics, mechanics, astronomy, and navigation work produced in the 18th century, a full 25% would have been written by Leonard Euler.</p></blockquote>
<p><a href="http://www.amazon.com/gp/product/0691152705/ref=as_li_ss_tl?ie=UTF8&amp;tag=theende-20&amp;linkCode=as2&amp;camp=1789&amp;creative=390957&amp;creativeASIN=0691152705">Source</a></p>
<p><strong>Other posts about Euler</strong>:</p>
<p><a href="http://www.johndcook.com/blog/2009/01/13/publish-or-perish/">Publish or perish</a><br />
<a href="http://www.johndcook.com/blog/2010/11/06/even-perfect-numbers/">Even perfect numbers</a><br />
<a href="http://www.johndcook.com/blog/2011/05/05/platonic-solids/">Platonic solids end Euler&#8217;s formula</a><br />
<a href="http://www.johndcook.com/blog/2009/10/06/mathematical-genealogy/">Mathematical genealogy </a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.johndcook.com/blog/2012/01/03/25-of-18th-century-science/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>By the nth day of Christmas</title>
		<link>http://www.johndcook.com/blog/2011/12/25/by-the-nth-day-of-christmas/</link>
		<comments>http://www.johndcook.com/blog/2011/12/25/by-the-nth-day-of-christmas/#comments</comments>
		<pubDate>Sun, 25 Dec 2011 16:27:25 +0000</pubDate>
		<dc:creator>John</dc:creator>
				<category><![CDATA[Math]]></category>

		<guid isPermaLink="false">http://www.johndcook.com/blog/?p=10304</guid>
		<description><![CDATA[By the nth day of Christmas, my true love had sent to me n(n+1)(n+2)/6 gifts.
Explanation and proof here.
]]></description>
			<content:encoded><![CDATA[<p>By the <em>n</em>th day of Christmas, my true love had sent to me <em>n</em>(<em>n</em>+1)(<em>n</em>+2)/6 gifts.</p>
<p>Explanation and proof <a href="http://www.johndcook.com/blog/2009/12/08/tetrahedral-numbers/">here</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.johndcook.com/blog/2011/12/25/by-the-nth-day-of-christmas/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Most popular math posts of 2011</title>
		<link>http://www.johndcook.com/blog/2011/12/19/most-popular-math-posts-of-2011/</link>
		<comments>http://www.johndcook.com/blog/2011/12/19/most-popular-math-posts-of-2011/#comments</comments>
		<pubDate>Mon, 19 Dec 2011 13:59:16 +0000</pubDate>
		<dc:creator>John</dc:creator>
				<category><![CDATA[Math]]></category>

		<guid isPermaLink="false">http://www.johndcook.com/blog/?p=10238</guid>
		<description><![CDATA[These have been my most popular math-related posts this year.

Slide rules
How to fit an elephant
Square root interview question
Five interesting things about Mersenne primes
A Bayesian view of Amazon Resellers

]]></description>
			<content:encoded><![CDATA[<p>These have been my most popular math-related posts this year.</p>
<ol>
<li><a href="http://www.johndcook.com/blog/2011/04/11/sliderules/">Slide rules</a></li>
<li><a href="http://www.johndcook.com/blog/2011/06/21/how-to-fit-an-elephant/">How to fit an elephant</a></li>
<li><a href="http://www.johndcook.com/blog/2011/06/23/square-root-interview-question/">Square root interview question</a></li>
<li><a href="http://www.johndcook.com/blog/2011/09/09/five-interesting-things-about-mersenne-primes/">Five interesting things about Mersenne primes</a></li>
<li><a href="http://www.johndcook.com/blog/2011/09/27/bayesian-amazon/">A Bayesian view of Amazon Resellers</a></li>
</ol>
]]></content:encoded>
			<wfw:commentRss>http://www.johndcook.com/blog/2011/12/19/most-popular-math-posts-of-2011/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Triangle party</title>
		<link>http://www.johndcook.com/blog/2011/12/10/triangle-party/</link>
		<comments>http://www.johndcook.com/blog/2011/12/10/triangle-party/#comments</comments>
		<pubDate>Sat, 10 Dec 2011 14:00:45 +0000</pubDate>
		<dc:creator>John</dc:creator>
				<category><![CDATA[Math]]></category>

		<guid isPermaLink="false">http://www.johndcook.com/blog/?p=10187</guid>
		<description><![CDATA[Vi Hart&#8217;s videos are amazing. Here&#8217;s her latest: 

Doodling in Math Class: Triangle Party
]]></description>
			<content:encoded><![CDATA[<p>Vi Hart&#8217;s videos are amazing. Here&#8217;s her latest: </p>
<p><iframe width="400" height="301" src="http://www.youtube.com/embed/o6KlpIWhbcw" frameborder="0" allowfullscreen></iframe></p>
<p><a href="http://youtu.be/o6KlpIWhbcw">Doodling in Math Class: Triangle Party</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.johndcook.com/blog/2011/12/10/triangle-party/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Solution to Renaissance problem</title>
		<link>http://www.johndcook.com/blog/2011/11/30/solution-to-renaissance-problem/</link>
		<comments>http://www.johndcook.com/blog/2011/11/30/solution-to-renaissance-problem/#comments</comments>
		<pubDate>Wed, 30 Nov 2011 13:27:44 +0000</pubDate>
		<dc:creator>John</dc:creator>
				<category><![CDATA[Math]]></category>

		<guid isPermaLink="false">http://www.johndcook.com/blog/?p=10099</guid>
		<description><![CDATA[The previous post presented a problem first posed by Johannes Müller in 1471.
Where you should stand so that a vertical bar appears longest?
To be more precise, suppose a vertical bar is hanging so that the top of the bar is a distance a above your eye level and the bottom is a distance b above [...]]]></description>
			<content:encoded><![CDATA[<p>The <a href="http://www.johndcook.com/blog/2011/11/29/renaissance-math-problem/">previous post</a> presented a problem first posed by Johannes Müller in 1471.</p>
<blockquote><p>Where you should stand so that a vertical bar appears longest?</p>
<p>To be more precise, suppose a vertical bar is hanging so that the top of the bar is a distance <em>a</em> above your eye level and the bottom is a distance <em>b</em> above your eye level. Let <em>x</em> be the horizontal distance to the bar. For what value of <em>x</em> does the bar appear longest?</p></blockquote>
<p>In the following diagram, we wish to maximize the angle θ.</p>
<p style="text-align:center"><img src="http://www.johndcook.com/muller.png" alt="" width="350" height="236" /></p>
<p>Since tangent is an increasing function, it suffices to maximize tan(θ). Let α = θ + β. Then</p>
<p style="text-align:center"><img src="http://www.johndcook.com/muller_tangent.png" alt="\tan\theta = \tan(\alpha - \beta) = \frac{\tan\alpha - \tan \beta}{1 + \tan\alpha \tan\beta}" width="266" height="40" /></p>
<p>Now use tan α = <em>a</em>/<em>x</em> and tan β = <em>b</em>/<em>x</em> to reduce the expression above to</p>
<p style="text-align:center"><img src="http://www.johndcook.com/muller_tangent2.png" alt="\frac{(a-b)x}{x^2 + ab}" width="61" height="38" /></p>
<p>Now we have a function of <em>x</em> to maximize. Take the derivative and find where it is zero. The maximum occurs at √<em>ab</em>, the geometric mean of <em>a</em> and <em>b</em>.</p>
<p>However, when Müller proposed his problem in 1471, calculus had not yet been invented, so we can be pretty sure Müller did not take derivatives. I don&#8217;t know how (or even if) Müller solved his problem, but the <a href="http://www.amazon.com/gp/product/0883853426/ref=as_li_ss_tl?ie=UTF8&amp;tag=theende-20&amp;linkCode=as2&amp;camp=217145&amp;creative=399373&amp;creativeASIN=0883853426">book</a> where I found the problem showed how it could be solved without calculus. The derivation is a little longer, but it only depends on simple algebra and the arithmetic-geometric mean inequality, i.e. the observation that (<em>a</em> + <em>b</em>) /2 ≥ √<em>ab</em>.</p>
<p><strong>Update</strong>: Here is a purely geometric solution by <a href="http://www.johndcook.com/GeometricSolutionToMullersProblem.pdf"><span>George Papademetriou</span></a>.</p>
<p><strong>Update</strong>: See <a href="http://thonyc.wordpress.com/2011/12/08/the-story-of-a-problem/">this post</a> for more historical background.</p>
<p><strong>Other posts about the geometric mean</strong>:</p>
<p><a href="http://www.johndcook.com/blog/2009/03/23/inequalities-means/">Means and inequalities</a><br />
<a href="http://www.johndcook.com/blog/2010/11/15/the-middle-size-of-the-universe/">The middle size of the universe</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.johndcook.com/blog/2011/11/30/solution-to-renaissance-problem/feed/</wfw:commentRss>
		<slash:comments>11</slash:comments>
		</item>
		<item>
		<title>A Renaissance math puzzle</title>
		<link>http://www.johndcook.com/blog/2011/11/29/renaissance-math-problem/</link>
		<comments>http://www.johndcook.com/blog/2011/11/29/renaissance-math-problem/#comments</comments>
		<pubDate>Tue, 29 Nov 2011 15:00:10 +0000</pubDate>
		<dc:creator>John</dc:creator>
				<category><![CDATA[Math]]></category>

		<guid isPermaLink="false">http://www.johndcook.com/blog/?p=10064</guid>
		<description><![CDATA[In 1471, Johannes Müller asked where you should stand so that a vertical bar appears longest.
To be more precise, suppose a vertical bar is hanging so that the top of the bar is a distance a above your eye level and the bottom is a distance b above your eye level. Let x be the [...]]]></description>
			<content:encoded><![CDATA[<p>In 1471, Johannes Müller asked where you should stand so that a vertical bar appears longest.</p>
<p>To be more precise, suppose a vertical bar is hanging so that the top of the bar is a distance <em>a</em> above your eye level and the bottom is a distance <em>b</em> above your eye level. Let <em>x</em> be the horizontal distance to the bar. For what value of <em>x</em> does the bar appear longest?</p>
<p>Note that the apparent length of the bar is determined by the size of the angle between your lines of sight to the top and bottom of the bar.</p>
<p>Please don&#8217;t give solutions in the comments. I&#8217;ll post my solution tomorrow, and you can give your solutions in the comments to that post if you&#8217;d like.</p>
<p><a href="http://www.amazon.com/gp/product/0883853426/ref=as_li_ss_tl?ie=UTF8&amp;tag=theende-20&amp;linkCode=as2&amp;camp=217145&amp;creative=399373&amp;creativeASIN=0883853426">Source</a></p>
<p><strong>Update</strong>: See <a href="http://thonyc.wordpress.com/2011/12/08/the-story-of-a-problem/">this post</a> for more historical background.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.johndcook.com/blog/2011/11/29/renaissance-math-problem/feed/</wfw:commentRss>
		<slash:comments>12</slash:comments>
		</item>
		<item>
		<title>Fermat&#8217;s unfinished business</title>
		<link>http://www.johndcook.com/blog/2011/11/23/fermats-unfinished-business/</link>
		<comments>http://www.johndcook.com/blog/2011/11/23/fermats-unfinished-business/#comments</comments>
		<pubDate>Wed, 23 Nov 2011 13:13:48 +0000</pubDate>
		<dc:creator>John</dc:creator>
				<category><![CDATA[Math]]></category>
		<category><![CDATA[Number theory]]></category>

		<guid isPermaLink="false">http://www.johndcook.com/blog/?p=9901</guid>
		<description><![CDATA[Fermat&#8217;s last theorem is so named because it was the last of his asserted theorems to be proved or disproved. But there are variations on another conjectures of Fermat that remain unresolved.
Fermat conjectured that numbers

are always prime. We now call these &#8220;Fermat numbers.&#8221; Fermat knew that the first five, F0 through F4, were all prime.
In [...]]]></description>
			<content:encoded><![CDATA[<p>Fermat&#8217;s last theorem is so named because it was the last of his asserted theorems to be proved or disproved. But there are variations on another conjectures of Fermat that remain unresolved.</p>
<p>Fermat conjectured that numbers</p>
<p style="text-align:center"><img src="http://www.johndcook.com/fermat_number.png" alt="F_n = 2^{2^n} + 1" width="93" height="20" /></p>
<p>are always prime. We now call these &#8220;Fermat numbers.&#8221; Fermat knew that the first five, F<sub>0</sub> through F<sub>4</sub>, were all prime.</p>
<p>In some ways, this conjecture failed spectacularly. Euler showed in 1732 that the next number in the sequence, F<sub>5</sub>, is not prime by factoring it into 641 × 6700417. So are all the Fermat numbers prime? No.</p>
<p>But that&#8217;s not the end of the story. Now we go back and refine Fermat&#8217;s conjecture. Instead of asking whether <em>all</em> <em>F<sub>n</sub></em> are prime, we could ask <em>which</em> <em>F<sub>n</sub></em> are prime.</p>
<p>The next several values, <em>F</em><sub>5</sub> through <em>F</em><sub>32</sub>, are all known to be composite. So we might turn Fermat&#8217;s original conjecture around: are all <em>F<sub>n</sub></em> composite (for <em>n</em> &gt; 4)? Nobody knows.</p>
<p>Well, let&#8217;s try weakening the conjecture. Is <em>F<sub>n</sub></em> composite for infinitely many values of <em>n</em>? Nobody knows. Is <em>F<sub>n</sub></em> prime for infinitely many values of <em>n</em>? Nobody knows that either, though at least one of these two statements <em>must</em> be true!</p>
<p>Here&#8217;s why I find all this interesting.</p>
<ol>
<li>It shows how proof by example fails. Fermat knew that the first five numbers in his series were prime. It was reasonable to guess from this that the rest might be prime, though that turned out not to be the case.</li>
<li>It shows how what appears to be a dead end can be opened back up with a small refinement of the original question.</li>
<li>Like many questions in number theory, the revised question is easy to state but has defied proof for centuries.</li>
</ol>
]]></content:encoded>
			<wfw:commentRss>http://www.johndcook.com/blog/2011/11/23/fermats-unfinished-business/feed/</wfw:commentRss>
		<slash:comments>13</slash:comments>
		</item>
		<item>
		<title>Surprising applications of math</title>
		<link>http://www.johndcook.com/blog/2011/11/17/surprising-applications-of-math/</link>
		<comments>http://www.johndcook.com/blog/2011/11/17/surprising-applications-of-math/#comments</comments>
		<pubDate>Fri, 18 Nov 2011 00:29:57 +0000</pubDate>
		<dc:creator>John</dc:creator>
				<category><![CDATA[Math]]></category>

		<guid isPermaLink="false">http://www.johndcook.com/blog/?p=9984</guid>
		<description><![CDATA[The comments in the previous post touched on surprising applications of math, so I thought I&#8217;d expand this theme into it&#8217;s own post. Below I&#8217;ll give a couple general examples of surprising applications and then I&#8217;ll give a couple more personal applications I found surprising.
Number theory has traditionally been the purest of pure mathematics. People [...]]]></description>
			<content:encoded><![CDATA[<p>The comments in the <a href="http://www.johndcook.com/blog/2011/11/17/when-are-we-ever-going-to-use-this/">previous post</a> touched on surprising applications of math, so I thought I&#8217;d expand this theme into it&#8217;s own post. Below I&#8217;ll give a couple general examples of surprising applications and then I&#8217;ll give a couple more personal applications I found surprising.</p>
<p><strong>Number theory</strong> has traditionally been the purest of pure mathematics. People study number theory for the joy of doing so, not to make money. At least that was largely true until the advent of public key cryptography. The difficulty of solving certain number theory problems now ensures the difficulty of decrypting private communication, or so we hope. (By the way, I&#8217;ve always thought Euler deserved part of the credit for the RSA encryption scheme. Maybe it should be called RSAE encryption. R, S, and A came up with the brilliant idea to apply E&#8217;s theorem to cryptography.)</p>
<p><strong>Non-euclidean geometry</strong> started as a pure mathematical abstraction. Of course the physical world is Euclidean, but let&#8217;s see what happens if we monkey with Euclid&#8217;s fifth postulate. Then along came Einstein and suddenly the real world is non-Euclidean.</p>
<p>One personal application of math that I found surprising was using <strong>Fibonacci numbers</strong> in practical computation. Computing Fibonacci numbers is a computer science cliché, but I actually needed to compute Fibonacci numbers for a numerical integration problem. I wrote up the details in <a href="http://www.johndcook.com/blog/2008/04/23/fibonacci-numbers-at-work/">Fibonacci numbers at work</a>.</p>
<p>Another application that surprised me was using the <strong>trapezoid rule</strong> for real work. The trapezoid rule is a crude numerical integration technique. It&#8217;s good for teaching because it&#8217;s very simple, but it&#8217;s not very accurate. Or so I thought. It&#8217;s not very accurate in general, but in the right circumstances, it can be extraordinarily accurate. I explain more in <a href="http://www.johndcook.com/blog/2010/12/02/three-surprises-with-the-trapezoid-rule/">Three surprises with the trapezoid rule</a>.</p>
<p>One surprising non-application has been <strong>differential equations</strong>. For the past three centuries, differential equations have been at the heart of applied math. One could argue that to first approximation, applied math equals differential equations and supporting material. But I personally have not had nearly as much opportunity to use differential equations professionally as I expected, even though that was my specialization in grad school.</p>
<p><strong>Related posts</strong>:<br />
<a href="http://www.johndcook.com/blog/2010/01/20/ten-surprises-from-numerical-linear-algebra/"><br />
Ten surprises in numerical linear algebra</a><br />
<a href="http://www.johndcook.com/blog/2011/06/15/impure-math/">Impure math</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.johndcook.com/blog/2011/11/17/surprising-applications-of-math/feed/</wfw:commentRss>
		<slash:comments>13</slash:comments>
		</item>
		<item>
		<title>Poor Mercator</title>
		<link>http://www.johndcook.com/blog/2011/11/14/poor-mercator/</link>
		<comments>http://www.johndcook.com/blog/2011/11/14/poor-mercator/#comments</comments>
		<pubDate>Mon, 14 Nov 2011 13:47:32 +0000</pubDate>
		<dc:creator>John</dc:creator>
				<category><![CDATA[Math]]></category>
		<category><![CDATA[Geodesy]]></category>

		<guid isPermaLink="false">http://www.johndcook.com/blog/?p=9946</guid>
		<description><![CDATA[This morning&#8217;s xkcd cartoon is &#8220;What your favorite map projection says about you.&#8221; It&#8217;s really funny, but poor Mercator comes off as the most boring projection.

Mercator is the most familiar projection, but it has some interesting properties. The most important is that lines of constant bearing on the Earth correspond to straight lines on the [...]]]></description>
			<content:encoded><![CDATA[<p>This morning&#8217;s <a href="http://xkcd.com/977/">xkcd</a> cartoon is &#8220;What your favorite map projection says about you.&#8221; It&#8217;s really funny, but poor Mercator comes off as the most boring projection.</p>
<p style="text-align:center"><a href="http://xkcd.com/977/"><img src="http://www.johndcook.com/mercator_xkcd.png" alt="Mercator: You're not really into maps" width="286" height="311" /></a></p>
<p>Mercator is the most familiar projection, but it has some interesting properties. The most important is that lines of constant bearing on the Earth correspond to straight lines on the map, obviously a desirable property for navigation. More details <a href="http://www.johndcook.com/blog/2009/09/15/mercator-projection/">here</a>.</p>
<p>The inverse of the Mercator projection, going from maps onto the globe, is more interesting. Aside from its geographical importance, it gives a way of relating circular and hyperbolic functions without using complex numbers. More details <a href="http://www.johndcook.com/blog/2009/09/21/gudermannian/">here</a>.</p>
<p>The Mercator projection is also historically interesting. The modern <a href="http://www.johndcook.com/blog/2009/09/15/mercator-projection/">derivation</a> of the Mercator projection uses logarithms and calculus, but Mercator came up with his projection in 1569 before logarithms or calculus had been discovered. (Update: See more historical detail in Thony C&#8217;s <a href="http://www.johndcook.com/blog/2011/11/14/poor-mercator/comment-page-1/#comment-114778">comment</a> below.)</p>
]]></content:encoded>
			<wfw:commentRss>http://www.johndcook.com/blog/2011/11/14/poor-mercator/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>Richard Feynman and Captain Picard try to prove Fermat&#8217;s Last Theorem</title>
		<link>http://www.johndcook.com/blog/2011/11/09/feynman-fermat-and-picard/</link>
		<comments>http://www.johndcook.com/blog/2011/11/09/feynman-fermat-and-picard/#comments</comments>
		<pubDate>Thu, 10 Nov 2011 01:29:23 +0000</pubDate>
		<dc:creator>John</dc:creator>
				<category><![CDATA[Math]]></category>
		<category><![CDATA[Number theory]]></category>

		<guid isPermaLink="false">http://www.johndcook.com/blog/?p=9903</guid>
		<description><![CDATA[In 1989, Star Trek: The Next Generation aired The Royale. In this episode, we learn that Captain Picard tries his hand at proving Fermat&#8217;s Last Theorem (FLT) in his spare time. The writers must have believed that FLT would still be unresolved in the 24th century. Four years after The Royale, Andrew Wiles announced his [...]]]></description>
			<content:encoded><![CDATA[<p>In 1989, <em>Star Trek: The Next Generation</em> aired <a href="http://www.startrek.com/database_article/royale-the">The Royale</a>. In this episode, we learn that Captain Picard tries his hand at proving Fermat&#8217;s Last Theorem (FLT) in his spare time. The writers must have believed that FLT would still be unresolved in the 24th century. Four years after The Royale, Andrew Wiles announced his proof of FLT. There was a flaw in Wiles&#8217; first proof, but this was patched two years later in 1995.</p>
<p>Richard Feynman also tried his hand at FLT. He wrote a paper (unpublished) in which he gave a pseudo-proof of FLT based on probability. Feynman said that the probability of FLT being false was &#8220;certainly less than 10^-200.&#8221; The argument was high creative, sketchy, but ultimately nonsensical. Paul Nahin concludes</p>
<blockquote><p>Feynman&#8217;s probabilistic analysis of Fermat&#8217;s Last Theorem would have no mathematical interest at all but for the fact it was Feynman who cooked it up.</p></blockquote>
<p>Source: <a href="http://www.amazon.com/gp/product/0691144257/ref=as_li_ss_tl?ie=UTF8&amp;tag=theende-20&amp;linkCode=as2&amp;camp=217145&amp;creative=399373&amp;creativeASIN=0691144257">Number-Crunching</a> by Paul Nahin.</p>
<p><a href="http://www.amazon.com/gp/product/0691144257/ref=as_li_ss_il?ie=UTF8&amp;tag=theende-20&amp;linkCode=as2&amp;camp=217145&amp;creative=399373&amp;creativeASIN=0691144257"><img src="http://ws.assoc-amazon.com/widgets/q?_encoding=UTF8&amp;Format=_SL160_&amp;ASIN=0691144257&amp;MarketPlace=US&amp;ID=AsinImage&amp;WS=1&amp;tag=theende-20&amp;ServiceVersion=20070822" border="0" alt="" /></a><img style="border:none !important; margin:0px !important;" src="http://www.assoc-amazon.com/e/ir?t=theende-20&amp;l=as2&amp;o=1&amp;a=0691144257&amp;camp=217145&amp;creative=399373" border="0" alt="" width="1" height="1" /></p>
]]></content:encoded>
			<wfw:commentRss>http://www.johndcook.com/blog/2011/11/09/feynman-fermat-and-picard/feed/</wfw:commentRss>
		<slash:comments>12</slash:comments>
		</item>
		<item>
		<title>Lucky trig identity</title>
		<link>http://www.johndcook.com/blog/2011/11/09/lucky-trig-identity/</link>
		<comments>http://www.johndcook.com/blog/2011/11/09/lucky-trig-identity/#comments</comments>
		<pubDate>Wed, 09 Nov 2011 14:03:34 +0000</pubDate>
		<dc:creator>John</dc:creator>
				<category><![CDATA[Math]]></category>

		<guid isPermaLink="false">http://www.johndcook.com/blog/?p=9898</guid>
		<description><![CDATA[I love this trig identity. I could imagine a student believing it for the wrong reason, a grader  counting it wrong for the wrong reason, and a teacher counting it  right for the right reason.
sin(x &#8211; y) sin(x + y) = (sin(x) &#8211; sin(y)) (sin(x) + sin(y))
Someone manipulating symbols unknowingly might think this [...]]]></description>
			<content:encoded><![CDATA[<p>I love this trig identity. I could imagine a student believing it for the wrong reason, a grader  counting it wrong for the wrong reason, and a teacher counting it  right for the right reason.</p>
<p style="padding-left: 30px;">sin(x &#8211; y) sin(x + y) = (sin(x) &#8211; sin(y)) (sin(x) + sin(y))</p>
<p>Someone manipulating symbols unknowingly might think this is obviously true: of course you can replace sin(x + y) with sin(x) + sin(y) and replace sin(x &#8211; y) with sin(x) &#8211; sin(y). All the world is linear.</p>
<p>Someone with a little more experience would say that this identity obviously cannot be true. After all, sin(x ± y) clearly does not equal sin(x) ± sin(y).</p>
<p>But someone with a little more patience might get a pencil and paper and work out that it indeed is true. Even though naive symbol manipulation would be wrong-headed, in this case it happens to lead you to the right result.</p>
<p>For more examples of a novice and an expert agreeing but someone in between disagreeing, see <a href="http://www.johndcook.com/blog/2011/01/25/coming-full-circle/">Coming full circle</a>.</p>
<p><strong>Related posts</strong>:</p>
<p><a href="http://www.johndcook.com/blog/2009/09/25/how-many-trig-functions/">How many trig functions are there?</a><br />
<a href="http://www.johndcook.com/blog/2008/11/30/tangent-identity/">When does the sum of three numbers equal their product?</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.johndcook.com/blog/2011/11/09/lucky-trig-identity/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>Firsthand knowledge</title>
		<link>http://www.johndcook.com/blog/2011/11/06/firsthand-knowledge/</link>
		<comments>http://www.johndcook.com/blog/2011/11/06/firsthand-knowledge/#comments</comments>
		<pubDate>Sun, 06 Nov 2011 21:37:56 +0000</pubDate>
		<dc:creator>John</dc:creator>
				<category><![CDATA[Math]]></category>
		<category><![CDATA[Software development]]></category>
		<category><![CDATA[Books]]></category>
		<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://www.johndcook.com/blog/?p=9866</guid>
		<description><![CDATA[From C. S. Lewis:
It has always therefore been one of my main endeavors as a teacher to persuade the young that firsthand knowledge is not only more worth acquiring than secondhand knowledge, but it usually much easier and more delightful to acquire.
This quote comes from the essay On the Reading of Old Books, part of [...]]]></description>
			<content:encoded><![CDATA[<p>From C. S. Lewis:</p>
<blockquote><p>It has always therefore been one of my main endeavors as a teacher to persuade the young that firsthand knowledge is not only more worth acquiring than secondhand knowledge, but it usually much easier and more delightful to acquire.</p></blockquote>
<p>This quote comes from the essay <em>On the Reading of Old Books</em>, part of the collection <a href="http://www.amazon.com/gp/product/0802808689/ref=as_li_ss_tl?ie=UTF8&amp;tag=theende-20&amp;linkCode=as2&amp;camp=217145&amp;creative=399369&amp;creativeASIN=0802808689">God in the Dock: Essays on Theology and Ethics</a>. Lewis says here that it is easier to read Plato or St. Paul, for example, than to read books <em>about</em> Plato or St. Paul.  Lewis says that the fear of reading great authors</p>
<blockquote><p>… springs from humility. The student is half afraid to meet one of the great philosophers face to face. He feels himself inadequate and thinks he will not understand him. But if he only knew, the great man, just because of his greatness, is much more intelligible than his modern commentators.</p></blockquote>
<p>This does not only apply to literature. I see the same theme in math. Sometimes <a href="http://www.johndcook.com/blog/2009/02/14/old-math-books/">early math papers</a> are easier to read because they are more concrete. When I was a postdoc at Vanderbilt I asked <a href="http://en.wikipedia.org/wiki/Richard_Arenstorf">Richard Arenstorf</a> about a theorem attributed to him in a book I was reading.  He scoffed that he didn&#8217;t recognize it. He had done his work in a relatively concrete setting and did not approve of the fancy window dressing the author had placed around his theorem. I sat in on a few lectures by Arenstorf and found them amazingly clear.</p>
<p>The same theme appears in software development. Sometimes you can dive to the bottom of an abstraction hierarchy and find that things are simpler there than you would have supposed. The intervening layers obscure the substance of the program, making its core seem unduly mysterious. Like a mediocre mind commenting on the work of a great mind, developers who build layers of software around core functionality intend to make things easier but may do the opposite.</p>
<p><strong>Related posts</strong>:</p>
<p><a href="http://www.johndcook.com/blog/2010/07/05/endless-preparation/">Endless preparation</a><br />
<a href="http://www.johndcook.com/blog/2009/10/14/opening-black-boxes/">Opening black boxes</a><br />
<a href="http://www.johndcook.com/blog/2009/08/16/why-shakespeare-is-hard-to-read/">Why Shakespeare is hard to read</a><br />
<a href="http://www.johndcook.com/blog/2009/01/19/c-s-lewis-on-reading-old-books/">C. S. Lewis on reading old books</a><a href="http://www.johndcook.com/blog/2009/02/14/old-math-books/"></a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.johndcook.com/blog/2011/11/06/firsthand-knowledge/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>Shortest network in 3D</title>
		<link>http://www.johndcook.com/blog/2011/11/03/shortest-network-in-3d/</link>
		<comments>http://www.johndcook.com/blog/2011/11/03/shortest-network-in-3d/#comments</comments>
		<pubDate>Fri, 04 Nov 2011 01:00:00 +0000</pubDate>
		<dc:creator>John</dc:creator>
				<category><![CDATA[Math]]></category>

		<guid isPermaLink="false">http://www.johndcook.com/blog/?p=9851</guid>
		<description><![CDATA[Imagine a set of points in three dimensions. You want to connect the points with the shortest possible network. Sometimes you can make the network shorter by adding extra points. (These extra points are called Steiner points.) How much can extra points help? The answer is worth $1,000.
Here&#8217;s an example. Suppose our points are the [...]]]></description>
			<content:encoded><![CDATA[<p>Imagine a set of points in three dimensions. You want to connect the points with the shortest possible network. Sometimes you can make the network shorter by adding extra points. (These extra points are called <a href="http://en.wikipedia.org/wiki/Steiner_point">Steiner points</a>.) How much can extra points help? The answer is worth $1,000.</p>
<p>Here&#8217;s an example. Suppose our points are the corners of a unit cube. You can connect these points with a network of length 7. If you add a point in the center of the cube and connect every point to the center, you get a network of length 4 √ 3 = 6.928. So in this case, adding an extra point made it possible to reduce the size of the minimal spanning network by about 1%. You could do better by adding more points.</p>
<p>What is the most you can reduce the length of the minimum spanning network in three dimensions by adding extra points? The question concerns all possible sets of points, not just a particular set like the example above. It is conjectured that the most you can save is about 21.6%. That is, for any set of points, the ratio of the length of the shortest network with extra points to that of the shortest network without extra points is bounded below by</p>
<p style="text-align:center"><img src="http://www.johndcook.com/steiner3d.png" alt="\sqrt{ \frac{283-3\sqrt{21}}{700} + \frac{9\sqrt{11 - \sqrt{21}}\sqrt{2}}{140}}" width="242" height="52" /></p>
<p>In their new book <a href="http://www.amazon.com/gp/product/0691151644/ref=as_li_ss_tl?ie=UTF8&amp;tag=theende-20&amp;linkCode=as2&amp;camp=217145&amp;creative=399373&amp;creativeASIN=0691151644">Magical Mathematics</a>, Persi Diaconis and Ron Graham say &#8220;We currently offer a thousand dollars for a proof (or disproof) that this ratio is the best possible.&#8221;</p>
<p>As unwieldy as the number above appears, it makes some sense. It looks like the square roots come from repeated applications of the Pythagorean theorem. Someone may be able to reverse engineer the example the conjecture is based on by using the form of the proposed lower bound. </p>
<p>(Diaconis and Graham say that the corresponding problem in two dimensions have been solved and the optimal ratio is &radic; 3 / 2. However, <a href="http://www.springerlink.com/content/4433031487u14777/">this paper</a> says that the conjecture is still unresolved, contrary to popular belief.)</p>
]]></content:encoded>
			<wfw:commentRss>http://www.johndcook.com/blog/2011/11/03/shortest-network-in-3d/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>You ought to give the kid a chance</title>
		<link>http://www.johndcook.com/blog/2011/11/02/you-ought-to-give-him-a-chance/</link>
		<comments>http://www.johndcook.com/blog/2011/11/02/you-ought-to-give-him-a-chance/#comments</comments>
		<pubDate>Thu, 03 Nov 2011 01:35:47 +0000</pubDate>
		<dc:creator>John</dc:creator>
				<category><![CDATA[Math]]></category>
		<category><![CDATA[Books]]></category>

		<guid isPermaLink="false">http://www.johndcook.com/blog/?p=9840</guid>
		<description><![CDATA[Martin Gardner (1914 – 2010) was best known for his articles on recreational mathematics, especially his column in Scientific American which he wrote from 1956 to 1981. Once Gardner wrote a letter of recommendation for a young man applying to graduate school at Harvard.
I don&#8217;t know a lot about mathematics, but this kid invented two [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://en.wikipedia.org/wiki/Martin_Gardner">Martin Gardner</a> (1914 – 2010) was best known for his articles on recreational mathematics, especially his column in Scientific American which he wrote from 1956 to 1981. Once Gardner wrote a letter of recommendation for a young man applying to graduate school at Harvard.</p>
<blockquote><p>I don&#8217;t know a lot about mathematics, but this kid invented two of the best card tricks of the last ten years. You ought to give him a chance.</p></blockquote>
<p>The kid was <a href="http://en.wikipedia.org/wiki/Persi_Diaconis">Persi Diaconis</a>. At the time, Diaconis, like Gardner, was something of a mathematical outsider, someone with more creativity than credentials. Diaconis went on to become a mathematics professor at Harvard and won two MacArthur genius awards. He is now a professor at Stanford.</p>
<p>Source: <a href="http://www.amazon.com/gp/product/0691151644/ref=as_li_ss_tl?ie=UTF8&amp;tag=theende-20&amp;linkCode=as2&amp;camp=217145&amp;creative=399373&amp;creativeASIN=0691151644">Magical Mathematics</a></p>
<p><a href="http://www.amazon.com/gp/product/0691151644/ref=as_li_ss_il?ie=UTF8&amp;tag=theende-20&amp;linkCode=as2&amp;camp=217145&amp;creative=399373&amp;creativeASIN=0691151644"><img src="http://ws.assoc-amazon.com/widgets/q?_encoding=UTF8&amp;Format=_SL160_&amp;ASIN=0691151644&amp;MarketPlace=US&amp;ID=AsinImage&amp;WS=1&amp;tag=theende-20&amp;ServiceVersion=20070822" border="0" alt="" /></a><img style="border:none !important; margin:0px !important;" src="http://www.assoc-amazon.com/e/ir?t=theende-20&amp;l=as2&amp;o=1&amp;a=0691151644&amp;camp=217145&amp;creative=399373" border="0" alt="" width="1" height="1" /></p>
]]></content:encoded>
			<wfw:commentRss>http://www.johndcook.com/blog/2011/11/02/you-ought-to-give-him-a-chance/feed/</wfw:commentRss>
		<slash:comments>9</slash:comments>
		</item>
		<item>
		<title>Floating point error is the least of my worries</title>
		<link>http://www.johndcook.com/blog/2011/11/01/floating-point-worries/</link>
		<comments>http://www.johndcook.com/blog/2011/11/01/floating-point-worries/#comments</comments>
		<pubDate>Tue, 01 Nov 2011 12:00:13 +0000</pubDate>
		<dc:creator>John</dc:creator>
				<category><![CDATA[Math]]></category>
		<category><![CDATA[Software development]]></category>

		<guid isPermaLink="false">http://www.johndcook.com/blog/?p=9825</guid>
		<description><![CDATA[&#8220;Nothing brings fear to my heart more than a floating point number.&#8221; &#8212; Gerald Jay Sussman
The context of the above quote was Sussman&#8217;s presentation We really don&#8217;t know how to compute. It was a great presentation and I&#8217;m very impressed by Sussman. But I take exception to his quote.
I believe what he meant by his [...]]]></description>
			<content:encoded><![CDATA[<p>&#8220;Nothing brings fear to my heart more than a floating point number.&#8221; &#8212; Gerald Jay Sussman</p>
<p>The context of the above quote was Sussman&#8217;s presentation <a href="http://www.infoq.com/presentations/We-Really-Dont-Know-How-To-Compute">We really don&#8217;t know how to compute</a>. It was a great presentation and I&#8217;m very impressed by Sussman. But I take exception to his quote.</p>
<p>I believe what he meant by his quote was that he finds floating point arithmetic unsettling because it is not as easy to rigorously understand as integer arithmetic. Fair enough. Floating point arithmetic can be tricky. Things can go spectacularly bad for reasons that catch you off guard if you&#8217;re unprepared. But I&#8217;ve been doing numerical programming long enough that I believe I know where the landmines are and how to stay away from them. And even if I&#8217;m wrong, I have bigger worries.</p>
<p>Nothing brings fear to my heart more than <strong>modeling error</strong>.</p>
<p>The weakest link in applied math is often the step of turning a physical problem into a mathematical problem.  We begin with a raft of assumptions that are educated guesses. We know these assumptions can&#8217;t be exactly correct, but we suspect (hope) that the deviations from reality are small enough that they won&#8217;t invalidate the conclusions. In any case, these assumptions are usually far more questionable than the assumption that floating point arithmetic is sufficiently accurate.</p>
<p>Modeling error is usually several orders of magnitude greater than floating point error. People who nonchalantly model the real world and then sneer at floating point as <a href="http://www.johndcook.com/blog/2011/09/30/just-an-approximation/">just an approximation</a> strain at gnats and swallow camels.</p>
<p>In between modeling error and floating point error on my scale of worries is <strong>approximation error</strong>. As <a href="http://people.maths.ox.ac.uk/trefethen/">Nick Trefethen</a> has said, if computers were suddenly able to do arithmetic with perfect accuracy, 90% of numerical analysis would remain important.</p>
<p>To illustrate the difference between modeling error, approximation error, and floating point error, suppose you decide that the probability of something can be represented by a normal distribution. This is actually two assumptions: that the process is random, and that as a random variable it has a normal distribution. Those assumptions won&#8217;t be exactly true, so this introduces some modeling error.</p>
<p>Next we have to compute something about a normal distribution, say the probability of a normal random variable being in some range. This probability is given by an integral, and some algorithm estimates this integral and introduces approximation error. The approximation error would exist even if the steps in the algorithm could be carried out in infinite precision. But the steps are not carried out with infinite precision, so there is some error introduced by implementing the algorithm with floating point numbers.</p>
<p>For a simple example like this, approximation error and floating point error will typically be about the same size, both extremely small. But in a more complex example, say something involving a high-dimensional integral, the approximation error could be much larger than floating point error, but still smaller than modeling error. I imagine approximation error is often roughly the geometric mean of modeling error and floating point error, i.e. somewhere around the middle of the two on a log scale.</p>
<p>In Sussman&#8217;s presentation he says that people worry too much about correctness. Often correctness is not that important. It&#8217;s often good enough to produce a correct answer with reasonably high probability, provided the consequences of an error are controlled. I agree, but in light of that it seems odd to be too worried about inaccuracy from floating point arithmetic. I suspect he&#8217;s not that worried about floating point and that the opening quote was just an entertaining way to say that floating point math can be tricky.</p>
<p><strong>Related posts</strong>:</p>
<p><a href="http://www.johndcook.com/blog/2009/04/06/numbers-are-a-leaky-abstraction/">Floating point numbers are a leaky abstraction</a><br />
<a href="http://www.codeproject.com/KB/recipes/avoiding_overflow.aspx">Avoiding overflow, underflow, and loss of precision</a><br />
<a href="http://www.johndcook.com/blog/2011/09/30/just-an-approximation/">Just an approximation</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.johndcook.com/blog/2011/11/01/floating-point-worries/feed/</wfw:commentRss>
		<slash:comments>10</slash:comments>
		</item>
		<item>
		<title>An elegant proof from Erdős</title>
		<link>http://www.johndcook.com/blog/2011/10/25/erdos-proof/</link>
		<comments>http://www.johndcook.com/blog/2011/10/25/erdos-proof/#comments</comments>
		<pubDate>Wed, 26 Oct 2011 00:43:59 +0000</pubDate>
		<dc:creator>John</dc:creator>
				<category><![CDATA[Math]]></category>
		<category><![CDATA[Number theory]]></category>

		<guid isPermaLink="false">http://www.johndcook.com/blog/?p=9769</guid>
		<description><![CDATA[Here&#8217;s an elegant proof from Paul Erdős that there are infinitely many primes. It also does more, giving a lower bound on π(N), the number of primes less than N.
First, note that every integer n can be written as a product n = r s2 where r and s are integers and r is square-free, [...]]]></description>
			<content:encoded><![CDATA[<p>Here&#8217;s an elegant proof from Paul Erdős that there are infinitely many primes. It also does more, giving a lower bound on π(<em>N</em>), the number of primes less than <em>N</em>.<span id="more-9769"></span></p>
<p>First, note that every integer <em>n</em> can be written as a product <em>n = r s<sup>2</sup></em> where <em>r</em> and <em>s</em> are integers and <em>r</em> is square-free, i.e. not divisible by the square of any integer. To see this, let <em>s<sup>2</sup></em> be the largest square dividing <em>n</em> and set <em>r</em> = <em>n / s<sup>2</sup></em>.</p>
<p>Next we over-estimate how many <em>r s<sup>2</sup></em> factorizations there are less than or equal to <em>N</em>.</p>
<p>How many square-free numbers are there less than or equal to <em>N</em>? Every such number corresponds to a product of distinct primes each less than or equal to <em>N</em>. There are π(<em>N</em>) such primes, and so there are at most 2<sup>π(<em>N</em>)</sup> square-free numbers less than or equal to <em>N</em>. (The number of subsets of a set with <em>m</em> elements is 2<em><sup>m</sup></em>.)</p>
<p>How many squares are there less than <em>N</em>? No more than √<em>N</em> because if s &gt; √<em>N </em>then <em>s<sup>2</sup></em> &gt; <em>N</em>.</p>
<p>So if we factor every number ≤ <em>N</em> into the form <em>r s<sup>2</sup></em> there are at most 2<sup>π(<em>N</em>)</sup> possibilities for <em>r</em> and at most √<em>N</em> possibilities for <em>s</em>. This means</p>
<p style="padding-left: 30px;">2<sup>π(<em>N</em>)</sup> √<em>N</em> ≥ <em>N</em></p>
<p>Now divide both sides of this inequality by √<em>N</em> and take logarithms. This shows that</p>
<p style="padding-left: 30px;">π(<em>N</em>) ≥ log(<em>N</em>) / log 4</p>
<p>The right side is unbounded as <em>N</em> increases, so the left side must be unbounded too, i.e. there are infinitely many primes.</p>
<p>Euclid had a <a href="http://www.johndcook.com/blog/2010/02/13/euclids-proof-that-there-are-infinitely-many-primes/">simpler proof</a> that there are infinitely many primes. But unlike Euclid, Erdős gives a lower bound on π(<em>N</em>).</p>
<p>Source: <a href="http://www.amazon.com/gp/product/0821848801/ref=as_li_ss_tl?ie=UTF8&amp;tag=theende-20&amp;linkCode=as2&amp;camp=217145&amp;creative=399373&amp;creativeASIN=0821848801">Not Always Buried Deep</a></p>
<p><a href="http://www.amazon.com/gp/product/0821848801/ref=as_li_ss_il?ie=UTF8&amp;tag=theende-20&amp;linkCode=as2&amp;camp=217145&amp;creative=399373&amp;creativeASIN=0821848801"><img src="http://ws.assoc-amazon.com/widgets/q?_encoding=UTF8&amp;Format=_SL110_&amp;ASIN=0821848801&amp;MarketPlace=US&amp;ID=AsinImage&amp;WS=1&amp;tag=theende-20&amp;ServiceVersion=20070822" border="0" alt="" /></a><img style="border:none !important; margin:0px !important;" src="http://www.assoc-amazon.com/e/ir?t=theende-20&amp;l=as2&amp;o=1&amp;a=0821848801&amp;camp=217145&amp;creative=399373" border="0" alt="" width="1" height="1" /></p>
<p><strong>Related posts</strong>:</p>
<p><a href="http://www.johndcook.com/blog/2009/01/28/six-degrees-of-paul-erdos/">Six degrees of Paul Erdős</a><br />
<a href="http://www.johndcook.com/blog/2011/09/09/five-interesting-things-about-mersenne-primes/">Five interesting things about Mersenne primes</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.johndcook.com/blog/2011/10/25/erdos-proof/feed/</wfw:commentRss>
		<slash:comments>14</slash:comments>
		</item>
		<item>
		<title>Moby Dick and the tautochrone</title>
		<link>http://www.johndcook.com/blog/2011/10/15/tautochrone/</link>
		<comments>http://www.johndcook.com/blog/2011/10/15/tautochrone/#comments</comments>
		<pubDate>Sat, 15 Oct 2011 22:01:18 +0000</pubDate>
		<dc:creator>John</dc:creator>
				<category><![CDATA[Math]]></category>
		<category><![CDATA[Books]]></category>

		<guid isPermaLink="false">http://www.johndcook.com/blog/?p=9669</guid>
		<description><![CDATA[The tautochrone is a curve such that a ball rolling down the curve takes the same amount of time to reach the bottom, no matter where along the curve it starts. (The name comes from the Greek tauto for same and chrono for time.) It doesn&#8217;t sound like such a curve should be possible because [...]]]></description>
			<content:encoded><![CDATA[<p>The tautochrone is a curve such that a ball rolling down the curve takes the same amount of time to reach the bottom, no matter where along the curve it starts. (The name comes from the Greek <em>tauto</em> for <em>same</em> and <em>chrono</em> for <em>time</em>.) It doesn&#8217;t sound like such a curve should be possible because balls starting further up the curve have longer to travel. However, balls starting higher also have more potential energy, and so they travel further but faster. See the video below for a demonstration.</p>
<p><iframe width="420" height="315" src="http://www.youtube.com/embed/Ib1TdgeYL4o?rel=0" frameborder="0" allowfullscreen></iframe></p>
<p>[The video is entitled "brachistochrone race" rather than "tautochrone race." The brachistochrone problem is to find the curve of fastest descent. But its solution is the same curve as the tautochrone. So different problems, same solution.]</p>
<p>I first heard of the tautochrone as a differential equation problem to find its equation. But someone could run into it in an American literature class.</p>
<p>Clifford Pickover&#8217;s new book <a href="http://www.amazon.com/gp/product/1402778619/ref=as_li_ss_tl?ie=UTF8&amp;tag=theende-20&amp;linkCode=as2&amp;camp=217145&amp;creative=399373&amp;creativeASIN=1402778619">The Physics Book</a> has a chapter on the tautochrone. (In this book, &#8220;chapters&#8221; are only two pages: one page of prose and one full-page illustration.) Pickover points out a passage in <a href="http://www.amazon.com/gp/product/1613820135/ref=as_li_ss_tl?ie=UTF8&amp;tag=theende-20&amp;linkCode=as2&amp;camp=217145&amp;creative=399373&amp;creativeASIN=1613820135">Moby Dick</a> that discusses a bowl called a try-pot that is shaped like a tautochrone in the radial direction.</p>
<blockquote><p>[The try-pot] is a place also for profound mathematical meditation. It was in the left hand try-pot of the <em>Pequod</em>, with the soapstone diligently circling round me, that I was first indirectly struck by the remarkable fact, that in geometry all bodies gliding along the cycloid, my soapstone for example, will descend from any point in precisely the same time.</p></blockquote>
<p><a href="http://www.amazon.com/gp/product/1402778619/ref=as_li_ss_il?ie=UTF8&amp;tag=theende-20&amp;linkCode=as2&amp;camp=217145&amp;creative=399373&amp;creativeASIN=1402778619"><img src="http://ws.assoc-amazon.com/widgets/q?_encoding=UTF8&amp;Format=_SL110_&amp;ASIN=1402778619&amp;MarketPlace=US&amp;ID=AsinImage&amp;WS=1&amp;tag=theende-20&amp;ServiceVersion=20070822" border="0" alt="" /></a><img style="border:none !important; margin:0px !important;" src="http://www.assoc-amazon.com/e/ir?t=theende-20&amp;l=as2&amp;o=1&amp;a=1402778619&amp;camp=217145&amp;creative=399373" border="0" alt="" width="1" height="1" /></p>
]]></content:encoded>
			<wfw:commentRss>http://www.johndcook.com/blog/2011/10/15/tautochrone/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>Rational right triangles</title>
		<link>http://www.johndcook.com/blog/2011/10/13/rational-right-triangles/</link>
		<comments>http://www.johndcook.com/blog/2011/10/13/rational-right-triangles/#comments</comments>
		<pubDate>Thu, 13 Oct 2011 12:05:29 +0000</pubDate>
		<dc:creator>John</dc:creator>
				<category><![CDATA[Math]]></category>
		<category><![CDATA[Number theory]]></category>

		<guid isPermaLink="false">http://www.johndcook.com/blog/?p=9640</guid>
		<description><![CDATA[Suppose you have a right triangle and every side has rational length. What can you say about the area? For example, is it possible that such a triangle could have area 1?
It turns out the answer is no, and here&#8217;s a proof. Suppose you had a right triangle with sides of length a, b, and [...]]]></description>
			<content:encoded><![CDATA[<p>Suppose you have a right triangle and every side has rational length. What can you say about the area? For example, is it possible that such a triangle could have area 1?</p>
<p>It turns out the answer is no, and here&#8217;s a proof. Suppose you had a right triangle with sides of length <em>a</em>, <em>b</em>, and <em>c</em> with <em>c</em> being the length of the hypotenuse. And suppose <em>a</em>, <em>b</em>, and <em>c</em> are all rational numbers.</p>
<p>Start with the equation</p>
<p style="padding-left: 30px;">(<em>a</em><sup>2</sup> &#8211; <em>b</em><sup>2</sup>)<sup>2</sup> = (<em>a</em><sup>2</sup> + <em>b</em><sup>2</sup>)<sup>2</sup> &#8211; 4<em>a</em><sup>2</sup><em>b</em><sup>2</sup></p>
<p>Suppose the area of the triangle is 1. Then <em>ab</em>/2 = 1 and so <em>ab</em> = 2. Use this and the Pythagorean theorem to rewrite the right side of the equation above. Now we have</p>
<p style="padding-left: 30px;">(<em>a</em><sup>2</sup> &#8211; <em>b</em><sup>2</sup>)<sup>2</sup> = <em>c</em><sup>4</sup> &#8211; 16</p>
<p>But this result contradicts a theorem of Fermat: in rational numbers, the difference of two fourth powers cannot be a square.</p>
<p>So a rational right triangle cannot have area 1. Also, it cannot have area <em>r</em><sup>2</sup> for any rational number <em>r</em>. (If it did, you could divide each side by <em>r</em> and have a rational triangle with area 1.)</p>
<p>Now things are about to get a lot deeper.</p>
<p>What values <em>can</em> the area of a rational right triangle take on? Euler called such numbers <em>congruent</em>. Determining easily testable criteria for congruent numbers is an <a href="http://en.wikipedia.org/wiki/Congruent_number#Congruent_number_problem">open problem</a>. However, if the <a href="http://www.claymath.org/millennium/Birch_and_Swinnerton-Dyer_Conjecture/">Birch and Swinnerton-Dyer conjecture</a> is correct, then an algorithm of Jerrold Tunnell resolves the congruent number problem. (Incidentally, the Clay Mathematics Institute has placed a $1,000,000 bounty on the Birch and Swinnerton-Dyer conjecture.)</p>
<p>What if instead of limiting the problem to rational right triangles we considered <em>all</em> triangles with rational sides? See <a href="http://www.mathcs.emory.edu/~lrolen/congruent_numbers.pdf">this paper</a> for such a generalization.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.johndcook.com/blog/2011/10/13/rational-right-triangles/feed/</wfw:commentRss>
		<slash:comments>15</slash:comments>
		</item>
		<item>
		<title>How has math changed your view of the world?</title>
		<link>http://www.johndcook.com/blog/2011/10/06/math-worldview/</link>
		<comments>http://www.johndcook.com/blog/2011/10/06/math-worldview/#comments</comments>
		<pubDate>Fri, 07 Oct 2011 00:25:29 +0000</pubDate>
		<dc:creator>John</dc:creator>
				<category><![CDATA[Math]]></category>
		<category><![CDATA[Simplicity]]></category>

		<guid isPermaLink="false">http://www.johndcook.com/blog/?p=9176</guid>
		<description><![CDATA[Several people have asked me whether studying math changed my view of the world, and if so how.
I see applications of math everywhere. But more fundamentally, studying math has led me to believe that complex problems often have simple solutions.
Simple solutions may be hard or impossible to find. But you&#8217;re more likely to find a [...]]]></description>
			<content:encoded><![CDATA[<p>Several people have asked me whether studying math changed my view of the world, and if so how.</p>
<p>I see applications of math everywhere. But more fundamentally, studying math has led me to believe that complex problems often have simple solutions.</p>
<p>Simple solutions may be hard or impossible to find. But you&#8217;re more likely to find a simple solution if you believe it exists because you&#8217;ll keep looking longer.</p>
<p><strong>Related posts</strong>:</p>
<p><a href="http://www.johndcook.com/blog/2011/04/08/forced-to-be-simple/">Forced to be simple</a><br />
<a href="http://www.johndcook.com/blog/2010/04/05/rewarding-complexity/">Rewarding complexity</a><br />
<a href="http://www.johndcook.com/blog/2010/03/15/adding-simplicity/">Adding simplicity</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.johndcook.com/blog/2011/10/06/math-worldview/feed/</wfw:commentRss>
		<slash:comments>11</slash:comments>
		</item>
		<item>
		<title>Just an approximation</title>
		<link>http://www.johndcook.com/blog/2011/09/30/just-an-approximation/</link>
		<comments>http://www.johndcook.com/blog/2011/09/30/just-an-approximation/#comments</comments>
		<pubDate>Fri, 30 Sep 2011 13:24:19 +0000</pubDate>
		<dc:creator>John</dc:creator>
				<category><![CDATA[Math]]></category>

		<guid isPermaLink="false">http://www.johndcook.com/blog/?p=9556</guid>
		<description><![CDATA[I find it amusing when I hear someone say something is &#8220;just an approximation&#8221; because their &#8220;exact&#8221; answer is invariably &#8220;just an approximation&#8221; from someone else&#8217;s perspective. When someone says &#8220;mere approximation&#8221; they often mean &#8220;that&#8217;s not the kind of approximation my colleagues and I usually make&#8221; or &#8220;that&#8217;s not an approximation I understand.&#8221;
For example, [...]]]></description>
			<content:encoded><![CDATA[<p>I find it amusing when I hear someone say something is &#8220;just an approximation&#8221; because their &#8220;exact&#8221; answer is invariably &#8220;just an approximation&#8221; from someone else&#8217;s perspective. When someone says &#8220;mere approximation&#8221; they often mean &#8220;that&#8217;s not the kind of approximation my colleagues and I usually make&#8221; or &#8220;that&#8217;s not an approximation I understand.&#8221;</p>
<p>For example, I once audited a class in celestial mechanics. I was  surprised when the professor spoke with disdain about some analytical  technique as a &#8220;mere approximation&#8221; since his idea of &#8220;exact&#8221; only  extended to Newtonian physics. I don&#8217;t recall the details, but it&#8217;s possible that the disreputable approximation introduced no more error than the decision to only consider point masses or to ignore relativity. In any case, the approximation violated the rules of the game.</p>
<p>Statisticians can get awfully uptight about numerical approximations. They&#8217;ll wring their hands over a numerical routine that&#8217;s only good to five or six significant figures but not even blush when they approximate some quantity by averaging a few hundred random samples. Or they&#8217;ll make a dozen gross simplifications in modeling and then squint over whether a <em>p</em>-value is 0.04 or 0.06.</p>
<p>The problem is not accuracy but familiarity. We all like to draw a circle around our approximation of reality and distrust anything outside that circle. After a while we forget that our approximations are even approximations.</p>
<p>This applies to professions as well as individuals. All is well until two professional cultures clash. Then one tribe will be horrified by an approximation another tribe takes for granted. These conflicts can be a great reminder of the difference between trying to understand reality and playing by the rules of a professional game.</p>
<p><strong>Related posts</strong>:</p>
<p><a href="http://www.johndcook.com/blog/2011/05/10/well-understood/">Works well versus well understood</a><br />
<a href="http://www.johndcook.com/blog/2011/07/21/software-exoskeletons/">Software exoskeletons</a><br />
<a href="http://www.johndcook.com/blog/2010/11/11/wizards/">The trouble with wizards</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.johndcook.com/blog/2011/09/30/just-an-approximation/feed/</wfw:commentRss>
		<slash:comments>10</slash:comments>
		</item>
		<item>
		<title>New tech reports</title>
		<link>http://www.johndcook.com/blog/2011/09/26/tech-reports/</link>
		<comments>http://www.johndcook.com/blog/2011/09/26/tech-reports/#comments</comments>
		<pubDate>Mon, 26 Sep 2011 14:30:45 +0000</pubDate>
		<dc:creator>John</dc:creator>
				<category><![CDATA[Math]]></category>
		<category><![CDATA[Probability and Statistics]]></category>

		<guid isPermaLink="false">http://www.johndcook.com/blog/?p=9497</guid>
		<description><![CDATA[Soft maximum
I had a request to turn my blog posts on the soft maximum into a tech report, so here it is:
Basic properties of the soft maximum
There&#8217;s no new content here, just a little editing and more formal language. But now it can be referenced in a scholarly publication.
More random inequalities
I recently had a project [...]]]></description>
			<content:encoded><![CDATA[<p><strong>Soft maximum</strong></p>
<p>I had a request to turn my <a href="http://www.johndcook.com/blog/2010/01/13/soft-maximum/">blog</a> <a href="http://www.johndcook.com/blog/2010/01/20/how-to-compute-the-soft-maximum/">posts</a> on the soft maximum into a tech report, so here it is:</p>
<p><a href="http://www.bepress.com/mdandersonbiostat/paper70/">Basic properties of the soft maximum</a></p>
<p>There&#8217;s no new content here, just a little editing and more formal language. But now it can be referenced in a scholarly publication.</p>
<p><strong>More random inequalities</strong></p>
<p>I recently had a project that needed to compute random inequalities comparing common survival distributions (gamma, inverse gamma, Weibull, log normal) to uniform distributions. Here&#8217;s a report of the results.</p>
<p><a href="http://www.bepress.com/mdandersonbiostat/paper71/">Random inequalities between survival and uniform distributions</a></p>
<p>This tech report develops analytical solutions for computing Prob(<em>X</em> &gt; <em>Y</em>) where <em>X</em> and <em>Y</em> are independent, <em>X</em> has one of the distributions mentioned above, and <em>Y</em> is uniform over some interval. The report includes R code to carry out the analytic expressions. It also includes R code to estimate the same inequalities by sampling for <a href="http://www.johndcook.com/blog/2008/01/10/complementary-validation/">complementary validation</a>.</p>
<p>Here are some other <a href="http://www.johndcook.com/blog/2009/11/20/random-inequalities-ix/">tech reports and blog posts</a> on random inequalities.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.johndcook.com/blog/2011/09/26/tech-reports/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>Latitude doesn&#8217;t exactly mean what I thought</title>
		<link>http://www.johndcook.com/blog/2011/09/17/latitude-doesnt-exactly-mean-what-i-thought/</link>
		<comments>http://www.johndcook.com/blog/2011/09/17/latitude-doesnt-exactly-mean-what-i-thought/#comments</comments>
		<pubDate>Sun, 18 Sep 2011 02:25:36 +0000</pubDate>
		<dc:creator>John</dc:creator>
				<category><![CDATA[Math]]></category>
		<category><![CDATA[Geodesy]]></category>

		<guid isPermaLink="false">http://www.johndcook.com/blog/?p=9463</guid>
		<description><![CDATA[Don Fredkin left a comment on my previous blog post that surprised me. I found out that latitude doesn&#8217;t exactly mean what I thought.
Imagine a line connecting your location with the center of the Earth. I thought that your latitude would be the angle that that line makes with the plane of the equator. And [...]]]></description>
			<content:encoded><![CDATA[<p>Don Fredkin left a <a href="http://www.johndcook.com/blog/2011/09/16/chimborazo-vs-everest/#comment-103964">comment</a> on my <a href="http://www.johndcook.com/blog/2011/09/16/chimborazo-vs-everest/">previous blog post</a> that surprised me. I found out that latitude doesn&#8217;t exactly mean what I thought.</p>
<p>Imagine a line connecting your location with the center of the Earth. I thought that your latitude would be the angle that that line makes with the plane of the equator. And that&#8217;s almost true, but not quite.</p>
<p>Instead, you should imagine a line perpendicular to the Earth&#8217;s surface at your location and take the angle that that line makes with the plane of the equator.</p>
<p>If the Earth were perfectly spherical, the two lines would be identical and so the two angles would be identical. But since the Earth is an oblate spheroid (i.e. its cross-section is an ellipse) the two are not quite the same.</p>
<p>The angle I had in mind is the <em>geocentric</em> latitude ψ. The angle made by a perpendicular line and the plane of the equator is the <em>geographic</em> latitude φ. The following <a href="http://en.wikipedia.org/wiki/File:Two-types-of-latitude.png">drawing</a> from Wikipedia illustrates the difference, exaggerating the eccentricity of the ellipse.</p>
<p style="text-align:center"><img src="http://www.johndcook.com/latitude.png" alt="" width="350" height="266" /></p>
<p>How do these two ideas of latitude compare? I&#8217;ll sketch a derivation for equations relating geographic latitude φ and geocentric latitude ψ.</p>
<p>Let <em>f</em>(<em>x</em>, <em>y</em>) = (<em>x</em>/<em>a</em>)<sup>2</sup> + (<em>y</em>/<em>b</em>)<sup>2</sup> where <em>a</em> = 6378.1 km is the equatorial radius and <em>b</em> = 6356.8 km is the polar radius.. The gradient of <em>f</em> is perpendicular to the ellipse given by the level set <em>f</em>(<em>x</em>, <em>y</em>) = 1. At geocentric latitude ψ, y = tan(ψ) <em>x</em> and so the gradient is proportional to (1/<em>a</em><sup>2</sup>,  tan(ψ) / <em>b</em><sup>2</sup>). From taking the dot product with (1, 0) it follows that the cosine of φ is given by</p>
<p style="padding-left: 30px;">(1 + (<em>a</em>/<em>b</em>)<sup>4</sup> tan<sup>2</sup> ψ)<sup>-1/2</sup>.</p>
<p>It follows that</p>
<p style="padding-left: 30px;">φ = tan<sup>-1</sup>( (<em>a</em>/<em>b</em>)<sup>2</sup> tan ψ )</p>
<p>and</p>
<p style="padding-left: 30px;">ψ = tan<sup>-1</sup>( (<em>b</em>/<em>a</em>)<sup>2</sup> tan φ ).</p>
<p>The geocentric and geographic latitude are equal at the poles and equator. Between these extremes, geographic latitude is larger than geocentric latitude, but never by more than 0.2 degrees. The maximum difference, as you might guess, is near 45 degrees.</p>
<p>Here&#8217;s a graph of φ &#8211; ψ in degrees.</p>
<p style="text-align:center"><img src="http://www.johndcook.com/latitudediff.png" alt="" width="360" height="225" /></p>
<p>The maximum occurs at 44.9 degrees and equals 0.1917.</p>
<p>The curve looks very much like a parabola, and indeed it is. The approximation</p>
<p style="padding-left: 30px;">φ = ψ + 0.186 &#8211; 0.0000946667 (ψ &#8211; 45)<sup>2</sup></p>
<p>is very accurate, within about 0.005 degrees.</p>
<p><strong>Related post</strong>:</p>
<p><a href="http://www.johndcook.com/blog/2011/09/16/chimborazo-vs-everest/">Journey away from the center of the Earth</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.johndcook.com/blog/2011/09/17/latitude-doesnt-exactly-mean-what-i-thought/feed/</wfw:commentRss>
		<slash:comments>11</slash:comments>
		</item>
		<item>
		<title>Journey away from the center of the Earth</title>
		<link>http://www.johndcook.com/blog/2011/09/16/chimborazo-vs-everest/</link>
		<comments>http://www.johndcook.com/blog/2011/09/16/chimborazo-vs-everest/#comments</comments>
		<pubDate>Fri, 16 Sep 2011 12:23:37 +0000</pubDate>
		<dc:creator>John</dc:creator>
				<category><![CDATA[Math]]></category>
		<category><![CDATA[Geodesy]]></category>

		<guid isPermaLink="false">http://www.johndcook.com/blog/?p=9440</guid>
		<description><![CDATA[What point on Earth is farthest from its center? Mt. Everest comes to mind, but its summit is the point highest above sea level, not the point farthest from the center. These are not the same because the Earth is not perfectly spherical.
Our planet bulges slightly at the equator due to its rotation. The equatorial [...]]]></description>
			<content:encoded><![CDATA[<p>What point on Earth is farthest from its center? Mt. Everest comes to mind, but its summit is the point highest above sea level, not the point farthest from the center. These are not the same because the Earth is not perfectly spherical.</p>
<p>Our planet bulges slightly at the equator due to its rotation. The equatorial diameter is about 0.3% larger than the polar diameter. Sea level at the equator is about 20 kilometers farther from the center of the Earth than sea level at the poles.</p>
<p style="text-align:center"><img src="http://www.johndcook.com/Chimborazo.jpg" alt="Chimborazo in Ecuador" width="300" height="208" /></p>
<p style="text-align:center"><a href="http://en.wikipedia.org/wiki/File:EL_CHIMBORAZO.jpg">Photo via Wikipedia</a></p>
<p>Mt. Everest is about nine kilometers above sea level and located about 28 degrees north of the equator. Chimborazo, the highest point in Ecuador, is seven kilometers above sea level and 1.5 degrees south of the equator.</p>
<p>So how far are Mt. Everest and Chimborazo from the center of the Earth? To answer that, we first need to how far sea level at latitude θ is from the center of the Earth.</p>
<p>Imagine slicing the Earth with a plane containing its polar diameter. To a good approximation (within 100 meters) the resulting shape would be an ellipse. The equation of this ellipse is</p>
<p style="padding-left: 30px;">(<em>x</em> / <em>a</em>)<sup>2</sup> + (<em>y</em> / <em>b</em>)<sup>2</sup> = 1</p>
<p>where <em>a</em> = 6378.1 km is the equatorial radius and <em>b</em> = 6356.8 km is the polar radius. A line from the center of the ellipse to a point at latitude θ has equation <em>y</em> = tan(θ) <em>x</em>. Solving the pair of equations for <em>x</em> shows that the distance from the center to the point at latitude θ is</p>
<p style="padding-left: 30px;"><em>d</em> = sqrt( <em>a</em><sup>2</sup><em>b</em><sup>2</sup> sec<sup>2 </sup>θ / (<em>a</em><sup>2</sup> tan<sup>2</sup> θ + <em>b</em><sup>2</sup> ) )</p>
<p>For Mt. Everest, θ = 27.99 degrees and so <em>d</em> = 6373.4. For Chimborazo, θ = -1.486 degrees and so <em>d</em> = 6378.1. So sea level is 4.7 km higher at Chimborazo. Mt. Everest is 2.6 km taller, but the summit of Chimborazo is about 2.1 km farther away from the center of the Earth.</p>
<p><strong>Update</strong>: See my <a href="http://www.johndcook.com/blog/2011/09/17/latitude-doesnt-exactly-mean-what-i-thought/">next post</a> for a slight correction. A more accurate calculation would compute sea level is about 4.65 km higher at Chimborazo than Mt. Everest.</p>
<p><strong>Related posts</strong>:</p>
<p><a href="http://www.johndcook.com/blog/2009/03/02/what-is-the-shape-of-the-earth/">What is the shape of the Earth?</a><br />
<a href="http://www.johndcook.com/blog/2008/09/11/finding-distances-using-latitude-and-longitude/">Finding distances from coordinates</a><br />
<a href="http://www.johndcook.com/blog/2009/09/15/mercator-projection/">Mercator projection</a><br />
<a href="http://www.johndcook.com/blog/2009/09/21/gudermannian/">Inverse Mercator projection</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.johndcook.com/blog/2011/09/16/chimborazo-vs-everest/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
	</channel>
</rss>

<!-- Dynamic Page Served (once) in 1.170 seconds -->

