<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/rss2full.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.feedburner.com/~d/styles/itemcontent.css"?><rss 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/" xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" version="2.0">

<channel>
	<title>The Endeavour</title>
	
	<link>http://www.johndcook.com/blog</link>
	<description>The blog of John D. Cook</description>
	<lastBuildDate>Mon, 08 Feb 2010 16:41:50 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.4</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" type="application/rss+xml" href="http://feeds.feedburner.com/TheEndeavour" /><feedburner:info uri="theendeavour" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com" /><item>
		<title>Apple are evil?</title>
		<link>http://feedproxy.google.com/~r/TheEndeavour/~3/iacjJk6ypQA/</link>
		<comments>http://www.johndcook.com/blog/2010/02/08/apple-are-evil/#comments</comments>
		<pubDate>Mon, 08 Feb 2010 16:41:50 +0000</pubDate>
		<dc:creator>John</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[Grammar]]></category>

		<guid isPermaLink="false">http://www.johndcook.com/blog/?p=4465</guid>
		<description><![CDATA[Mike Croucher wrote a post the other day explaining why he&#8217;s going to buy an iPad. He said that one of the objections to the iPad he&#8217;d heard was
Apple are evil because they take away control of how we use their devices.
I teased Mike that I would never say &#8220;Apple are evil.&#8221; On this side [...]]]></description>
			<content:encoded><![CDATA[<p>Mike Croucher wrote a post the other day explaining <a href="http://www.walkingrandomly.com/?p=2300">why he&#8217;s going to buy an iPad</a>. He said that one of the objections to the iPad he&#8217;d heard was</p>
<blockquote><p>Apple are evil because they take away control of how we use their devices.</p></blockquote>
<p>I teased Mike that I would never say &#8220;Apple are evil.&#8221; On this side of the Atlantic we&#8217;d say &#8220;Apple <em>is</em> evil.&#8221; But in the UK it is accepted usage to say &#8220;Apple are evil.&#8221;</p>
<p>&#8220;Apple&#8221; is a collective noun when used to refer to Apple Inc. British English treats collective nouns as plural, but American English treats them as singular. Although the British usage sounds odd to my American ears, it makes sense just as much sense as the American convention. You could argue for plural verbs because corporations are made of individual people, or you could argue for singular verbs because the corporations act as a single entity. See Grammar Girl&#8217;s tip on<a href="http://grammar.quickanddirtytips.com/collective-nouns.aspx"> collective nouns</a> for more background.</p>
<p>By the way, I don&#8217;t believe Apple is evil. They&#8217;re just a company, no more or less virtuous than most other companies.</p>
<p><strong>Apple posts</strong>:</p>
<p><a href="http://www.johndcook.com/blog/2008/11/22/i-am-not-an-operating-system/">I am not an operating system</a><br />
<a href="http://www.johndcook.com/blog/2008/11/08/inside-steve-jobs-brain/">Inside Steve Job&#8217;s brain</a><br />
<a href="http://www.johndcook.com/blog/2008/09/30/protestant-pcs-catholic-macs/">Protestant PCs, Catholic Macs</a></p>
<p><strong>Grammar posts</strong>:</p>
<p><a href="http://www.johndcook.com/blog/2009/07/27/important-because-its-unimportant/">Important because it&#8217;s unimportant</a><br />
<a href="http://www.johndcook.com/blog/2008/09/10/xylophones-and-zebras-part-iii-english-grammar/">English grammar</a><br />
<a href="http://www.johndcook.com/blog/2009/10/07/finding-embarrassing-and-unhelpful-error-messages/">Finding grammatical errors in software</a></p>
<img src="http://feeds.feedburner.com/~r/TheEndeavour/~4/iacjJk6ypQA" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.johndcook.com/blog/2010/02/08/apple-are-evil/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://www.johndcook.com/blog/2010/02/08/apple-are-evil/</feedburner:origLink></item>
		<item>
		<title>Twitter daily tip news</title>
		<link>http://feedproxy.google.com/~r/TheEndeavour/~3/e1rCxIcA-CI/</link>
		<comments>http://www.johndcook.com/blog/2010/02/08/twitter-daily-tip-news/#comments</comments>
		<pubDate>Mon, 08 Feb 2010 16:26:25 +0000</pubDate>
		<dc:creator>John</dc:creator>
				<category><![CDATA[Python]]></category>
		<category><![CDATA[Math]]></category>
		<category><![CDATA[Regular expressions]]></category>
		<category><![CDATA[Twitter]]></category>

		<guid isPermaLink="false">http://www.johndcook.com/blog/?p=4483</guid>
		<description><![CDATA[I have five Twitter accounts that send out one tip per day, including a new one I just added last week.
Regular expressions
@RegexTip started over today. It&#8217;s a cycle of tips for learning regular expressions. It sticks to the regular expression features common to Python, Perl, C#, and many other programming languages. This account posts Monday [...]]]></description>
			<content:encoded><![CDATA[<p>I have five Twitter accounts that send out one tip per day, including a new one I just added last week.</p>
<p><strong>Regular expressions</strong></p>
<p><a href="http://twitter.com/RegexTip">@RegexTip</a> started over today. It&#8217;s a cycle of tips for learning regular expressions. It sticks to the regular expression features common to Python, Perl, C#, and many other programming languages. This account posts Monday through Friday.</p>
<p><strong>Keyboard shortcuts</strong></p>
<p><a href="http://twitter.com/SansMouse">@SansMouse</a> gives one tip a day on using Windows without a mouse. By practicing one keyboard shortcut a day, you can get into the habit of using your mouse less and your keyboard more. This cycle of tips started over January 29 with the most common and most widely useful shortcuts. I&#8217;m also sprinkling in a few extra tips that are less well known. This account also posts Monday through Friday.</p>
<p><strong>Math</strong></p>
<p>I have three mathematical accounts. These post seven days a week.</p>
<p><a href="http://twitter.com/AlgebraFact">@AlgebraFact</a>, just started February 2. It will be a mixture of linear algebra, number theory, group theory, etc.</p>
<p><a href="http://twitter.com/ProbFact">@ProbFact</a> gives one fact per day from probability. Usually these facts are theorems, but sometimes they include a note on history or applications.</p>
<p><a href="http://twitter.com/AnalysisFact">@AnalysisFact</a> gives facts from real and complex analysis. The topics range from elementary to advanced.</p>
<p><strong>What if I don&#8217;t use Twitter?</strong></p>
<p>You can visit the page for a Twitter account just like any other web page. And every Twitter account has an <a href="http://www.johndcook.com/blog/2008/04/28/60-second-description-of-feeds/">RSS feed</a> link allowing you to subscribe just as you would subscribe to a blog.</p>
<p><strong>How do you write these?</strong></p>
<p>I write up content for these accounts in bulk. I may sit down on a Saturday and come up with several weeks worth of tips. Then I use HootSuite to schedule the tips weeks in advance. Sometimes I&#8217;ll post something spontaneously, such as link to something relevant, but most of the work is done in advance. I use my <a href="http://twitter.com/johndcook">personal Twitter account</a> for live interaction.</p>
<p><strong>Related links</strong>:</p>
<p><a href="http://www.johndcook.com/blog/2009/11/09/using-windows-without-a-mouse/">Using Windows without a mouse</a></p>
<p>Regular expressions in</p>
<ul>
<li><a href="http://www.johndcook.com/python_regex.html">Python</a></li>
<li><a href="http://www.johndcook.com/regex.html">PowerShell</a></li>
<li><a href="http://www.johndcook.com/mathematica_regex.html">Mathematica</a></li>
<li><a href="http://www.johndcook.com/r_language_regex.html">R</a></li>
<li><a href="http://www.johndcook.com/cpp_regex.html">C++</a></li>
</ul>
<p><a href="http://www.johndcook.com/distribution_chart.html">Chart of probability distribution relationships</a></p>
<img src="http://feeds.feedburner.com/~r/TheEndeavour/~4/e1rCxIcA-CI" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.johndcook.com/blog/2010/02/08/twitter-daily-tip-news/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://www.johndcook.com/blog/2010/02/08/twitter-daily-tip-news/</feedburner:origLink></item>
		<item>
		<title>You can’t force people to provide metadata</title>
		<link>http://feedproxy.google.com/~r/TheEndeavour/~3/bgCoxQpf2FY/</link>
		<comments>http://www.johndcook.com/blog/2010/02/07/you-cant-force-people-to-provide-metadata/#comments</comments>
		<pubDate>Sun, 07 Feb 2010 23:46:39 +0000</pubDate>
		<dc:creator>John</dc:creator>
				<category><![CDATA[Software development]]></category>
		<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://www.johndcook.com/blog/?p=4491</guid>
		<description><![CDATA[I ran across a long rant from Steve Yegge this evening about junior programmers. In a nutshell, Yegge says they like to play around with metadata rather than getting real work done.
Here&#8217;s an insightful observation Yegge makes along the way.
And Haskell, OCaml and their ilk &#8230; try to force people to model everything. Programmers hate [...]]]></description>
			<content:encoded><![CDATA[<p>I ran across a <a href="http://steve-yegge.blogspot.com/2008/02/portrait-of-n00b.html">long rant</a> from Steve Yegge this evening about junior programmers. In a nutshell, Yegge says they like to play around with metadata rather than getting real work done.</p>
<p>Here&#8217;s an insightful observation Yegge makes along the way.</p>
<blockquote><p>And Haskell, OCaml and their ilk &#8230; try to force people to model everything. Programmers hate that. These languages will never, <em>ever</em> enjoy any substantial commercial success, for the exact same reason the Semantic Web is a failure. <strong>You can&#8217;t force people to provide metadata for everything they do</strong>. They&#8217;ll hate you.</p></blockquote>
<p><strong>Related post</strong>:</p>
<p><a href="http://www.johndcook.com/blog/2008/12/10/probability-of-semantic-markup-being-correct/">Probability of semantic markup being correct</a></p>
<img src="http://feeds.feedburner.com/~r/TheEndeavour/~4/bgCoxQpf2FY" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.johndcook.com/blog/2010/02/07/you-cant-force-people-to-provide-metadata/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
		<feedburner:origLink>http://www.johndcook.com/blog/2010/02/07/you-cant-force-people-to-provide-metadata/</feedburner:origLink></item>
		<item>
		<title>Weekend miscellany</title>
		<link>http://feedproxy.google.com/~r/TheEndeavour/~3/sunxMB-MXPk/</link>
		<comments>http://www.johndcook.com/blog/2010/02/06/weekend-miscellany-23/#comments</comments>
		<pubDate>Sat, 06 Feb 2010 12:06:26 +0000</pubDate>
		<dc:creator>John</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://www.johndcook.com/blog/?p=4391</guid>
		<description><![CDATA[Computing
Online diff tool
HTTP flowchart
Astroinformatics
Python propaganda
How to safely store a password
Google Docs dropping IE6 support
Why it&#8217;s hard to move Facebook off PHP
Keyboard shortcuts for Windows, Mac, and Linux
Math
Fundamental examples in math
Daily fact from algebra and number theory
62nd Carnival of Mathematics
Miscellaneous
Always wear your seatbelt
Space shuttle repaired with duct tape (lunar rover too)
How to peel a pummelo. YouTube [...]]]></description>
			<content:encoded><![CDATA[<p><strong>Computing</strong></p>
<p><a href="http://quickdiff.com/index.php">Online diff tool</a><br />
<a href="http://bitbucket.org/justin/webmachine/wiki/BigHTTPGraph">HTTP flowchart</a><br />
<a href="http://arxiv.org/abs/0909.3892">Astroinformatics</a><br />
<a href="http://www1.american.edu/academic.depts/cas/econ/faculty/isaac/choose_python.pdf">Python propaganda</a><br />
<a href="http://codahale.com/how-to-safely-store-a-password/">How to safely store a password</a><br />
<a href="http://arstechnica.com/microsoft/news/2010/01/google-to-send-internet-explorer-6-users-packing-come-march.ars?utm_source=rss&amp;utm_medium=rss&amp;utm_campaign=rss">Google Docs dropping IE6 support</a><br />
<a href="http://terrychay.com/article/hiphop-for-faster-php.shtml/4">Why it&#8217;s hard to move Facebook off PHP</a><br />
<a href="http://en.wikipedia.org/wiki/Table_of_keyboard_shortcuts">Keyboard shortcuts for Windows, Mac, and Linux</a></p>
<p><strong>Math</strong></p>
<p><a href="http://gilkalai.wordpress.com/2010/01/31/fundamental-examples-2/">Fundamental examples in math</a><br />
<a href="http://twitter.com/algebrafact">Daily fact from algebra and number theory</a><br />
<a href="http://www.johndcook.com/blog/2010/02/05/carnival-of-mathematics-62/">62nd Carnival of Mathematics</a></p>
<p><strong>Miscellaneous</strong></p>
<p><a href="http://wimp.com/seatbelt/">Always wear your seatbelt</a><br />
<a href="http://factlets.info/ducttapeshuttle.html">Space shuttle repaired with duct tape</a> (<a href="http://www.johndcook.com/blog/2008/04/22/duct-tape-on-the-moon/">lunar rover</a> too)</p>
<p>How to peel a pummelo. <a href="http://www.youtube.com/watch?v=K5dyBrvLIj0">YouTube</a> video with nice soundtrack.</p>
<p><object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" width="425" height="344" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0"><param name="allowFullScreen" value="true" /><param name="allowscriptaccess" value="always" /><param name="src" value="http://www.youtube.com/v/K5dyBrvLIj0&amp;hl=en_US&amp;fs=1&amp;rel=0" /><param name="allowfullscreen" value="true" /><embed type="application/x-shockwave-flash" width="425" height="344" src="http://www.youtube.com/v/K5dyBrvLIj0&amp;hl=en_US&amp;fs=1&amp;rel=0" allowscriptaccess="always" allowfullscreen="true"></embed></object></p>
<img src="http://feeds.feedburner.com/~r/TheEndeavour/~4/sunxMB-MXPk" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.johndcook.com/blog/2010/02/06/weekend-miscellany-23/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		<feedburner:origLink>http://www.johndcook.com/blog/2010/02/06/weekend-miscellany-23/</feedburner:origLink></item>
		<item>
		<title>Carnival of Mathematics #62</title>
		<link>http://feedproxy.google.com/~r/TheEndeavour/~3/uRedVSBDBfE/</link>
		<comments>http://www.johndcook.com/blog/2010/02/05/carnival-of-mathematics-62/#comments</comments>
		<pubDate>Fri, 05 Feb 2010 12:13:50 +0000</pubDate>
		<dc:creator>John</dc:creator>
				<category><![CDATA[Math]]></category>

		<guid isPermaLink="false">http://www.johndcook.com/blog/?p=4145</guid>
		<description><![CDATA[What is the Carnival of Mathematics? Math bloggers submit articles they have written recently and each month a host writes a post linking to the submitted posts. The sister carnival, Math Teachers at Play, focuses on math education and on math up through high school level. For a more thorough description of the two carnivals [...]]]></description>
			<content:encoded><![CDATA[<p>What is the Carnival of Mathematics? Math bloggers submit articles they have written recently and each month a host writes a post linking to the submitted posts. The sister carnival, <a href="http://blogcarnival.com/bc/cprof_6422.html">Math Teachers at Play</a>, focuses on math education and on math up through high school level. For a more thorough description of the two carnivals and some FAQs, please see Mike Croucher&#8217;s article <a href="http://www.walkingrandomly.com/?p=2214">What is a Maths Carnival</a>?</p>
<p>I&#8217;m taking a turn hosting this month. Tradition dictates that the host begin with some trivia about the number of the post. As this is the 62nd Carnival of Mathematics, here are a few facts about 62.</p>
<ul>
<li>62 is the only number whose cube (238328) consists of 3 digits each occurring 2 times.</li>
<li>The <a href="http://mathworld.wolfram.com/GreatRhombicosidodecahedron.html">great rhombicosidodecahedron</a> has 62 sides.</li>
<li>Louis Pasteur developed the first rabies vaccination at age 62.</li>
</ul>
<p>And now onto the posts.</p>
<p>Math and science teacher <strong>Cory Poole</strong> sends in a video that he created along with his partners and students. The video features a 64-foot <a href="http://en.wikipedia.org/wiki/Sierpinski_triangle">Sierpenski triangle</a> about of 12,000 tortilla chips. Read more about the <a href="http://www.blownapartstudios.com/main/2009/11/11/battlestations.html">story of the video</a>. Also, here are the <a href="http://www.blownapartstudios.com/main/2010/2/1/battlestations-making-ofblooper-reel.html">bloopers</a> from making the video.</p>
<p><object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" width="425" height="344" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0"><param name="allowFullScreen" value="true" /><param name="allowScriptAccess" value="always" /><param name="src" value="http://www.youtube.com/v/rMYqzU1nZew&amp;rel=0&amp;color1=0xb1b1b1&amp;color2=0xcfcfcf&amp;hl=en_US&amp;feature=player_embedded&amp;fs=1" /><param name="allowfullscreen" value="true" /><embed type="application/x-shockwave-flash" width="425" height="344" src="http://www.youtube.com/v/rMYqzU1nZew&amp;rel=0&amp;color1=0xb1b1b1&amp;color2=0xcfcfcf&amp;hl=en_US&amp;feature=player_embedded&amp;fs=1" allowscriptaccess="always" allowfullscreen="true"></embed></object></p>
<p>St. Swithun&#8217;s day is a sort of British analog of America&#8217;s Groundhog Day. If it rains on St. Swithun&#8217;s day, it is supposed to rain for the next 40 days. Is there some truth to the legend? See <strong>Jon McLoone</strong>&#8217;s article <a href="http://blog.wolfram.com/2010/01/15/mathematica-tests-the-st-swithuns-day-proverb/">Mathematica Tests the St. Swithun&#8217;s Day Proverb</a> posted at <a href="http://blog.wolfram.com">Wolfram Blog</a>.</p>
<p><strong>Edmund Harriss</strong> from <a href="http://maxwelldemon.com">Maxwell&#8217;s Demon</a> presents <a href="http://maxwelldemon.com/2010/01/14/spirographs-and-the-third-dimension/">Spirographs and the third dimension</a>. Interesting visually and mathematically.</p>
<p style="text-align:center"><img src="http://www.johndcook.com/toral_spirograph.png" alt="toral spirograph" width="288" height="216" /></p>
<p><strong>Rachel Thomas</strong> presents <a href="http://plus.maths.org/latestnews/jan-apr10/e8/index.html">Beautiful symmetry provides glimpse into quantum world</a> on <a href="http://plus.maths.org/blog/">News from the world of maths</a>. This article reports on a low-termperature experiment that implies that the exceptional Lie group E8 is at work.</p>
<p>Did you know that sine and cosine are equal for all x? <strong>Heather</strong> (<strong>Xi</strong>) submitted a pseudo-proof in <a href="http://threesixty360.wordpress.com/2010/02/02/ab-implies-that-11-therefore/">A=B implies that 1=1, therefore?</a> by her colleague <strong>TwoPi</strong> at <a href="http://threesixty360.wordpress.com">360</a>. (If there is ever a 360th Carnival of Mathematics, Heather should host it.)</p>
<p><strong>Update</strong>: The 360 blog has agreed to host the 360th Carnival of Mathematics, tentatively scheduled for December 1, 2034. (Mike, I hope it&#8217;s OK that I scheduled this date without consulting you. <img src='http://www.johndcook.com/blog/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> )</p>
<p><strong>Marc West</strong> presents <a href="http://www.mrscienceshow.com/2008/12/curse-of-duck.html">The curse of the duck</a>, a post about mathematics and cricket. His blog is <a href="http://www.mrscienceshow.com/">Mr Science Show: Where Science Meets Pop Culture</a>.</p>
<p><strong>Dan M</strong> presents <a href="http://mathrecreation.blogspot.com/2010/01/appolonian-gaskets-and-ford-circles.html">Appolonian Gaskets and Ford Circles</a> on his blog <a href="http://mathrecreation.blogspot.com/">mathrecreation</a>. This post relates number theory and geometry as Ford circles are related to the Farey sequence.</p>
<p style="text-align:center"><img src="http://www.johndcook.com/ford_with_numbers.jpg" alt="Ford circles" width="320" height="162" /></p>
<p><strong>Rick Regan</strong> presents <a href="http://www.exploringbinary.com/counting-binary-and-hexadecimal-palindromes/">Counting Binary and Hexadecimal Palindromes</a> posted at <a href="http://www.exploringbinary.com">Exploring Binary</a>. Rick counts base 10 palindromes as a warm-up before diving into new territory with binary and hexidecimal numbers.</p>
<p><strong>Gregory Astley</strong> wrote a guest post <a href="http://www.walkingrandomly.com/?p=2079">Maxima Tutorial – plotting direction fields for 1st order ODEs</a> for <strong>Mike Croucher</strong>&#8217;s blog <a href="http://www.walkingrandomly.com">Walking Randomly</a>. (Maxima is part of the SAGE mathematics system. Mike has written <a href="http://www.walkingrandomly.com/?s=SAGE">several posts about SAGE</a> lately.)</p>
<p><strong>Annarita Ruberto</strong> from <a href="http://lanostramatematica.splinder.com/">Matem@ticaMente</a> presents the article &#8220;How heavy the fish?&#8221; The original post was written in <a href="http://lanostramatematica.splinder.com/post/22037890/Quanto+Pesa+Il+Pesce%3F">Italian</a>, and here is Google&#8217;s translation of the page into <a href="http://translate.google.com/translate?js=y&amp;prev=_t&amp;hl=en&amp;ie=UTF-8&amp;layout=1&amp;eotf=1&amp;u=http%3A%2F%2Flanostramatematica.splinder.com%2Fpost%2F22037890%2FQuanto%2BPesa%2BIl%2BPesce%253F&amp;sl=it&amp;tl=en">English</a>.</p>
<p><strong>Matt McDonnell</strong> presents <a href="http://blogs.mathworks.com/loren/2010/01/19/mathematical-recreations-tweetable-game-of-life/">Mathematical Recreations: Tweetable Game Of Life</a>, a guest blog for <strong>Loren Shure</strong>&#8217;s blog <a href="http://blogs.mathworks.com/loren">Loren on the Art of MATLAB</a>.</p>
<p style="text-align:center"><img src="http://www.johndcook.com/life.png" alt="" width="203" height="202" /></p>
<p>For some mental arithmetic shortcuts and an explanation of why they work, see <strong>Sol Lederman</strong>&#8217;s post <a href="http://wildaboutmath.com/2008/02/15/trachtenberg-speed-multiplication-exploring-why-it-works/">Trachtenberg speed multiplication: exploring why it works</a> on his blog <a href="http://wildaboutmath.com/">Wild About Math</a>.</p>
<p>Politics impacts sphere of human activity, including math education. See <strong>Jason Dyer</strong>&#8217;s post <a href="http://numberwarrior.wordpress.com/2010/01/26/anatomy-of-a-political-math-ed-reaction/">Anatomy of a Political Math-Ed Reaction</a> on <a href="http://numberwarrior.wordpress.com">The Number Warrior</a>.</p>
<p><strong>Peter Rowlett</strong> from <a href="http://travelsinamathematicalworld.blogspot.com/">Travels in a Mathematical World</a> presents <a href="http://travelsinamathematicalworld.blogspot.com/2010/01/substitution-ciphers-ancient.html">Substitution ciphers: Ancient &#8211; Renaissance</a>, video included below.</p>
<p><object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" width="425" height="344" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0"><param name="allowFullScreen" value="true" /><param name="allowScriptAccess" value="always" /><param name="src" value="http://www.youtube.com/v/diqXRyhKatw&amp;rel=0&amp;color1=0xb1b1b1&amp;color2=0xcfcfcf&amp;hl=en_GB&amp;feature=player_embedded&amp;fs=1" /><param name="allowfullscreen" value="true" /><embed type="application/x-shockwave-flash" width="425" height="344" src="http://www.youtube.com/v/diqXRyhKatw&amp;rel=0&amp;color1=0xb1b1b1&amp;color2=0xcfcfcf&amp;hl=en_GB&amp;feature=player_embedded&amp;fs=1" allowscriptaccess="always" allowfullscreen="true"></embed></object></p>
<p>You can keep up with Carnival of Mathematics news on Twitter by following <a href="http://twitter.com/CarnivalOfMath">@CarnivalOfMath</a>. You may also be interested in daily math facts on Twitter from <a href="http://twitter.com/probfact">@ProbFact</a> (probability), <a href="http://twitter.com/AnalysisFact">@AnalysisFact</a> (real and complex analysis), and <a href="http://twitter.com/AlgebraFact">@AlgebraFact</a> (algebra and number theory).</p>
<img src="http://feeds.feedburner.com/~r/TheEndeavour/~4/uRedVSBDBfE" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.johndcook.com/blog/2010/02/05/carnival-of-mathematics-62/feed/</wfw:commentRss>
		<slash:comments>8</slash:comments>
		<feedburner:origLink>http://www.johndcook.com/blog/2010/02/05/carnival-of-mathematics-62/</feedburner:origLink></item>
		<item>
		<title>Python code for computing distribution parameters from percentiles</title>
		<link>http://feedproxy.google.com/~r/TheEndeavour/~3/pboSqykOVHU/</link>
		<comments>http://www.johndcook.com/blog/2010/02/03/computing-parameters-from-percentiles/#comments</comments>
		<pubDate>Thu, 04 Feb 2010 01:14:24 +0000</pubDate>
		<dc:creator>John</dc:creator>
				<category><![CDATA[Math]]></category>
		<category><![CDATA[Python]]></category>
		<category><![CDATA[SciPy]]></category>

		<guid isPermaLink="false">http://www.johndcook.com/blog/?p=4428</guid>
		<description><![CDATA[A few days ago I wrote a post on finding parameters so that a probability distribution satisfies two percentile conditions. Since then I&#8217;ve written Python code to carry out the calculations described in that article and the accompanying technical report.
The article is Finding probability distribution parameters from percentiles posted on CodeProject. The article comes with [...]]]></description>
			<content:encoded><![CDATA[<p>A few days ago I wrote a post on <a href="http://www.johndcook.com/blog/2010/01/31/parameters-from-percentiles/">finding parameters</a> so that a probability distribution satisfies two percentile conditions. Since then I&#8217;ve written Python code to carry out the calculations described in that article and the accompanying <a href="http://www.johndcook.com/quantiles_parameters.pdf">technical report</a>.</p>
<p>The article is <a href="http://www.codeproject.com/KB/recipes/ParameterPercentile.aspx">Finding probability distribution parameters from percentiles</a> posted on CodeProject. The article comes with Python source code and some commentary. The article shows how <a href="http://www.scipy.org/">SciPy</a> and the <a href="http://www.johndcook.com/blog/2008/12/19/partial-function-application-in-python/">functools module </a>make it possible for the code to be very succinct.</p>
<p><strong>Related posts</strong>:</p>
<p><a href="http://www.johndcook.com/blog/2010/02/03/statistical-distributions-in-scipy/">Probability distribution parameters in SciPy</a><br />
<a href="http://www.johndcook.com/blog/2009/07/20/probability-distributions-scipy/"></a><a href="http://www.johndcook.com/blog/2009/03/19/ironclad-ironpytho/">Numerical computing in IronPython with Ironclad</a><br />
<a href="http://www.codeproject.com/KB/library/scipy.aspx">Getting started with SciPy</a></p>
<img src="http://feeds.feedburner.com/~r/TheEndeavour/~4/pboSqykOVHU" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.johndcook.com/blog/2010/02/03/computing-parameters-from-percentiles/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://www.johndcook.com/blog/2010/02/03/computing-parameters-from-percentiles/</feedburner:origLink></item>
		<item>
		<title>Probability distribution parameterizations in SciPy</title>
		<link>http://feedproxy.google.com/~r/TheEndeavour/~3/nIFP2bLFx4M/</link>
		<comments>http://www.johndcook.com/blog/2010/02/03/statistical-distributions-in-scipy/#comments</comments>
		<pubDate>Wed, 03 Feb 2010 18:58:29 +0000</pubDate>
		<dc:creator>John</dc:creator>
				<category><![CDATA[Python]]></category>
		<category><![CDATA[Software development]]></category>
		<category><![CDATA[Statistics]]></category>
		<category><![CDATA[Probability and Statistics]]></category>
		<category><![CDATA[SciPy]]></category>

		<guid isPermaLink="false">http://www.johndcook.com/blog/?p=4408</guid>
		<description><![CDATA[Parameterizations are the bane of statistical software. One of the most common errors is to assume that one software package uses the same parameterization as another package. For example, some packages specify the exponential distribution in terms of the mean but others use the rate.
Python&#8217;s SciPy library has a somewhat unusual approach to parameterization with [...]]]></description>
			<content:encoded><![CDATA[<p><strong>Parameterizations are the bane of statistical software</strong>. One of the most common errors is to assume that one software package uses the same parameterization as another package. For example, some packages specify the exponential distribution in terms of the <em>mean</em> but others use the <em>rate</em>.<span id="more-4408"></span></p>
<p>Python&#8217;s <a href="http://www.scipy.org/">SciPy</a> library has a somewhat unusual approach to parameterization with some advantages. SciPy makes every continuous distribution a location-scale family, even those distributions that typically do not have a location or scale parameter. This eliminates, for example, the question of whether an exponential distribution is parameterized by its mean or its rate. There is no mean or rate parameter <em>per se</em>. But there is a scale parameter, which happens to also be the mean.</p>
<p>Some methods on distribution classes have unusual names. For example, the inverse CDF function, often called the quantile function, is <code>ppf</code> for &#8220;percentile point function.&#8221; The complementary CDF function, or CCDF, is called <code>sf</code> for &#8220;survival function.&#8221; (Survival function is not an unusual name, though my preference would have been <code>ccdf</code> since that would make the API more <a href="http://www.johndcook.com/blog/2008/10/14/api-symmetry/">symmetric</a>.)</p>
<p>Discrete distributions in SciPy do not have a scale parameter. Also instead of a <code>pdf</code> method the discrete distributions have a <code>pmf</code> method; continuous functions have a probability <em>density</em> function but discrete methods have a probability <em>mass</em> function.</p>
<p>One surprise with SciPy distributions is that the SciPy implementation of the lognormal distribution does not correspond to the <a href="http://www.johndcook.com/distribution_chart.html#lognormal">definition I&#8217;m more familiar with</a> unless the location is 0. In order to be consistent with other continuous distributions, SciPy shifts the PDF argument x whereas I believe it is more common to shift log(x). This isn&#8217;t just a difference in parameterization. It actually amounts to different distributions.</p>
<p>For more details, see these notes on <a href="http://www.johndcook.com/distributions_scipy.html">distributions in SciPy</a>. See also these notes on distributions in <a href="http://www.johndcook.com/distributions_R_SPLUS.html">R</a> and in <a href="http://www.johndcook.com/distributions_Mathematica.html">Mathematica</a> for comparison.</p>
<p><strong>Related posts</strong>:</p>
<p><a href="http://www.johndcook.com/blog/2009/07/20/probability-distributions-scipy/">Basics of distributions in SciPy</a><br />
<a href="http://www.codeproject.com/KB/library/scipy.aspx">Getting started with SciPy</a><br />
<a href="http://www.johndcook.com/blog/2009/07/21/ieee-arithmetic-python/">IEEE floating point arithmetic in Python</a></p>
<img src="http://feeds.feedburner.com/~r/TheEndeavour/~4/nIFP2bLFx4M" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.johndcook.com/blog/2010/02/03/statistical-distributions-in-scipy/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		<feedburner:origLink>http://www.johndcook.com/blog/2010/02/03/statistical-distributions-in-scipy/</feedburner:origLink></item>
		<item>
		<title>Little programs versus big programs</title>
		<link>http://feedproxy.google.com/~r/TheEndeavour/~3/HzkuOPH-FBk/</link>
		<comments>http://www.johndcook.com/blog/2010/02/03/little-programs-versus-big-programs/#comments</comments>
		<pubDate>Wed, 03 Feb 2010 13:00:58 +0000</pubDate>
		<dc:creator>John</dc:creator>
				<category><![CDATA[Software development]]></category>
		<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://www.johndcook.com/blog/?p=4398</guid>
		<description><![CDATA[From You Are Not a Gadget:
Little programs are delightful to write in isolation, but the process of maintaining large-scale software is always miserable. &#8230; Technologists wish every program behaved like a brand-new, playful little program, and will use any available psychological strategy to avoid thinking about computers realistically.
Related posts:
Writes large, correct programs
Why there will always [...]]]></description>
			<content:encoded><![CDATA[<p>From <a href="http://www.amazon.com/gp/product/0307269647?ie=UTF8&amp;tag=theende-20&amp;linkCode=as2&amp;camp=1789&amp;creative=390957&amp;creativeASIN=0307269647">You Are Not a Gadget</a>:</p>
<blockquote><p>Little programs are delightful to write in isolation, but the process of maintaining large-scale software is always miserable. &#8230; Technologists wish every program behaved like a brand-new, playful little program, and will use any available psychological strategy to avoid thinking about computers realistically.</p></blockquote>
<p><strong>Related posts</strong>:</p>
<p><a href="http://www.johndcook.com/blog/2008/09/19/writes-large-correct-programs/">Writes large, correct programs</a><br />
<a href="http://www.johndcook.com/blog/2008/10/27/why-there-will-always-be-programmers/">Why there will always be programmers</a></p>
<img src="http://feeds.feedburner.com/~r/TheEndeavour/~4/HzkuOPH-FBk" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.johndcook.com/blog/2010/02/03/little-programs-versus-big-programs/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		<feedburner:origLink>http://www.johndcook.com/blog/2010/02/03/little-programs-versus-big-programs/</feedburner:origLink></item>
		<item>
		<title>Sleep debt and industrial accidents</title>
		<link>http://feedproxy.google.com/~r/TheEndeavour/~3/XDje9fca6P4/</link>
		<comments>http://www.johndcook.com/blog/2010/02/02/sleep-debt-and-industrial-accidents/#comments</comments>
		<pubDate>Tue, 02 Feb 2010 23:06:28 +0000</pubDate>
		<dc:creator>John</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[Productivity]]></category>
		<category><![CDATA[Quality]]></category>

		<guid isPermaLink="false">http://www.johndcook.com/blog/?p=4396</guid>
		<description><![CDATA[From The Power of Full Engagement:
&#8230; every one of the great industrial disasters of the past twenty years — Chernobyl, the Exxon Valdez, Bhopal, Three Mile Island — occurred in the middle of the night. For the most part, those in charge had worked very long hours and built up considerable sleep debt.
]]></description>
			<content:encoded><![CDATA[<p>From <a href="http://www.amazon.com/gp/product/0743226755?ie=UTF8&amp;tag=theende-20&amp;linkCode=as2&amp;camp=1789&amp;creative=390957&amp;creativeASIN=0743226755">The Power of Full Engagement</a>:</p>
<blockquote><p>&#8230; every one of the great industrial disasters of the past twenty years — Chernobyl, the Exxon Valdez, Bhopal, Three Mile Island — occurred in the middle of the night. For the most part, those in charge had worked very long hours and built up considerable sleep debt.</p></blockquote>
<img src="http://feeds.feedburner.com/~r/TheEndeavour/~4/XDje9fca6P4" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.johndcook.com/blog/2010/02/02/sleep-debt-and-industrial-accidents/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://www.johndcook.com/blog/2010/02/02/sleep-debt-and-industrial-accidents/</feedburner:origLink></item>
		<item>
		<title>New Python podcast: A little bit of Python</title>
		<link>http://feedproxy.google.com/~r/TheEndeavour/~3/dSCwkzWBjX0/</link>
		<comments>http://www.johndcook.com/blog/2010/02/01/new-python-podcast-a-little-bit-of-python/#comments</comments>
		<pubDate>Tue, 02 Feb 2010 02:38:43 +0000</pubDate>
		<dc:creator>John</dc:creator>
				<category><![CDATA[Python]]></category>
		<category><![CDATA[Software development]]></category>

		<guid isPermaLink="false">http://www.johndcook.com/blog/?p=4386</guid>
		<description><![CDATA[There&#8217;s a new Python podcast: A little bit of Python with Michael Foord, Brett Cannon, Jesse Noller, Steve Holden, and Andrew Kuchling.
So far I&#8217;ve found the first episode most interesting. It discusses the &#8220;moratorium&#8221;, the plan to give Python library authors time catch up with Python 3 before extending the core language further. This sounds [...]]]></description>
			<content:encoded><![CDATA[<p>There&#8217;s a new Python podcast: <a href="http://www.voidspace.org.uk/python/weblog/arch_d7_2010_01_30.shtml#e1153">A little bit of Python</a> with Michael Foord, Brett Cannon, Jesse Noller, Steve Holden, and Andrew Kuchling.</p>
<p>So far I&#8217;ve found the first episode most interesting. It discusses the &#8220;moratorium&#8221;, the plan to give Python library authors time catch up with Python 3 before extending the core language further. This sounds like a very smart move.</p>
<p><strong>Related posts</strong>:</p>
<p><a href="http://www.johndcook.com/blog/2009/08/17/good-enough-for-google-and-nasa/">Good enough for Google and NASA</a><br />
<a href="http://www.johndcook.com/blog/2009/05/08/plain-python/">Plain Python</a></p>
<img src="http://feeds.feedburner.com/~r/TheEndeavour/~4/dSCwkzWBjX0" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.johndcook.com/blog/2010/02/01/new-python-podcast-a-little-bit-of-python/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		<feedburner:origLink>http://www.johndcook.com/blog/2010/02/01/new-python-podcast-a-little-bit-of-python/</feedburner:origLink></item>
		<item>
		<title>Updating “PowerShell Day 1″ for PowerShell version 2.0</title>
		<link>http://feedproxy.google.com/~r/TheEndeavour/~3/h9f6eV5vhw4/</link>
		<comments>http://www.johndcook.com/blog/2010/02/01/updating-powershell-day-1-for-powershell-version-2-0/#comments</comments>
		<pubDate>Mon, 01 Feb 2010 18:30:32 +0000</pubDate>
		<dc:creator>John</dc:creator>
				<category><![CDATA[PowerShell]]></category>

		<guid isPermaLink="false">http://www.johndcook.com/blog/?p=4381</guid>
		<description><![CDATA[Last year I wrote a little 10-page booklet called PowerShell Day 1. It covers many of the things I wish I had known when I started using PowerShell.

How do I configure PowerShell?
How do I make PowerShell launch faster?
How do I get documentation?
Why did PowerShell make some of the design decisions they did?
Once I’ve written some [...]]]></description>
			<content:encoded><![CDATA[<p>Last year I wrote a little 10-page booklet called <a href="http://www.johndcook.com/powershellbooklet.html">PowerShell Day 1</a>. It covers many of the things I wish I had known when I started using PowerShell.</p>
<ul>
<li>How do I configure PowerShell?</li>
<li>How do I make PowerShell launch faster?</li>
<li>How do I get documentation?</li>
<li>Why did PowerShell make some of the design decisions they did?</li>
<li>Once I’ve written some useful functions and scripts, where do I put them?</li>
<li>Where can I find more PowerShell resources?</li>
</ul>
<p>Now I&#8217;ve started updating the booklet to reflect changes in PowerShell version 2.0. I haven&#8217;t had a lot of experience with version 2.0 and would appreciate your help updating the booklet. I have put a link to an alpha version of the update for version 2.0 on the <a href="http://www.johndcook.com/powershellbooklet.html">download page</a>.</p>
<img src="http://feeds.feedburner.com/~r/TheEndeavour/~4/h9f6eV5vhw4" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.johndcook.com/blog/2010/02/01/updating-powershell-day-1-for-powershell-version-2-0/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://www.johndcook.com/blog/2010/02/01/updating-powershell-day-1-for-powershell-version-2-0/</feedburner:origLink></item>
		<item>
		<title>Parameters and percentiles</title>
		<link>http://feedproxy.google.com/~r/TheEndeavour/~3/R6oHZySEv2A/</link>
		<comments>http://www.johndcook.com/blog/2010/01/31/parameters-from-percentiles/#comments</comments>
		<pubDate>Sun, 31 Jan 2010 20:00:49 +0000</pubDate>
		<dc:creator>John</dc:creator>
				<category><![CDATA[Statistics]]></category>
		<category><![CDATA[Bayesian]]></category>
		<category><![CDATA[Probability and Statistics]]></category>

		<guid isPermaLink="false">http://www.johndcook.com/blog/?p=4351</guid>
		<description><![CDATA[The doctor says 10% of patients respond within 30 days of treatment and 80% respond within 90 days of treatment. Now go turn that into a probability distribution. That&#8217;s a common task in Bayesian statistics, capturing expert opinion in a mathematical form to create a prior distribution.

Things would be easier if you could ask subject [...]]]></description>
			<content:encoded><![CDATA[<p>The doctor says 10% of patients respond within 30 days of treatment and 80% respond within 90 days of treatment. Now go turn that into a probability distribution. That&#8217;s a common task in Bayesian statistics, capturing expert opinion in a mathematical form to create a prior distribution.</p>
<p style="text-align: center;"><img src="http://www.johndcook.com/gamma_percentiles.png" alt="Graph of gamma density with 10th percentile at 30 and 80th percentile at 90" width="360" height="223" /></p>
<p>Things would be easier if you could ask subject matter experts to express their opinions in statistical terms. You could ask &#8220;If you were to represent your belief as a gamma distribution, what would the shape and scale parameters be?&#8221; But that&#8217;s ridiculous. Even if they understood the question, it&#8217;s unlikely they&#8217;d give an accurate answer. It&#8217;s easier to think in terms of percentiles.</p>
<p>Asking for mean and variance are not much better than asking for shape and scale, especially for a non-symmetric distribution such as a survival curve. Anyone who knows what variance is probably thinks about it in terms of a normal distribution. Asking for mean and variance encourages someone to think about a symmetric distribution.</p>
<p>So once you have specified a couple percentiles, such as the example this post started with, can you find parameters that meet these requirements? If you can&#8217;t meet both requirements, how close can you come to satisfying them? Does it depend on how far apart the percentiles are? The answers to these questions depend on the distribution family. Obviously you can&#8217;t satisfy two requirements with a one-parameter distribution in general. If you have two requirements and two parameters, at least it&#8217;s feasible that both can be satisfied.</p>
<p>If you have a random variable X whose distribution depends on two parameters, when can you find parameter values  so that Prob(X ≤ x<sub>1</sub>) = p<sub>1</sub> and Prob(X ≤ x<sub>2</sub>) = p<sub>2</sub>? For starters, if x<sub>1</sub> is less than x<sub>2</sub> then p<sub>1</sub> must be less than p<sub>2</sub>. For example, the probability of a variable being less than 5 cannot be bigger than the probability of being less than 6. For some common distributions, the only requirement is this requirement that the x&#8217;s and p&#8217;s be in a consistent order.</p>
<p>For a location-scale family, such as the normal or Cauchy distributions, you can always find a location and scale parameter to satisfy two percentile conditions. In fact, there&#8217;s a simple expression for the parameters. The location parameter is given by</p>
<p style="text-align: center;"><img src="http://www.johndcook.com/location_parameter.gif" alt="\frac{x_1 F^{-1}(p_2) - x_2 F^{-1}(p_1)}{F^{-1}(p_2) - F^{-1}(p_1)}" width="174" height="40" /></p>
<p>and the scale parameter is given by</p>
<p style="text-align: center;"><img src="http://www.johndcook.com/scale_parameter.gif" alt="\frac{x_2 - x_1}{F^{-1}(p_2) - F^{-1}(p_1)}" width="140" height="33" /></p>
<p>where F(x) is the CDF of the distribution representative with location 0 and scale 1.</p>
<p>The shape and scale parameters of a Weibull distribution can also be found in closed form. For a gamma distribution, parameters to satisfy the percentile requirements always exist. The parameters are easy to determine numerically but there is no simple expression for them.</p>
<p>For more details, see <a href="http://www.johndcook.com/quantiles_parameters.pdf">Determining distribution parameters from quantiles</a>. See also the <a href="http://biostatistics.mdanderson.org/SoftwareDownload/SingleSoftware.aspx?Software_Id=6">ParameterSolver</a> software.</p>
<p><strong>Update</strong>: I posted an <a href="http://www.codeproject.com/KB/recipes/ParameterPercentile.aspx">article</a> on CodeProject with Python code for computing the parameters described here.</p>
<p><strong>Related posts</strong>:</p>
<p><a href="http://www.johndcook.com/blog/2010/01/13/biostatistics-software/">Biostatistics software</a><br />
<a href="http://www.johndcook.com/distribution_chart.html">Diagram of distribution relationships</a><br />
<a href="http://www.johndcook.com/blog/2008/04/28/how-to-calculate-percentiles-in-memory-bound-applications/">How to calculate percentiles in memory-bound applications</a></p>
<img src="http://feeds.feedburner.com/~r/TheEndeavour/~4/R6oHZySEv2A" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.johndcook.com/blog/2010/01/31/parameters-from-percentiles/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		<feedburner:origLink>http://www.johndcook.com/blog/2010/01/31/parameters-from-percentiles/</feedburner:origLink></item>
		<item>
		<title>Economics rap</title>
		<link>http://feedproxy.google.com/~r/TheEndeavour/~3/uij1FfnmEv4/</link>
		<comments>http://www.johndcook.com/blog/2010/01/30/economics-rap/#comments</comments>
		<pubDate>Sun, 31 Jan 2010 03:50:05 +0000</pubDate>
		<dc:creator>John</dc:creator>
				<category><![CDATA[Business]]></category>

		<guid isPermaLink="false">http://www.johndcook.com/blog/?p=4377</guid>
		<description><![CDATA[The debate between economists John Maynard Keynes and F. A. Hayek set to rap.

Related post:
The one thing to remember in economics
]]></description>
			<content:encoded><![CDATA[<p>The debate between economists John Maynard Keynes and F. A. Hayek set to rap.</p>
<p><object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" width="480" height="295" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0"><param name="allowFullScreen" value="true" /><param name="allowscriptaccess" value="always" /><param name="src" value="http://www.youtube.com/v/d0nERTFo-Sk&amp;hl=en_US&amp;fs=1&amp;rel=0" /><param name="allowfullscreen" value="true" /><embed type="application/x-shockwave-flash" width="480" height="295" src="http://www.youtube.com/v/d0nERTFo-Sk&amp;hl=en_US&amp;fs=1&amp;rel=0" allowscriptaccess="always" allowfullscreen="true"></embed></object></p>
<p><strong>Related post</strong>:</p>
<p><a href="http://www.johndcook.com/blog/2008/10/31/one-thing-to-remember-in-economics/">The one thing to remember in economics</a></p>
<img src="http://feeds.feedburner.com/~r/TheEndeavour/~4/uij1FfnmEv4" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.johndcook.com/blog/2010/01/30/economics-rap/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		<feedburner:origLink>http://www.johndcook.com/blog/2010/01/30/economics-rap/</feedburner:origLink></item>
		<item>
		<title>Weekend miscellany</title>
		<link>http://feedproxy.google.com/~r/TheEndeavour/~3/EgqgFDOAL70/</link>
		<comments>http://www.johndcook.com/blog/2010/01/29/weekend-miscellany-22/#comments</comments>
		<pubDate>Fri, 29 Jan 2010 20:20:51 +0000</pubDate>
		<dc:creator>John</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://www.johndcook.com/blog/?p=4345</guid>
		<description><![CDATA[Science
Diamond oceans
Plants put the bend in rivers
State of biology data integration
Programming
Developer town (little individual houses as offices)
.NET framework install base
Evolution of a Python programmer
How to recognize a good programmer
Miscellaneous
Crayola history
Visa restriction index
LaTeX search
The perverse economics of college construction
Odds that best potential chess player has never played chess
Paying more for information than for food
]]></description>
			<content:encoded><![CDATA[<p><strong>Science</strong></p>
<p><a href="http://news.discovery.com/space/diamond-oceans-jupiter-uranus.html">Diamond oceans</a><br />
<a href="http://www.scientificamerican.com/podcast/episode.cfm?id=plants-put-the-bend-in-rivers-10-01-26">Plants put the bend in rivers</a><br />
<a href="http://digitheadslabnotebook.blogspot.com/2010/01/state-of-data-integration-for-biology.html">State of biology data integration</a></p>
<p><strong>Programming</strong></p>
<p><a href="http://developertown.com/blog/2010/1/8/why-houses.html">Developer town</a> (little individual houses as offices)<br />
<a href="http://www.hanselman.com/blog/HowManyPCsInTheWorldHaveTheNETFrameworkInstalled.aspx">.NET framework install base</a><br />
<a href="http://gist.github.com/289467">Evolution of a Python programmer</a><br />
<a href="http://www.inter-sections.net/2007/11/13/how-to-recognise-a-good-programmer">How to recognize a good programmer</a></p>
<p><strong>Miscellaneous</strong></p>
<p><a href="http://www.weathersealed.com/tags/crayons/">Crayola history</a><br />
<a href="http://factlets.info/visaneeded.html">Visa restriction index</a><br />
<a href="http://www.latexsearch.com/LatexTool/">LaTeX search</a><br />
<a href="http://scienceblogs.com/principles/2010/01/the_perverse_economics_of_coll.php">The perverse economics of college construction</a><br />
<a href="http://www.marginalrevolution.com/marginalrevolution/2009/12/what-are-the-odds-that-the-best-chess-player-in-the-world-has-never-played-chess.html">Odds that best potential chess player has never played chess</a><br />
<a href="http://www.smartplanet.com/business/blog/business-brains/we-spend-more-on-free-information-than-we-spend-on-food/4591/">Paying more for information than for food</a></p>
<img src="http://feeds.feedburner.com/~r/TheEndeavour/~4/EgqgFDOAL70" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.johndcook.com/blog/2010/01/29/weekend-miscellany-22/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		<feedburner:origLink>http://www.johndcook.com/blog/2010/01/29/weekend-miscellany-22/</feedburner:origLink></item>
		<item>
		<title>Universal time</title>
		<link>http://feedproxy.google.com/~r/TheEndeavour/~3/kibmAxOWu3c/</link>
		<comments>http://www.johndcook.com/blog/2010/01/28/universal-time/#comments</comments>
		<pubDate>Fri, 29 Jan 2010 04:01:06 +0000</pubDate>
		<dc:creator>John</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://www.johndcook.com/blog/?p=3836</guid>
		<description><![CDATA[
Universal time (UTC) is the same as Greenwich Mean Time (GMT), give or take a second. It&#8217;s essentially the time in Greenwich, England except it ignores Daylight Savings Time.
The abbreviation UTC is an odd compromise. The French wanted to use the abbreviation TUC (temps universel coordonné) and the English wanted to use CUT (coordinated universal [...]]]></description>
			<content:encoded><![CDATA[<p><img class="alignnone" src="http://www.johndcook.com/clock.jpg" alt="" width="288" height="216" /></p>
<p>Universal time (UTC) is the same as Greenwich Mean Time (GMT), give or take a second. It&#8217;s essentially the time in Greenwich, England except it ignores Daylight Savings Time.</p>
<p>The abbreviation UTC is an odd compromise. The French wanted to use the abbreviation TUC (<span lang="fr">temps universel coordonné) and the English wanted to use CUT (coordinated universal time). The compromise was UTC, which doesn&#8217;t actually abbreviate anything.</span></p>
<p>Sometimes a &#8216;Z&#8217; is appended to a time to indicate it is expressed in UTC. The <a href="http://en.wikipedia.org/wiki/NATO_phonetic_alphabet">NATO phonetic alphabet</a> code for &#8216;Z&#8217; is ZULU, and so UTC is sometimes called &#8220;Zulu Time.&#8221;</p>
<p>It&#8217;s useful to know how your time zone relates to UTC. (You can look it up <a href="http://www.timeanddate.com/worldclock/converter.html">here</a>.) For example, I live in the US Central time zone. Central Standard Time (CST) is UTC-6, i.e. we&#8217;re 6 hours behind Greenwich. Knowing your time relative to UTC makes international communication easier. It also helps you read computer time stamps since these almost always use UTC.</p>
<p>One of the advantages of UTC is that it avoids Daylight Savings Time. DST is surprisingly complicated when you look at it in detail.  Some countries observe DST and some do not. Countries that do observe DST may begin and end DST on different dates, and those dates can change from year to year. And inside countries that observe DST some regions are exceptions. For example, the United States generally observes DST, but Arizona does not. Actually, it&#8217;s even more complicated: The Navajo Nation inside Arizona <em>does</em> observe DST.</p>
<p><strong>Related posts</strong>:</p>
<p><a href="http://www.johndcook.com/blog/2009/09/15/mercator-projection/">Mercator projection</a><br />
<a href="http://www.johndcook.com/blog/2008/09/11/finding-distances-using-latitude-and-longitude/">Find distances using longitude and latitude</a><br />
<a href="../2008/06/13/solving-the-problem-with-visual-source-safe-and-time-zones/">Visual Source Safe and time zones</a></p>
<img src="http://feeds.feedburner.com/~r/TheEndeavour/~4/kibmAxOWu3c" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.johndcook.com/blog/2010/01/28/universal-time/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		<feedburner:origLink>http://www.johndcook.com/blog/2010/01/28/universal-time/</feedburner:origLink></item>
		<item>
		<title>Statisticians take themselves too seriously</title>
		<link>http://feedproxy.google.com/~r/TheEndeavour/~3/wgGadlvsOoI/</link>
		<comments>http://www.johndcook.com/blog/2010/01/28/statisticians-take-themselves-too-seriously/#comments</comments>
		<pubDate>Thu, 28 Jan 2010 14:37:56 +0000</pubDate>
		<dc:creator>John</dc:creator>
				<category><![CDATA[Statistics]]></category>
		<category><![CDATA[Probability and Statistics]]></category>

		<guid isPermaLink="false">http://www.johndcook.com/blog/?p=4337</guid>
		<description><![CDATA[I suppose most people take themselves too seriously, but I&#8217;ve been thinking specifically about how statisticians take themselves too seriously.
The fundamental task of statistics is making decisions in the presence of uncertainty, and that&#8217;s hard. You have to make all kinds of simplifying assumptions and arbitrary choices to get anywhere. But after a while you [...]]]></description>
			<content:encoded><![CDATA[<p>I suppose most people take themselves too seriously, but I&#8217;ve been thinking specifically about how statisticians take themselves too seriously.</p>
<p>The fundamental task of statistics is making decisions in the presence of uncertainty, and that&#8217;s hard. You have to make all kinds of simplifying assumptions and arbitrary choices to get anywhere. But after a while you lose sight of these decisions. Or you justify your decisions after the fact, making a virtue out of a necessity. After you&#8217;ve worked on a problem long enough, it&#8217;s nearly impossible to say &#8220;Of course, our whole way of thinking about this might have been wrong from the beginning.&#8221;</p>
<p>My concern is not so much &#8220;creative&#8221; statistics but rather uncreative statistics, rote application of established methods. Statistics is extremely conventional. But a procedure is not objective just because it is conventional.  An arbitrary choice made 80 years ago is still an arbitrary choice.</p>
<p>I&#8217;ve taken myself too seriously at times in regard to statistical matters; it&#8217;s easy to get caught up in your model. But I&#8217;m reminded of a talk I heard one time in which the speaker listed a number of embarrassing things that people used to believe. He was not making a smug comparison of how sophisticated we are now compared to our ignorant ancestors. Instead, his point was that we too may be mistaken. He exhorted everyone to look in a mirror and say &#8220;I may be wrong. I may be very, very wrong.&#8221;</p>
<p><strong>Related posts</strong>:</p>
<p><a href="http://www.johndcook.com/blog/2009/08/31/the-iot-test/">The IOT test</a><br />
<a href="http://www.johndcook.com/blog/2009/02/01/bike-shed-arguments/">Bike shed arguments</a><br />
<a href="http://www.johndcook.com/blog/2009/02/18/the-data-may-not-contain-the-answer/">The data may not contain the answer</a><br />
<a href="http://www.johndcook.com/blog/2008/04/22/problems-versus-dilemmas/">Problems versus dilemmas</a><br />
<a href="http://www.johndcook.com/blog/2008/07/10/approximate-problems-and-approximate-solutions/">Approximate problems and approximate solutions</a></p>
<img src="http://feeds.feedburner.com/~r/TheEndeavour/~4/wgGadlvsOoI" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.johndcook.com/blog/2010/01/28/statisticians-take-themselves-too-seriously/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		<feedburner:origLink>http://www.johndcook.com/blog/2010/01/28/statisticians-take-themselves-too-seriously/</feedburner:origLink></item>
		<item>
		<title>Engineering in the open</title>
		<link>http://feedproxy.google.com/~r/TheEndeavour/~3/fdBq2fCVl5k/</link>
		<comments>http://www.johndcook.com/blog/2010/01/26/engineering-in-the-open/#comments</comments>
		<pubDate>Wed, 27 Jan 2010 00:56:40 +0000</pubDate>
		<dc:creator>John</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[Quotes]]></category>

		<guid isPermaLink="false">http://www.johndcook.com/blog/?p=4319</guid>
		<description><![CDATA[From Herbert Hoover, mining engineer and 31st President of the United States:
The great liability of the engineer compared to men of other professions is that his works are out in the open where all can see them. His acts, step by step, are in hard substance. He cannot bury his mistakes in the grave like [...]]]></description>
			<content:encoded><![CDATA[<p>From Herbert Hoover, mining engineer and 31st President of the United States:</p>
<blockquote><p>The great liability of the engineer compared to men of other professions is that his works are out in the open where all can see them. His acts, step by step, are in hard substance. He cannot bury his mistakes in the grave like the doctors. He cannot argue them into thin air or blame the judge like the lawyers. He cannot, like the architects, cover his failures with trees and vines. He cannot, like the politicians, screen his sort-comings by blaming his opponents and hope the people will forget. The engineer simply cannot deny he did it. If his works do not work, he is damned.</p></blockquote>
<p><img alt="Herbert Hoover photo" src="http://www.johndcook.com/hoover.jpg" class="alignnone" width="130" height="178" /></p>
<p><strong>Related posts</strong>:</p>
<p><a href="http://www.johndcook.com/blog/2008/11/12/architects-versus-engineers/">Architects versus engineers</a><br />
<a href="http://www.johndcook.com/blog/2009/06/05/reverse-engineer/">Catalog engineering and reverse engineering</a></p>
<img src="http://feeds.feedburner.com/~r/TheEndeavour/~4/fdBq2fCVl5k" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.johndcook.com/blog/2010/01/26/engineering-in-the-open/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		<feedburner:origLink>http://www.johndcook.com/blog/2010/01/26/engineering-in-the-open/</feedburner:origLink></item>
		<item>
		<title>Estimating reporting rates</title>
		<link>http://feedproxy.google.com/~r/TheEndeavour/~3/_SyGxJ3OWck/</link>
		<comments>http://www.johndcook.com/blog/2010/01/25/estimating-reporting-rates/#comments</comments>
		<pubDate>Mon, 25 Jan 2010 15:30:31 +0000</pubDate>
		<dc:creator>John</dc:creator>
				<category><![CDATA[Statistics]]></category>
		<category><![CDATA[Probability and Statistics]]></category>

		<guid isPermaLink="false">http://www.johndcook.com/blog/?p=4309</guid>
		<description><![CDATA[Suppose the police department in your community reported an average of 10 burglaries per month. You could take that at face value and assume there are 10 burglaries per month. But maybe there are 20 burglaries a month but only half are reported.  How could you tell?
Here&#8217;s a similar problem.  Suppose you gave away an [...]]]></description>
			<content:encoded><![CDATA[<p>Suppose the police department in your community reported an average of 10 burglaries per month. You could take that at face value and assume there are 10 burglaries per month. But maybe there are 20 burglaries a month but only half are reported.  How could you tell?</p>
<p>Here&#8217;s a similar problem.  Suppose you gave away an electronic book.  You stated that people are free to distribute it however they want, but that you&#8217;d appreciate feedback.  How could you estimate the number of people who have read the book?  If you get email from 100 readers, you know at least 100 people have read it, but maybe 10,000 people have read it and only 1% sent email.  How can you estimate the number of readers and the percentage who send email at the same time?</p>
<p><span id="more-4309"></span></p>
<p>The key is the variability in the data.  You could never tell by looking at the average alone. If there were an average of 10 burglaries per month, the data would be less variable than if there were an average of 20 burglaries per month with only half reported.  Along the same lines, big variations in the amount of fan mail suggest that there may be many readers but few who send email.</p>
<p>The statistical problem is estimating the parameters (<em>n</em>, <em>p</em>) of a binomial distribution.  The expected number of reported events is <em>np</em> where <em>n</em> is the total number of events and <em>p</em> is the probability that an event will be reported.  Suppose one town has <em>n</em><sub>1</sub> actual burglaries with each burglary having a probability <em>p</em><sub>1</sub> of being reported.  The other town has <em>n</em><sub>2</sub> burglaries with a probability <em>p</em><sub>2</sub> of being reported. If the expected number of reported burglaries are equal, then <em>n</em><sub>1</sub><em>p</em><sub>1</sub> = <em>n</em><sub>2</sub> <em>p</em><sub>2</sub> = <em>r</em>. The variance in the burglary reports from the two towns will be <em>r</em>(1 &#8211; <em>p</em><sub>1</sub>) and <em>r</em>(1 &#8211; <em>p</em><sub>2</sub>). If <em>p</em><sub>1</sub> is less than <em>p</em><sub>2</sub> there will be more variance in the data from the first city.</p>
<p>Estimating binomial parameters is complicated and I won&#8217;t give the details here.  If <em>n</em> were known, estimating <em>p</em> would be trivial. But when <em>n</em> and <em>p</em> are both unknown, this is a much harder problem. Still, there are ways to approach the problem.</p>
<img src="http://feeds.feedburner.com/~r/TheEndeavour/~4/_SyGxJ3OWck" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.johndcook.com/blog/2010/01/25/estimating-reporting-rates/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
		<feedburner:origLink>http://www.johndcook.com/blog/2010/01/25/estimating-reporting-rates/</feedburner:origLink></item>
		<item>
		<title>Make something and sell it</title>
		<link>http://feedproxy.google.com/~r/TheEndeavour/~3/HHkFcIpYads/</link>
		<comments>http://www.johndcook.com/blog/2010/01/22/make-something-and-sell-it/#comments</comments>
		<pubDate>Fri, 22 Jan 2010 15:10:45 +0000</pubDate>
		<dc:creator>John</dc:creator>
				<category><![CDATA[Business]]></category>

		<guid isPermaLink="false">http://www.johndcook.com/blog/?p=4298</guid>
		<description><![CDATA[I&#8217;ve run across a couple podcasts this week promoting the radical idea that you should sell what you make.
The latest Entrepreneurial Thought Leaders podcast features David Heineimeier Hansson&#8217;s talk Unlearn Your MBA which he gave to a room full of MBA students.
The latest Tech Nation podcast from IT Conversations is an interview with Jaron Lanier. [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve run across a couple podcasts this week promoting the radical idea that you should sell what you make.</p>
<p>The latest <a href="http://ecorner.stanford.edu/podcasts.html">Entrepreneurial Thought Leaders</a> podcast features David Heineimeier Hansson&#8217;s talk <a href="http://ecorner.stanford.edu/authorMaterialInfo.html?mid=2334">Unlearn Your MBA</a> which he gave to a room full of MBA students.</p>
<p>The latest Tech Nation podcast from <a href="http://itc.conversationsnetwork.org/">IT Conversations</a> is an <a href="http://itc.conversationsnetwork.org/shows/detail4373.html">interview</a> with Jaron Lanier. Lanier is a virtual reality pioneer and the author of <a href="http://www.amazon.com/gp/product/0307269647?ie=UTF8&amp;tag=theende-20&amp;linkCode=xm2&amp;camp=1789&amp;creativeASIN=0307269647">You Are Not A Gadget</a>.</p>
<p>Both Hansson and Lanier have contributed to the &#8220;free&#8221; culture but both are also critical of it. Hansson says he has benefited greatly from open source software and make his Ruby on Rails framework open source as a way to contribute back to the open source community. But he is also scathingly critical of businesses that think they can make money by giving everything away.</p>
<p>Lanier was an early critic of intellectual property rights but has reversed his original position. He says he&#8217;s an empiricist and that data have convinced him he was dead wrong. He now says that the idea of giving away intellectual property as advertising bait is unsustainable and will have dire consequences.</p>
<p>Giving away content to make money indirectly works for some businesses. But it&#8217;s alarming that so many people believe that is the <em>only</em> rational or moral way to make money if you create intellectual property.  Many people are saying things such as the following.</p>
<ul>
<li> Musicians should give away their music and make money off concerts and T-shirts.</li>
<li>Authors should give away their books and make money on the lecture circuit.</li>
<li>Programmers should give away their software and make money from consulting.</li>
</ul>
<p>There&#8217;s an anti-intellectual thread running through these arguments. It&#8217;s a materialistic way of thinking, valuing only tangible artifacts and not ideas. It&#8217;s OK for a potter to sell pots, but a musician should not sell music. It&#8217;s OK for teachers to make money by the hour for teaching, but they should not make money from writing books. It&#8217;s OK for programmers to sell their time as consultants, and maybe even to sell their time as a programmers, but they should not sell the products of their labor. It&#8217;s OK to sell physical objects or to sell time, but not to sell intellectual property.</p>
<p><strong>Related post</strong>:</p>
<p><a href="http://www.johndcook.com/blog/2009/09/22/software-profitability-in-the-middle/">Software profitability in the middle</a><br />
<a href="http://www.johndcook.com/blog/2009/07/09/emily-dickinson-versus-paris-hilton/">Emily Dickinson versus Paris Hilton</a><br />
<a href="http://www.johndcook.com/blog/2008/02/12/how-to-avoid-being-outsourced-or-open-sourced/">How to avoid being outsourced or open sourced</a></p>
<img src="http://feeds.feedburner.com/~r/TheEndeavour/~4/HHkFcIpYads" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.johndcook.com/blog/2010/01/22/make-something-and-sell-it/feed/</wfw:commentRss>
		<slash:comments>21</slash:comments>
		<feedburner:origLink>http://www.johndcook.com/blog/2010/01/22/make-something-and-sell-it/</feedburner:origLink></item>
		<item>
		<title>How to compute the soft maximum</title>
		<link>http://feedproxy.google.com/~r/TheEndeavour/~3/pfFYBjvTO10/</link>
		<comments>http://www.johndcook.com/blog/2010/01/20/how-to-compute-the-soft-maximum/#comments</comments>
		<pubDate>Thu, 21 Jan 2010 01:01:52 +0000</pubDate>
		<dc:creator>John</dc:creator>
				<category><![CDATA[Math]]></category>
		<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://www.johndcook.com/blog/?p=4291</guid>
		<description><![CDATA[The most obvious way to compute the soft maximum can easily fail due to overflow or underflow.
The soft maximum of x and y is defined by
g(x, y) = log( exp(x) + exp(y) ).
The most obvious way to turn the definition above into C code would be
double SoftMaximum(double x, double y)
{
    return log( [...]]]></description>
			<content:encoded><![CDATA[<p>The most obvious way to compute the <a href="http://www.johndcook.com/blog/2010/01/13/soft-maximum/">soft maximum</a> can easily fail due to overflow or underflow.</p>
<p>The soft maximum of x and y is defined by</p>
<p style="padding-left: 30px;">g(x, y) = log( exp(x) + exp(y) ).</p>
<p>The most obvious way to turn the definition above into C code would be</p>
<pre>double SoftMaximum(double x, double y)
{
    return log( exp(x) + exp(y) );
}</pre>
<p>This works for some values of x and y, but fails if x or y is large. For example, if we use this to compute the soft maximum of 1000 and 200, the result is <a href="http://www.johndcook.com/IEEE_exceptions_in_cpp.html">numerical infinity</a>. The value of <code>exp(1000)</code> is too big to represent in a floating point number, so it is computed as infinity. <code>exp(200)</code> is finite, but the sum of an infinity and a finite number is infinity. Then the <code>log</code> function applied to infinity returns infinity.</p>
<p>We have the opposite problem if we try to compute the soft maximum of -1000 and -1200.  In this computation <code>exp(-1000)</code> and <code>exp(-1200)</code> both underflow to zero, and the <code>log</code> function returns negative infinity for the logarithm of zero.</p>
<p>Fortunately it&#8217;s not hard to fix the function <code>SoftMaximum</code> to avoid overflow and underflow. Look what happens when we shift both arguments by a constant.</p>
<p style="padding-left: 30px;">log( exp(x &#8211; k) + exp(y &#8211; k) ) = log( exp(x) + exp(y) ) &#8211; k.</p>
<p>This says</p>
<p style="padding-left: 30px;">log( exp(x) + exp(y) ) = log( exp(x -k) + exp(y-k) ) + k</p>
<p>If we pick k to be the maximum of x and y, then one of the calls to <code>exp</code> has argument 0 (and so it returns 1) and the other has a negative argument. This means the follow code cannot overflow.</p>
<pre>double SoftMaximum(double x, double y)
{
	double maximum = max(x, y);
	double minimum = min(x, y);
	return maximum + log( 1.0 + exp(minimum - maximum) );
}</pre>
<p>The call to <code>exp(minimum - maximum)</code> could possibly underflow to zero, but in that case the code returns <code>maximum</code>. And in that case the return value is very accurate: if <code>maximum</code> is much larger than <code>minimum</code>, then the soft maximum is essentially equal to <code>maximum</code>.</p>
<p>The equation for the soft maximum implemented above has a few advantages in addition to avoiding overflow. It makes it clear that the soft maximum is always greater than the maximum. Also, it shows that the difference between the hard maximum and the soft maximum is controlled by the spread of the arguments. The soft maximum is nearest the hard maximum when the two arguments are very different and furthest from the hard maximum when the two arguments are equal.</p>
<p>Thanks to <a href="http://www.johndcook.com/blog/2010/01/13/soft-maximum/#comment-31282">Andrew Dalke</a> for suggesting the topic of this post by his comment.</p>
<p><strong>Related links</strong>:</p>
<p><a href="http://www.johndcook.com/blog/2010/01/13/soft-maximum/">Soft maximum</a><br />
<a href="http://www.johndcook.com/blog/2009/04/06/anatomy-of-a-floating-point-number/">Anatomy of a floating point number</a><br />
<a href="http://www.codeproject.com/KB/recipes/avoiding_overflow.aspx">Avoiding overflow, underflow, and loss of precision</a></p>
<img src="http://feeds.feedburner.com/~r/TheEndeavour/~4/pfFYBjvTO10" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.johndcook.com/blog/2010/01/20/how-to-compute-the-soft-maximum/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		<feedburner:origLink>http://www.johndcook.com/blog/2010/01/20/how-to-compute-the-soft-maximum/</feedburner:origLink></item>
		<item>
		<title>Ten surprises from numerical linear algebra</title>
		<link>http://feedproxy.google.com/~r/TheEndeavour/~3/glqrVDMHcko/</link>
		<comments>http://www.johndcook.com/blog/2010/01/20/ten-surprises-from-numerical-linear-algebra/#comments</comments>
		<pubDate>Wed, 20 Jan 2010 14:54:27 +0000</pubDate>
		<dc:creator>John</dc:creator>
				<category><![CDATA[Computing]]></category>
		<category><![CDATA[Math]]></category>
		<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://www.johndcook.com/blog/?p=4278</guid>
		<description><![CDATA[Here are ten things about numerical linear algebra that you may find surprising if you&#8217;re not familiar with the field.

Numerical linear algebra applies very advanced mathematics to solve problems that can be stated with high school mathematics.
Practical applications often require solving enormous systems of equations, millions or even billions of variables.
The heart of Google is [...]]]></description>
			<content:encoded><![CDATA[<p>Here are ten things about numerical linear algebra that you may find surprising if you&#8217;re not familiar with the field.</p>
<ol>
<li>Numerical linear algebra applies very advanced mathematics to solve problems that can be stated with high school mathematics.</li>
<li>Practical applications often require solving enormous systems of equations, millions or even billions of variables.</li>
<li>The heart of Google is an enormous linear algebra problem. PageRank is essentially an eigenvalue problem.</li>
<li>The efficiency of solving very large systems of equations has benefited at least as much from advances in algorithms as from Moore&#8217;s law.</li>
<li>Many practical problems — optimization, differential equations, signal processing, etc. — boil down to solving linear systems, even when the original problems are non-linear. Finite element software, for example, spends nearly all its time solving linear equations.</li>
<li>A system of a million equations can sometimes be solved on an ordinary PC in under a millisecond, depending on the structure of the equations.</li>
<li>Iterative methods, methods that in theory require an infinite number of steps to solve a problem, are often faster and more accurate than direct methods, methods that in theory produce an exact answer in a finite number of steps.</li>
<li>There are many theorems bounding the error in solutions <em>produced on real computers</em>. That is, the theorems don&#8217;t just bound the error from hypothetical calculations carried out in exact arithmetic but bound the error from arithmetic as carried out in <a href="http://www.johndcook.com/blog/2009/04/06/numbers-are-a-leaky-abstraction/">floating point arithmetic</a> on computer hardware.</li>
<li>It is hardly ever necessary to compute the <a href="http://www.johndcook.com/blog/2010/01/19/dont-invert-that-matrix/">inverse</a> of a matrix.</li>
<li>There is remarkably mature <a href="http://www.netlib.org/lapack/">software</a> for numerical linear algebra. Brilliant people have worked on this software for many years.</li>
</ol>
<p><strong>Related posts</strong>:</p>
<p><a href="http://www.johndcook.com/blog/2010/01/19/dont-invert-that-matrix/">Don&#8217;t invert that matrix</a><br />
<a href="http://www.johndcook.com/blog/2009/03/31/searching-for-john-francis/">Searching for John Francis</a><br />
<a href="http://www.johndcook.com/blog/2008/08/14/applying-page-rank-idea-to-biology/">Applying PageRank to biology</a><br />
<a href="http://www.johndcook.com/blog/2008/12/02/matrix-cookbook/">Matrix cookbook</a><br />
<a href="http://www.johndcook.com/blog/2008/03/14/what-is-the-cosine-of-a-matrix/">What is the cosine of a matrix?</a></p>
<img src="http://feeds.feedburner.com/~r/TheEndeavour/~4/glqrVDMHcko" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.johndcook.com/blog/2010/01/20/ten-surprises-from-numerical-linear-algebra/feed/</wfw:commentRss>
		<slash:comments>8</slash:comments>
		<feedburner:origLink>http://www.johndcook.com/blog/2010/01/20/ten-surprises-from-numerical-linear-algebra/</feedburner:origLink></item>
		<item>
		<title>Don’t invert that matrix</title>
		<link>http://feedproxy.google.com/~r/TheEndeavour/~3/YYQPXSiZZTo/</link>
		<comments>http://www.johndcook.com/blog/2010/01/19/dont-invert-that-matrix/#comments</comments>
		<pubDate>Tue, 19 Jan 2010 11:12:36 +0000</pubDate>
		<dc:creator>John</dc:creator>
				<category><![CDATA[Math]]></category>

		<guid isPermaLink="false">http://www.johndcook.com/blog/?p=4266</guid>
		<description><![CDATA[There is hardly ever a good reason to invert a matrix.
What do you do if you need to solve Ax = b where A is an n x n matrix? Isn&#8217;t the solution A-1 b?  Yes, theoretically. But that doesn&#8217;t mean you need to actually find A-1.  Solving the equation Ax = b [...]]]></description>
			<content:encoded><![CDATA[<p>There is hardly ever a good reason to invert a matrix.</p>
<p>What do you do if you need to solve <em>Ax</em> = <em>b</em> where <em>A</em> is an <em>n</em> x <em>n</em> matrix? Isn&#8217;t the solution <em>A</em><sup>-1</sup> <em>b</em>?  Yes, theoretically. But that doesn&#8217;t mean you need to actually find <em>A</em><sup>-1</sup>.  Solving the equation <em>Ax</em> = <em>b</em> is faster than finding <em>A</em><sup>-1</sup>. Books might write the problem as <em><em>x</em> = A</em><sup>-1</sup> <em>b</em>, but that doesn&#8217;t mean they expect you to calculate it that way.</p>
<p>What if you have to solve <em>Ax</em> = <em>b</em> for a lot of different <em>b</em>&#8217;s? Surely then it&#8217;s worthwhile to find <em>A</em><sup>-1</sup>. No. The first time you solve <em>Ax</em> = <em>b</em>, you factor <em>A</em> and save that factorization.  Then when you solve for the next <em>b</em>, the answer comes much faster. (Factorization takes O(<em>n</em><sup>3</sup>) operations. But once the matrix is factored, solving <em>Ax</em> = <em>b</em> takes only O(<em>n</em><sup>2</sup>) operations. Suppose<em> n</em> = 1,000. This says that once you&#8217;ve solved <em>Ax</em> = <em>b</em> for one <em>b</em>, the equation can be solved again for a new <em>b</em> 1,000 times faster than the first one. Buy one get one free.)</p>
<p>What if, against advice, you&#8217;ve computed <em>A</em><sup>-1</sup>. Now you might as well use it, right? No, you&#8217;re still better off solving <em>Ax</em> = <em>b</em> than multiplying by <em>A</em><sup>-1</sup>, even if the computation of <em>A</em><sup>-1</sup> came for free. Solving the system is more numerically accurate than the performing the matrix multiplication.</p>
<p>It is common in applications to solve <em>Ax</em> = <em>b</em> even though there&#8217;s not enough memory to store <em>A</em><sup>-1</sup>. For example, suppose <em>n</em> = 1,000,000 for the matrix <em>A</em> but <em>A</em> has a special sparse structure — say it&#8217;s banded —  so that all but a few million entries of <em>A</em> are zero.  Then <em>A</em> can easily be stored in memory and <em>Ax</em> = <em>b</em> can be solved very quickly. But in general <em>A</em><sup>-1</sup> would be dense. That is, nearly all of the 1,000,000,000,000 entries of the matrix would be non-zero.  Storing <em>A</em> requires megabytes of memory, but storing <em>A</em><sup>-1</sup> would require terabytes of memory.</p>
<p><strong>Related post</strong>s:</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.johndcook.com/blog/2010/01/20/ten-surprises-from-numerical-linear-algebra/">Ten surprises from numerical linear algebra</a></p>
<img src="http://feeds.feedburner.com/~r/TheEndeavour/~4/YYQPXSiZZTo" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.johndcook.com/blog/2010/01/19/dont-invert-that-matrix/feed/</wfw:commentRss>
		<slash:comments>36</slash:comments>
		<feedburner:origLink>http://www.johndcook.com/blog/2010/01/19/dont-invert-that-matrix/</feedburner:origLink></item>
		<item>
		<title>The disappointing state of Unicode fonts</title>
		<link>http://feedproxy.google.com/~r/TheEndeavour/~3/9mdcYax3toE/</link>
		<comments>http://www.johndcook.com/blog/2010/01/16/disappointing-state-of-unicode-fonts/#comments</comments>
		<pubDate>Sun, 17 Jan 2010 00:58:50 +0000</pubDate>
		<dc:creator>John</dc:creator>
				<category><![CDATA[Typography]]></category>
		<category><![CDATA[Unicode]]></category>

		<guid isPermaLink="false">http://www.johndcook.com/blog/?p=4186</guid>
		<description><![CDATA[Modern operating systems understand Unicode internally, but font support for Unicode is spotty. For an example of the problems this can cause, take a look at these screen shots of how the same Twitter message appears differently depending on what program is used to read it.
No font can display all Unicode characters. According to Wikipedia
&#8230; [...]]]></description>
			<content:encoded><![CDATA[<p>Modern operating systems understand Unicode internally, but font support for Unicode is spotty. For an example of the problems this can cause, take a look at these <a href="http://www.johndcook.com/blog/2009/01/14/how-to-insert-graphics-in-twitter-messages/">screen shots</a> of how the same Twitter message appears differently depending on what program is used to read it.</p>
<p>No font can display all Unicode characters. According to <a href="http://en.wikipedia.org/wiki/Unicode_fonts">Wikipedia</a></p>
<blockquote><p>&#8230; it would be impossible to create such a font in any common font format, as Unicode includes over 100,000 characters, while no widely-used font format supports more than 65,535 glyphs.</p></blockquote>
<p>However, the biggest problem isn&#8217;t the number of characters a font can display. Most Unicode characters are quite rare. About 30,000 characters are enough to display the vast majority of characters in use in all the world&#8217;s languages as well as a generous selection of symbols. However Unicode fonts vary greatly in their support even for the more commonly used ranges of characters. See this <a href="http://en.wikipedia.org/wiki/Unicode_fonts#Comparison_of_fonts">comparison chart</a>. The only range completely covered by all Unicode fonts in the chart is the 128 characters of Latin Extended-A.</p>
<p><a href="http://unifoundry.com/unifont.html">Unifont</a> supports all printable characters in the <a href="http://www.unicode.org/roadmaps/bmp/">basic multilingual plane</a>, characters U+0000 through U+FFFF. This includes the 30,000 characters mentioned above plus many more. Unifont isn&#8217;t pretty, but it&#8217;s complete. As far as I know, it&#8217;s the only font that covers the characters below U+FFFF.</p>
<p><strong>Related posts</strong>:</p>
<p><a href="http://www.johndcook.com/blog/2008/04/05/why-unicode-is-subtle/">Why Unicode is subtle</a></p>
<p>Entering Unicode characters in <a href="http://www.johndcook.com/blog/2008/08/17/three-ways-to-enter-unicode-characters-in-windows/">Windows</a>, <a href="http://www.johndcook.com/blog/2008/08/18/entering-unicode-characters-in-linux/">Linux</a></p>
<img src="http://feeds.feedburner.com/~r/TheEndeavour/~4/9mdcYax3toE" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.johndcook.com/blog/2010/01/16/disappointing-state-of-unicode-fonts/feed/</wfw:commentRss>
		<slash:comments>15</slash:comments>
		<feedburner:origLink>http://www.johndcook.com/blog/2010/01/16/disappointing-state-of-unicode-fonts/</feedburner:origLink></item>
		<item>
		<title>Weekend miscellany</title>
		<link>http://feedproxy.google.com/~r/TheEndeavour/~3/_paKuAsgEHI/</link>
		<comments>http://www.johndcook.com/blog/2010/01/15/weekend-miscellany-21/#comments</comments>
		<pubDate>Fri, 15 Jan 2010 18:49:01 +0000</pubDate>
		<dc:creator>John</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://www.johndcook.com/blog/?p=4217</guid>
		<description><![CDATA[Math and aesthetics
Beautiful architecture video.  No explicit math, but lots of math behind the scenes.
Some math and some great images:  3-DSpirographs
Advanced math with some pictures: algebraic topology books for download from J. P. May and Allen Hatcher. (Hatcher&#8217;s book has more pictures.)
Miscellaneous
There&#8217;s really nothing that cannot be innovatived
Failure insurance for students
Genes and patents
Why Donald Knuth [...]]]></description>
			<content:encoded><![CDATA[<p><strong>Math and aesthetics</strong></p>
<p>Beautiful <a href="http://vimeo.com/7809605?hd=1">architecture video</a>.  No explicit math, but lots of math behind the scenes.</p>
<p>Some math and some great images:  <a href="http://maxwelldemon.com/2010/01/14/spirographs-and-the-third-dimension/">3-DSpirographs</a></p>
<p>Advanced math with some pictures: algebraic topology books for download from <a href="http://www.math.uchicago.edu/%7Emay/CONCISE/ConciseRevised.pdf">J. P. May</a> and <a href="http://www.math.cornell.edu/%7Ehatcher/AT/AT.pdf">Allen Hatcher</a>. (Hatcher&#8217;s book has more pictures.)</p>
<p><strong>Miscellaneous</strong></p>
<p><a href="http://bhc3.wordpress.com/2010/01/12/there-really-is-nothing-that-cannot-be-innovated/">There&#8217;s really nothing that cannot be innovatived</a></p>
<p><a href="http://chronicle.com/article/A-Novel-Idea-to-Keep-Students/63493/">Failure insurance for students</a></p>
<p><a href="http://www.latimes.com/news/opinion/la-ed-genepatents10-2010jan10,0,6957297.story?track=rss">Genes and patents</a></p>
<p><a href="http://www-cs-faculty.stanford.edu/~knuth/email.html">Why Donald Knuth does not use email</a></p>
<img src="http://feeds.feedburner.com/~r/TheEndeavour/~4/_paKuAsgEHI" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.johndcook.com/blog/2010/01/15/weekend-miscellany-21/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://www.johndcook.com/blog/2010/01/15/weekend-miscellany-21/</feedburner:origLink></item>
		<item>
		<title>Spacecraft made from tape measures</title>
		<link>http://feedproxy.google.com/~r/TheEndeavour/~3/zEs8ZHKA2Mo/</link>
		<comments>http://www.johndcook.com/blog/2010/01/14/satellite-stanley-tape-measure/#comments</comments>
		<pubDate>Thu, 14 Jan 2010 23:33:14 +0000</pubDate>
		<dc:creator>John</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://www.johndcook.com/blog/?p=4236</guid>
		<description><![CDATA[The struts on the LightSail solar sail spacecraft are made from of Stanley tape measures. For details, listen to this episode of the Planetary Radio podcast.
]]></description>
			<content:encoded><![CDATA[<p>The struts on the <a href="http://www.planetary.org/programs/projects/solar_sailing/">LightSail</a> solar sail spacecraft are made from of <a href="http://www.stanleytools.com/default.asp?TYPE=CATEGORY&amp;CATEGORY=MEASURING+TOOLS">Stanley tape measures</a>. For details, listen to <a href="http://www.planetary.org/radio/show/00000372/">this episode</a> of the Planetary Radio podcast.</p>
<img src="http://feeds.feedburner.com/~r/TheEndeavour/~4/zEs8ZHKA2Mo" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.johndcook.com/blog/2010/01/14/satellite-stanley-tape-measure/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://www.johndcook.com/blog/2010/01/14/satellite-stanley-tape-measure/</feedburner:origLink></item>
		<item>
		<title>Technology history quiz</title>
		<link>http://feedproxy.google.com/~r/TheEndeavour/~3/1zlnFzVc3uQ/</link>
		<comments>http://www.johndcook.com/blog/2010/01/14/technology-history-quiz/#comments</comments>
		<pubDate>Thu, 14 Jan 2010 10:00:39 +0000</pubDate>
		<dc:creator>John</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[History]]></category>

		<guid isPermaLink="false">http://www.johndcook.com/blog/?p=4193</guid>
		<description><![CDATA[I was skimming through Big Ideas: 100 Modern Inventions the other day and was surprised at the dates for many of the inventions. I thought it would be fun to pick a few of these and make them into a quiz, so here goes.
Match the following technologies with the year of their invention.
First the inventions:

The [...]]]></description>
			<content:encoded><![CDATA[<p>I was skimming through <a href="http://www.amazon.com/gp/product/1588167224?ie=UTF8&amp;tag=theende-20&amp;linkCode=xm2&amp;camp=1789&amp;creativeASIN=1588167224">Big Ideas: 100 Modern Inventions</a> the other day and was surprised at the dates for many of the inventions. I thought it would be fun to pick a few of these and make them into a quiz, so here goes.</p>
<p>Match the following technologies with the year of their invention.</p>
<p>First the inventions:</p>
<ol>
<li>The computer mouse</li>
<li>Radio frequency identification (RFID)</li>
<li>Pull-top cans</li>
<li>Bar codes</li>
<li>Touch tone phones</li>
<li>Cell phones</li>
<li>Car airbags</li>
<li>Automated teller machines (ATM)</li>
<li>Magnetic resonance imaging (MRI)</li>
<li>Latex paint</li>
</ol>
<p>Now the years:</p>
<ol style="list-style-type: lower-alpha">
<li>1948</li>
<li>1952</li>
<li>1953</li>
<li>1963</li>
<li>1968</li>
<li>1969</li>
<li>1973</li>
<li>1977</li>
</ol>
<p>Two of the years are used twice. Quiz answers <a href="http://www.johndcook.com/tech_quiz_answers.html">here</a>.</p>
<p>All examples taken from <a href="http://www.amazon.com/gp/product/1588167224?ie=UTF8&amp;tag=theende-20&amp;linkCode=xm2&amp;camp=1789&amp;creativeASIN=1588167224">Big Ideas: 100 Modern Inventions That Have Transformed Our World</a></p>
<p><a href="http://www.amazon.com/gp/product/1588167224?ie=UTF8&amp;tag=theende-20&amp;linkCode=as2&amp;camp=1789&amp;creative=9325&amp;creativeASIN=1588167224"><img src="http://www.johndcook.com/51-oH2mWYLL._SL160_.jpg" 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=1588167224" border="0" alt="" width="1" height="1" /></p>
<img src="http://feeds.feedburner.com/~r/TheEndeavour/~4/1zlnFzVc3uQ" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.johndcook.com/blog/2010/01/14/technology-history-quiz/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		<feedburner:origLink>http://www.johndcook.com/blog/2010/01/14/technology-history-quiz/</feedburner:origLink></item>
		<item>
		<title>Biostatistics software</title>
		<link>http://feedproxy.google.com/~r/TheEndeavour/~3/PHTyvX6ZQ6k/</link>
		<comments>http://www.johndcook.com/blog/2010/01/13/biostatistics-software/#comments</comments>
		<pubDate>Wed, 13 Jan 2010 17:54:09 +0000</pubDate>
		<dc:creator>John</dc:creator>
				<category><![CDATA[Clinical trials]]></category>
		<category><![CDATA[Statistics]]></category>
		<category><![CDATA[Bayesian]]></category>
		<category><![CDATA[Probability and Statistics]]></category>

		<guid isPermaLink="false">http://www.johndcook.com/blog/?p=4227</guid>
		<description><![CDATA[The M. D. Anderson Cancer Center Department of Biostatistics has a software download site listing software developed by the department over many years.
The home page of the download site allows you to see all products sorted by date or by name. This page also allows search. A new page lets you see the software organized [...]]]></description>
			<content:encoded><![CDATA[<p>The M. D. Anderson Cancer Center Department of Biostatistics has a software download site listing software developed by the department over many years.</p>
<p>The <a href="http://biostatistics.mdanderson.org/SoftwareDownload/Default.aspx">home page</a> of the download site allows you to see all products sorted by date or by name. This page also allows search. A new page lets you see the software organized by <a href="http://biostatistics.mdanderson.org/SoftwareDownload/SiteAux/tags.html">tags</a>.</p>
<img src="http://feeds.feedburner.com/~r/TheEndeavour/~4/PHTyvX6ZQ6k" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.johndcook.com/blog/2010/01/13/biostatistics-software/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		<feedburner:origLink>http://www.johndcook.com/blog/2010/01/13/biostatistics-software/</feedburner:origLink></item>
		<item>
		<title>Soft maximum</title>
		<link>http://feedproxy.google.com/~r/TheEndeavour/~3/kj_m3wXKCgI/</link>
		<comments>http://www.johndcook.com/blog/2010/01/13/soft-maximum/#comments</comments>
		<pubDate>Wed, 13 Jan 2010 12:06:18 +0000</pubDate>
		<dc:creator>John</dc:creator>
				<category><![CDATA[Math]]></category>
		<category><![CDATA[Optimization]]></category>

		<guid isPermaLink="false">http://www.johndcook.com/blog/?p=4210</guid>
		<description><![CDATA[In applications you often want to take the maximum of two numbers. But the simple function
f(x, y) = max(x, y)
can be difficult to work with because it has sharp corners. Sometimes you want an alternative that sands down the sharp edges of the maximum function. One such alternative is the soft maximum. Here are some [...]]]></description>
			<content:encoded><![CDATA[<p>In applications you often want to take the maximum of two numbers. But the simple function</p>
<p style="padding-left: 30px;">f(x, y) = max(x, y)</p>
<p>can be difficult to work with because it has sharp corners. Sometimes you want an alternative that sands down the sharp edges of the maximum function. One such alternative is the <strong>soft maximum</strong>. Here are some questions this post will answer.</p>
<ul>
<li>What exactly is a soft maximum and why is it called that?</li>
<li>How is it related to the maximum function?</li>
<li>In what sense does the maximum have &#8220;sharp edges&#8221;?</li>
<li>How does the soft maximum round these edges?</li>
<li>What are the advantages to the soft maximum?</li>
<li>Can you control the &#8220;softness&#8221;?</li>
</ul>
<p>I&#8217;ll call the original maximum the &#8220;hard&#8221; maximum to make it easier to compare to the soft maximum.</p>
<p>The soft maximum of two variables is the function</p>
<p style="padding-left: 30px;">g(x, y) = log( exp(x) + exp(y) ).</p>
<p>This can be extended to more than two variables by taking</p>
<p style="padding-left: 30px;">g(x<sub>1</sub>, x<sub>2</sub>, &#8230;,  x<sub>n</sub>) = log( exp(x<sub>1</sub>) + exp(x<sub>2</sub>) + &#8230; + exp(x<sub>n</sub>) ).</p>
<p>The soft maximum approximates the hard maximum. Why? If x is a little bigger than y, exp(x) will be a lot bigger than exp(y). That is, exponentiation exaggerates the differences between x and y. If x is significantly bigger than y, exp(x) will be so much bigger than exp(y) that exp(x) + exp(y) will essentially equal exp(x) and the soft maximum will be approximately log( exp(x) ) = x, the hard maximum. Here&#8217;s an example. Suppose you have three numbers: -2, 3, 8. Obviously the maximum is 8. The soft maximum is 8.007.</p>
<p>The soft maximum approximates the hard maximum but it also rounds off the corners. Let&#8217;s look at some graphs that show what these corners are and how the soft maximum softens them.</p>
<p>Here are 3-D plots of the hard maximum f(x, y) and the soft maximum g(x, y). First the hard maximum:</p>
<p style="text-align: center;"><img class="aligncenter" src="http://www.johndcook.com/3dhard.png" alt="" width="360" height="295" /></p>
<p>Now the soft maximum:</p>
<p style="text-align: center;"><img class="aligncenter" src="http://www.johndcook.com/3dsoft.png" alt="" width="360" height="295" /></p>
<p>Next we look at a particular slice through the graph. Here&#8217;s the view as we walk along the line y = 1. First the hard maximum:</p>
<p style="text-align: center;"><img class="aligncenter" src="http://www.johndcook.com/slicehard.png" alt="" width="360" height="235" /></p>
<p>And now the soft maximum:</p>
<p style="text-align: center;"><img class="aligncenter" src="http://www.johndcook.com/slicesoft.png" alt="" width="360" height="235" /></p>
<p>Finally, here are the contour plots. First the hard maximum:</p>
<p style="text-align: center;"><img class="aligncenter" src="http://www.johndcook.com/contourhard.png" alt="" width="360" height="360" /></p>
<p>And now the soft maximum:</p>
<p style="text-align: center;"><img class="aligncenter" src="http://www.johndcook.com/contoursoft.png" alt="" width="360" height="360" /></p>
<p>The soft maximum approximates the hard maximum and is a convex function just like the hard maximum. But the soft maximum is smooth. It has no sudden changes in direction and can be differentiated as many times as you like. These properties make it easy for <a href="http://www.johndcook.com/blog/2009/01/07/convex-optimization-lectures/">convex optimization</a> algorithms to work with the soft maximum. In fact, the function may have been invented for optimization; that&#8217;s where I first heard of it.</p>
<p>Notice that the accuracy of the soft maximum approximation depends on scale. If you multiply x and y by a large constant, the soft maximum will be closer to the hard maximum. For example, g(1, 2) = 2.31, but g(10, 20) = 20.00004. This suggests you could control the &#8220;hardness&#8221; of the soft maximum by generalizing the soft maximum to depend on a parameter k.</p>
<p style="padding-left: 30px;">g(x, y; k) = log( exp(kx) + exp(ky) ) / k</p>
<p>You can make the soft maximum as close to the hard maximum as you like by making k large enough. For every value of k the soft maximum is differentiable, but the size of the derivatives increase as k increases. In the limit the derivative becomes infinite as the soft maximum converges to the hard maximum.</p>
<p><strong>Update</strong>: See <a href="http://www.johndcook.com/blog/2010/01/20/how-to-compute-the-soft-maximum/">How to compute the soft maximum</a>.</p>
<p><strong>Related posts</strong>:</p>
<p><a href="http://www.johndcook.com/blog/2009/01/07/convex-optimization-lectures/">Convex optimization</a><br />
<a href="http://www.johndcook.com/blog/2009/01/22/free-optimization-software-microsoft/">Free optimization software from Microsoft</a></p>
<img src="http://feeds.feedburner.com/~r/TheEndeavour/~4/kj_m3wXKCgI" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.johndcook.com/blog/2010/01/13/soft-maximum/feed/</wfw:commentRss>
		<slash:comments>18</slash:comments>
		<feedburner:origLink>http://www.johndcook.com/blog/2010/01/13/soft-maximum/</feedburner:origLink></item>
		<item>
		<title>Software sins of omission</title>
		<link>http://feedproxy.google.com/~r/TheEndeavour/~3/CXthUvG7LZk/</link>
		<comments>http://www.johndcook.com/blog/2010/01/12/software-sins-of-omission/#comments</comments>
		<pubDate>Tue, 12 Jan 2010 10:37:24 +0000</pubDate>
		<dc:creator>John</dc:creator>
				<category><![CDATA[Software development]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Quality]]></category>

		<guid isPermaLink="false">http://www.johndcook.com/blog/?p=4163</guid>
		<description><![CDATA[The Book of Common Prayer contains the confession
&#8230; we have left undone those things which we ought to have done, and we have done those things which we ought not to have done.
The things left undone are called sins of omission; things which ought not to have been done are called sins of commission.
In software [...]]]></description>
			<content:encoded><![CDATA[<p>The <a href="http://www.amazon.com/gp/product/0866835407?ie=UTF8&amp;tag=theende-20&amp;linkCode=xm2&amp;camp=1789&amp;creativeASIN=0866835407">Book of Common Prayer</a> contains the confession</p>
<blockquote><p>&#8230; we have left undone those things which we ought to have done, and we have done those things which we ought not to have done.</p></blockquote>
<p>The things left undone are called sins of omission; things which ought not to have been done are called sins of commission.</p>
<p>In software testing and debugging, we focus on sins of commission, code that was implemented incorrectly. But according to Robert Glass, the majority of bugs are sins of omission. In <a href="http://www.computer.org/portal/web/buildyourcareer/fa035">Frequently Forgotten Fundamental Facts about Software Engineering</a> Glass says</p>
<blockquote><p>Roughly 35 percent of software defects emerge from missing logic paths, and another 40 percent are from the execution of a unique combination of logic paths.</p></blockquote>
<p>If these figures are correct, <strong>three out of four software bugs are sins of omission</strong>, errors due to things left undone. These are bugs due to contingencies the developers did not think to handle. Three quarters seems like a large proportion, but it is plausible. I know I&#8217;ve often written plenty of bugs that amounted to not considering enough possibilities, particularly in graphical user interface software. It&#8217;s hard to think of everything a user might do and all the ways a user might arrive at a particular place. (When I first wrote user interface applications, my reaction to a bug report would be &#8220;Why would anyone do <em>that</em>?!&#8221; If everyone would just use my software the way <em>I</em> do, everything would be OK. )</p>
<p>It matters whether bugs are sins of omission or sins of commission. Different kinds of bugs are caught by different means. Developers have come to appreciate the value of unit testing lately, but unit tests primarily catch sins of commission. If you didn&#8217;t think to program something in the first place, you&#8217;re not likely to think to write a test for it. Complete test coverage could only find 25% of a projects bugs if you assume 75% of the bugs come from code that no one thought to write.</p>
<p>The best way to spot sins of omission is a fresh pair of eyes. As Glass says</p>
<blockquote><p>Rigorous reviews are more effective, and more cost effective, than any other error-removal strategy, including testing. But they cannot and should not replace testing.</p></blockquote>
<p>One way to combine the benefits of unit testing and code reviews would be to have different people write the unit tests and the production code.</p>
<p><strong>Related posts</strong>:</p>
<p><a href="http://www.johndcook.com/blog/2009/06/17/sloth/">The most subtle of the seven deadly sins</a><br />
<a href="http://www.johndcook.com/blog/2009/10/25/shallow-bugs-reported-bugs/">Shallow bugs versus reported bugs</a><br />
<a href="http://www.johndcook.com/blog/2008/12/23/negative-space-operating-systems/">Negative space in operating systems</a></p>
<img src="http://feeds.feedburner.com/~r/TheEndeavour/~4/CXthUvG7LZk" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.johndcook.com/blog/2010/01/12/software-sins-of-omission/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
		<feedburner:origLink>http://www.johndcook.com/blog/2010/01/12/software-sins-of-omission/</feedburner:origLink></item>
		<item>
		<title>Abstractions are never perfect</title>
		<link>http://feedproxy.google.com/~r/TheEndeavour/~3/ofZAQBs7fKQ/</link>
		<comments>http://www.johndcook.com/blog/2010/01/11/abstractions-are-never-perfect/#comments</comments>
		<pubDate>Mon, 11 Jan 2010 16:00:40 +0000</pubDate>
		<dc:creator>John</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[Quotes]]></category>
		<category><![CDATA[Simplicity]]></category>

		<guid isPermaLink="false">http://www.johndcook.com/blog/?p=4176</guid>
		<description><![CDATA[Better to have a simple system than a complex system with a simple abstraction on top.
Abstractions are never perfect. Every new layer creates failure points, interoperability hassles, and scalability problems. New tools can hide complexity, but they can&#8217;t justify it &#8230; The more complex the system, the more difficult it is to fix when something [...]]]></description>
			<content:encoded><![CDATA[<p>Better to have a simple system than a complex system with a simple abstraction on top.</p>
<blockquote><p><strong>Abstractions are never perfect</strong>. Every new layer creates failure points, interoperability hassles, and scalability problems. New tools can hide complexity, but they can&#8217;t justify it &#8230; The more complex the system, the more difficult it is to fix when something goes wrong.</p></blockquote>
<p>From the preface to <a href="http://www.amazon.com/gp/product/0596529260?ie=UTF8&amp;tag=theende-20&amp;linkCode=xm2&amp;camp=1789&amp;creativeASIN=0596529260">RESTful Web Services</a>.</p>
<p><strong>Related posts</strong>:</p>
<p><a href="http://www.johndcook.com/blog/2008/01/16/obscuring-complexity/">Obscuring complexity</a><br />
<a href="http://www.johndcook.com/blog/2009/07/27/baklav-code/">Baklava code</a><br />
<a href="http://www.johndcook.com/blog/2009/01/02/leaky-abstractions-hockey-stick-learning-curves/">Leaky abstractions</a><br />
<a href="http://www.johndcook.com/blog/2009/12/11/less-isnt-more-just-enough-is-more/">Less isn&#8217;t more; just enough is more</a></p>
<img src="http://feeds.feedburner.com/~r/TheEndeavour/~4/ofZAQBs7fKQ" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.johndcook.com/blog/2010/01/11/abstractions-are-never-perfect/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://www.johndcook.com/blog/2010/01/11/abstractions-are-never-perfect/</feedburner:origLink></item>
	</channel>
</rss>
