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

<channel>
	<title>bit-player</title>
	<atom:link href="http://bit-player.org/feed" rel="self" type="application/rss+xml" />
	<link>http://bit-player.org</link>
	<description>An amateur&#039;s outlook on computation and mathematics</description>
	<lastBuildDate>Sun, 16 Jun 2013 13:53:42 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.4.2</generator>
		<item>
		<title>The wisterium of memory</title>
		<link>http://bit-player.org/2013/the-wisterium-of-memory</link>
		<comments>http://bit-player.org/2013/the-wisterium-of-memory#comments</comments>
		<pubDate>Sun, 16 Jun 2013 13:49:58 +0000</pubDate>
		<dc:creator>Brian Hayes</dc:creator>
				<category><![CDATA[science]]></category>

		<guid isPermaLink="false">http://bit-player.org/?p=1552</guid>
		<description><![CDATA[Every spring it&#8217;s the same story. Those pendulous clusters of pinkish purplish blossoms come droopling off a pergola in a little park around the corner, and I spend the next half hour desperately searching my memory for the word. I &#8230; <a href="http://bit-player.org/2013/the-wisterium-of-memory">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p><img class="alignright" src="http://bit-player.org/wp-content/uploads/2013/06/wisteria-davis-T-0813-640px.jpg" alt="huge droopy pinkish purplish blooms at the Davis Square T station in Somerville MA, 2011-05-21" border="0" width="640" height="645" /></p>
<p class="undent">Every spring it&#8217;s the same story. Those pendulous clusters of pinkish purplish blossoms come droopling off a pergola in a little park around the corner, and I spend the next half hour desperately searching my memory for the word. I know it&#8217;s in there, if only because I&#8217;ve been through this before, last year and the year before and the year before that. It&#8217;s in there but it&#8217;s stuck in one of the crevices of my cerebral cortex, and I can&#8217;t pry it loose. What is the name of that flower?</p>
<p>This year I took notes&#8212;looking over my own shoulder as I ransacked my mind for the missing word. The first term that came to me was <em>hydrangea</em>:  obviously wrong but at least hitting the right general category of flowering plants. <em>Verbena</em> is a little closer&#8212;the flowers <img class="alignleft" src="http://bit-player.org/wp-content/uploads/2013/06/wisteria-notes-400px.png" alt="notes recording the struggle to find the missing word" border="0" width="400" height="534" /> of verbena are approximately the right color&#8212;but the strange thing is, I didn&#8217;t know that (or I didn&#8217;t know that I knew that) until I googled it just now. I <em>do</em> know what <em>forsythia</em> looks like, and I know it has almost nothing in common with the plant I&#8217;m trying to name, but my brain offers it up anyway.</p>
<p>The next entry in the list, <em>purple flower</em>, reveals the futility of trying to force the issue. That&#8217;s not my brain talking to me; that&#8217;s me talking to my brain, ordering it to give me the word I want. <em>Vine</em> may be in the same category, although the initial <em>v</em> could be significant (see below).</p>
<p>There&#8217;s a whole campfire story behind the next entry. Three boy scouts, their troop leader and two weeks&#8217; worth of camping gear are crammed into a Volkswagen Beetle, circa 1962. As we putter down a back-country road, the scoutmaster leans his head out the window, inhales with exaggerated gusto, and exclaims, &#8220;Smell that honeysuckle!&#8221; All through the summer camp session we mocked him mercilessly for this excess of enthusiasm, but he has had his revenge: The phrase is tattooed on my left temporal lobe. It shows up every year when I&#8217;m entangled in this crazy quest to name the flower that&#8217;s not a hydrangea, not a verbena, not a forsythia, and not a honeysuckle either.</p>
<p><em>Southern</em>: Me getting bossy with my brain again. When I lived in the Carolinas, I had a tree out front that was overgrown by the purple-flowered vine I can&#8217;t name.</p>
<p><em>v, v, v&#8230;</em> Suddenly I&#8217;m sure the word starts with <em>v</em>, and this is the first moment when I feel like I&#8217;m making progress, that I have the scent, I&#8217;m on the trail. A <em>v</em> on the tip of my tongue, but not <em>verbena</em>, not <em>vine</em>&#8230;</p>
<p>Not <em>vertiginous</em> either. </p>
<p>And <em>hydrangea</em>&#8212;what are you doing here again? I already told you to go home; you&#8217;re not wanted.</p>
<p>Wissahickon Creek runs along the northwest boundary of the city of Philadelphia, toward Germantown and Chestnut Hill. There was a period in my youth when the road that winds along the creek was the route I took to visit a girlfriend. Late one rainy night I drove my 59 Chevy through deep water covering the road and soon had a white-knuckle moment when I discovered I had no brakes. It&#8217;s not surprising that I would remember all this, but what could it have to do with my unnamed flower?</p>
<p>And then, all of a sudden, the neuron finally fires. <em>Wissahickon</em> is not about the creek or the road or the girlfriend or the wet brakes; it&#8217;s all about the word itself. Not <em>v</em> but <em>w</em>&#8230; <em>wis, wis, wis</em>&#8230; I&#8217;ve got it now: <em>wisteria</em>! What a relief. (Until next spring.)</p>
<hr />
<p>What is it about this genus <em>Wisteria</em> that so troubles my mind? There are scads of other plants I can&#8217;t identify, but that&#8217;s because I truly don&#8217;t know their names; no amount of rummaging in the attic of memory will ever succeed in retrieving what I never possessed. On the other hand, there&#8217;s a whole garden full of flowers&#8212;hydrangea, verbena, forsythia&#8212;that come effortlessly to mind, even when they are not wanted. Wisteria is different: something I own but can&#8217;t command.</p>
<p>Freud would doubtless opine that I must have suppressed the memory for some dark reason. I can play at that game. Wisteria is supposedly named for Caspar Wistar, notable Philadelphia physician circa 1800. He was inspired to study medicine after tending the wounded at the Battle of Germantown in 1777&#8212;an event that took place within cannon range of Wissahickon Creek. (Surely that can&#8217;t be a coincidence!) Dr. Wistar is also commemorated in the Wistar Institute of Anatomy and Biology in Philadelphia, a place I used to visit when I was a boy of 12 or 13. In that benighted age, impressionable children were allowed to wander freely through the Wistar&#8217;s collection of anatomical specimens, where various pickled body parts were sealed in gallon jars. What formaldehyde-soaked vision of horror am I trying so hard not to remember?</p>
<p>The trouble with this story is that until a few days ago I knew nothing of the connection between wisteria and Wistar. Not that Dr. Freud would let me off the hook for such a flimsy reason as that.</p>
<p>Of course <em>wisteria</em> is not the only word that my mind seems to be censoring. There&#8217;s that actress whose name I can never remember, although I have no trouble recalling that she&#8217;s the sister of Warren Beatty. And, along the same lines, the actor I can&#8217;t name, even though I can tell you he is the brother of James Arness. Can I find a childhood trauma to account for this distinctive histrionic sibling suppression complex?</p>
<p>Francis Crick wrote of our attempts to understand the brain: &#8220;We are deceived at every level by our introspection.&#8221; I believe it. I don&#8217;t think that looking over my own shoulder and taking notes as I free associate on the theme of pendulous purple flowers is going to resolve the mystery of memory. I&#8217;m fascinated by the process all the same.</p>
<p>In my latest <em>American Scientist</em> column I write on some other approaches to the question of <a class="pdf-icon" href="http://www.americanscientist.org/libraries/documents/20136716759772-2013-07Hayes.pdf">what&#8217;s in Brian&#8217;s brain</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://bit-player.org/2013/the-wisterium-of-memory/feed</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>A little theorem</title>
		<link>http://bit-player.org/2013/a-little-theorem</link>
		<comments>http://bit-player.org/2013/a-little-theorem#comments</comments>
		<pubDate>Sun, 05 May 2013 15:17:32 +0000</pubDate>
		<dc:creator>Brian Hayes</dc:creator>
				<category><![CDATA[mathematics]]></category>

		<guid isPermaLink="false">http://bit-player.org/?p=1547</guid>
		<description><![CDATA[Often I wish that I knew more mathematics and understood it more deeply. But then I wouldn&#8217;t have the pleasure of discovering afresh things that other people have known for years. (In some cases hundreds of years.) Last week, in &#8230; <a href="http://bit-player.org/2013/a-little-theorem">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Often I wish that I knew more mathematics and understood it more deeply. But then I wouldn&#8217;t have the pleasure of discovering afresh things that other people have known for years. (In some cases hundreds of years.)</p>
<p>Last week, in a discussion of <a href="http://bit-player.org/2013/mapping-the-hilbert-curve">Fermat primes and the Hilbert curve</a>, ShreevatsaR <a href="http://bit-player.org/2013/mapping-the-hilbert-curve/comment-page-1#comment-22487">remarked</a>:</p>
<blockquote><p>BTW, you only need to try primes that are factors of \((4^k &#8211; 1)\) for some \(k\)&#8230;. Considering powers of 4 up to 32 and prime factors greater than 65537, this means just the primes 87211, 131071, 174763, 178481, 262657, 524287, 2796203, 3033169, 6700417, 15790321, 715827883, 2147483647.</p></blockquote>
<p>In <a href="http://bit-player.org/2013/mapping-the-hilbert-curve/comment-page-1#comment-22545">response</a> I asked (innocently, if skeptically):</p>
<blockquote><p>Are there primes other than 2 that are known <em>not</em> to be factors of \((4^k &#8211; 1)\) for some \(k\)?</p></blockquote>
<p>ShreevatsaR <a href="http://bit-player.org/2013/mapping-the-hilbert-curve/comment-page-1#comment-22587">immediately replied</a>: No, every odd prime must divide some \((4^k &#8211; 1)\). And he gave a proof based on the pigeonhole principle. The primes he had listed in his earlier comment are just those that happen to divide \((4^k &#8211; 1)\) for an unusually small value of \(k\).</p>
<p>In the middle of the night I had a little epiphany: This is just Fermat&#8217;s Little Theorem in disguise. One version of the Little Theorem says: If \(p\) is a prime and \(a\) is a natural number, then either \(p\) divides \(a\) or \(p\) divides \(a^{(p-1)} &#8211; 1\). To get back to ShreevatsaR&#8217;s statement, just observe that for any prime \(p\) other than 2, \(p-1\) is even, and so we can introduce an integer \(k = \frac{(p-1)}{2}\), making \(4^{k} &#8211; 1\) equivalent to \(2^{(p-1)} &#8211; 1\).</p>
<p>My previous encounters with Fermat&#8217;s Little Theorem have been in the context of primality testing. If you have some natural number \(n\) and you want to find out if it&#8217;s a prime, calculate \(2^{(n-1)} &#8211; 1 \bmod n\); if the result is anything other than zero, \(n\) is composite. (Unfortunately, the converse statement is not to be relied upon: If \(2^{(n-1)} &#8211; 1 \bmod n = 0\), it does not always follow that \(n\) is prime&#8212;but that&#8217;s a story for another time.) </p>
<p>ShreevatsaR&#8217;s comment brought to light something I had never thought about: We know that a prime \(p\) divides \(2^{(p-1)} &#8211; 1\), but \(p\) might also divide some smaller number \(2^{(m-1)} &#8211; 1\) with \(m &lt; p\). I went searching for the smallest such \(m\) for all primes less than 10,000. Here are the results:</p>
<p><footnote class="marginalia note">Mouseover to magnify.</footnote><img class="aligncenter withLoupe" src="http://bit-player.org/wp-content/uploads/2013/05/least-m-graph-1278px.png" alt="graph of the least m such that p divides 2^(m-1) - 1 for all primes p less than 10000" border="0" width="639" height="621" data-magnified-width="1278" data-magnified-height="1242"/></p>
<p>Each dot in the graph represents a prime \(p\). The horizontal coordinate of the dot is the magnitude of \(p\); the vertical coordinate is the least \(m\) such that \(p\) | \(2^{(m-1)} &#8211; 1\). Of the 1228 primes shown, 470 lie along the diagonal, indicating that the least \(m\) is in fact equal to \(p\). Another 348 dots lie along a line of slope \(\frac{1}{2}\): For each of these primes, \(p\) divides \(2^{\frac{(p-1)}{2}} &#8211; 1\) as well as \(2^{(p-1)} &#8211; 1\). The smallest such \(p\) is 7, which divides \(2^3 &#8211; 1 = 7\) as well as \(2^6 &#8211; 1 = 63\). It&#8217;s easy to pick out other sets of points on lines of slope \(\frac{1}{3}\), \(\frac{1}{4}\) and so on. Toward the bottom of the graph, where the least \(m\) gets smaller, the points are sparse and patterns are more difficult to perceive, but the alignments are still present.</p>
<p>The procedure effectively divides the primes into classes distinguished by the value of \(r=\frac{p-1}{m-1}\):</p>
<pre style="margin-bottom: 0px">r=1:  3, 5, 11, 13, 19, 29, 37, 53, 59, 61, 67, 83, 101, 107...
r=2:  7, 17, 23, 41, 47, 71, 79, 97, 103, 137, 167, 191, 193...
r=3:  43, 109, 157, 229, 277, 283, 307, 499, 643, 691, 733...
r=4:  113, 281, 353, 577, 593, 617, 1033, 1049, 1097, 1153...
r=5:  251, 571, 971, 1181, 1811, 2011, 2381, 2411, 3221...
r=6:  31, 223, 433, 439, 457, 727, 919, 1327, 1399, 1423...</pre>
<p>There is nothing new or original about all this. Gauss wrote about it in <em>Disquisitiones Arithmeticae</em> in 1801. The primes in the first list are those for which the multiplicative order of 2 mod <em>p</em> is \(p-1\); in other words, the set of residues 2 mod <em>p</em> repeats with period \(p-1\), the largest possible. In Gauss&#8217;s terminology, 2 is a <em>primitive root</em> of these primes. In 1927 <a href="http://arxiv.org/abs/math.NT/0412262">Emil Artin conjectured</a> that there are infinitely many primes in this set. For the second series the multiplicative order of 2 mod <em>p</em> is \(\frac{p-1}{2}\), for the third group it is \(\frac{p-1}{3}\), and so on. The <a href="http://oeis.org/A001122">OEIS has more</a> on each of these series.</p>
<p>Nothing new, but I found the graph a useful aid to understanding. (I would not be surprised to learn that the graph isn&#8217;t new either.) </p>
<p>Trivia: What is the largest value of \(r\) encountered in this set of primes? Well, 8191 divides \(2^{(14 &#8211; 1)} &#8211; 1\). As a matter of fact, 8191 is <em>equal to</em> \(2^{(14 &#8211; 1)} &#8211; 1\). Thus we have:</p>
<p>\[r = \frac{p-1}{m-1} = \frac{8190}{13} = 630 .\]</p>
<p>Three more of the primes listed by ShreevatsaR are also of the form \(2^{n} &#8211; 1\). On the assumption that we have a boundless supply of such primes, it would appear there is no limit to the value of \(r\). [<strong>Update</strong>: Please see the comments, with illuminating contributions by ShreevatsaR, Gerry Myerson and (via <a href="http://math.stackexchange.com/questions/384097/can-the-order-of-2-mod-p-be-arbitrarily-small-relative-to-p-1">Stack Exchange</a>) David Speyer.]</p>
]]></content:encoded>
			<wfw:commentRss>http://bit-player.org/2013/a-little-theorem/feed</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Mapping the Hilbert curve</title>
		<link>http://bit-player.org/2013/mapping-the-hilbert-curve</link>
		<comments>http://bit-player.org/2013/mapping-the-hilbert-curve#comments</comments>
		<pubDate>Fri, 26 Apr 2013 13:52:58 +0000</pubDate>
		<dc:creator>Brian Hayes</dc:creator>
				<category><![CDATA[computing]]></category>
		<category><![CDATA[mathematics]]></category>

		<guid isPermaLink="false">http://bit-player.org/?p=1543</guid>
		<description><![CDATA[In 1877 the German mathematician Georg Cantor made a shocking discovery. He found that a two-dimensional surface contains no more points than a one-dimensional line. Thus begins my latest column in American Scientist, now available in HTML or PDF. The &#8230; <a href="http://bit-player.org/2013/mapping-the-hilbert-curve">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<blockquote><p>In 1877 the German mathematician Georg Cantor made a shocking discovery. He found that a two-dimensional surface contains no more points than a one-dimensional line.</p></blockquote>
<p class="indent">Thus begins my latest column in <em>American Scientist</em>, now available in <a href="http://www.americanscientist.org/issues/pub/2013/3/crinkly-curves">HTML</a> or <a href="http://www.americanscientist.org/libraries/documents/2013416124139665-2013-05Hayes.pdf">PDF</a>. The leading actor in this story is the Hilbert curve, which illustrates Cantor&#8217;s shocking discovery by leaping out of the one-dimensional universe and filling up a two-dimensional area. David Hilbert discovered this trick in 1891, building on earlier work by Giuseppe Peano. The curve is not smooth, but it&#8217;s continuous&#8212;you can draw it without ever lifting the pencil from the paper&#8212;and when elaborated to all its infinite glory it touches every point in a square.</p>
<div class="figure-with-caption"><img class="aligncenter" src="http://bit-player.org/wp-content/uploads/2013/04/hilbert-1-to-4-600px.png" alt="The first through fourth generations of the Hilbert curve" border="0" width="600" height="137" />
<p class="figure-caption">Above: The first through fourth stages in the construction of the Hilbert curve. To generate the complete space-filling curve, just keep going this way.</p>
</div>
<p class="indent">To supplement the new column I&#8217;ve built two interactive illustrations. The first one animates the geometric construction of the Hilbert curve, showing how four copies of the generation-<em>n</em> curve can be shrunken, twirled, flipped and reconnected to produce generation <em>n</em>+1. The second illustration is a sort of graphic calculator for exploring the mapping between one-dimensional and two-dimensional spaces. For any point <em>t</em> on the unit line segment [0, 1], the calculator identifies the corresponding point <em>x, y</em> in the unit square [0, 1]<sup>2</sup>. The inverse mapping is also implemented, although it&#8217;s not one-to-one. A point <em>x, y</em> in the square can correspond to multiple points <em>t</em> on the segment; the calculator shows only one of the possibilities.
</p>
<p>The Hilbert-curve illustrations are posted in the Extras department here at bit-player.org. I encourage you to <a href="http://bit-player.org/extras/hilbert/">go play with them</a>, but please come back and read on. I have some unsolved problems.</p>
<hr />
<p>I built the Hilbert mapping calculator in part to satisfy my own curiosity. It&#8217;s fine to know that every point <em>t</em> can be matched with a point <em>x, y</em>, but which points go together, exactly? For example, what point in the square corresponds to the midpoint of the segment? The answer in this case is not hard to work out: The middle of the segment maps to the middle of the square: (<em>t</em> = 1/2) &rarr; (<em>x</em> = 1/2, <em>y</em> = 1/2). Shown below are a few more salient points, as plotted by the calculator:</p>
<div class="figure-with-caption"><img class="aligncenter" src="http://bit-player.org/wp-content/uploads/2013/04/Hilbert-12ths.svg" alt="mapping of n/12 onto the Hilbert curve, for n=0 through n=12" border="0" width="600" height="660" />
<p class="figure-caption">Rational points of the form <em>t</em> = <em>n</em>/12, for integer 0 &le; <em>n</em> &le; 12, are mapped into the unit square according to their positions along the Hilbert curve. For example, <em>t</em> = 3/12 = 1/4 is mapped to the point <em>x</em> = 0, <em>y</em> = 1/2, at the midpoint of the square&#8217;s left edge. Note that the Hilbert curve drawn in the background of the illustration is a fifth-stage approximation to the true curve, but the positions of the colored dots are calculated to much higher precision.</p>
</div>
<p class="indent">Looking at this tableau led me to wonder what other values of <em>t</em> correspond to &#8220;interesting&#8221; <em>x, y</em> positions. In particular, which fractions along the <em>t</em> segment project to points on the perimeter of the square? Which <em>t</em> values go to points along one of the midlines, either vertical or horizontal? To narrow these questions a little further, let&#8217;s just consider fractions whose denominator is a prime. (In all that follows I ignore fractions with denominator 1, or in other words the end points of the <em>t</em> segment.)</p>
<p>The diagram above already reveals that fractions with denominator 2 and 3 are members of the &#8220;interesting&#8221; class. The value <em>t</em> = 1/2 maps to the intersection of the two midlines. And <em>t</em> = 1/4, 1/3, 2/3 and 3/4 all generate <em>x, y</em> points that lie on the perimeter. Can we find interesting fractions with other prime factors in the denominator? Yes indeed! Here is the Hilbert mapping for fractions of the form <em>n</em>/5:</p>
<div class="figure-with-caption"><img class="aligncenter" src="http://bit-player.org/wp-content/uploads/2013/04/Hilbert-5ths.svg" alt="mapping of n/5 onto the Hilbert curve, for n=0 through n=5" border="0" width="600" height="660" />
<p class="figure-caption">Hilbert mapping for fifths. In the calculator you can generate this output by entering */5 into the input area labeled &#8220;<em>t</em> =&#8221;. It turns out that (<em>t</em> = 2/5) &rarr; (<em>x</em> = 1/3, <em>y</em> = 1), and (<em>t</em> = 3/5) &rarr; (<em>x</em> = 2/3, <em>y</em> = 1).</p>
</div>
<p>Note that 2/5 and 3/5 map to points on the upper boundary of the square. By a simple sequential search I soon stumbled upon two more &#8220;interesting&#8221; examples, namely <em>n</em>/13, and then <em>n</em>/17.</p>
<div class="figure-with-caption"><img class="aligncenter" src="http://bit-player.org/wp-content/uploads/2013/04/Hilbert-13ths.svg" alt="mapping of n/13 onto the Hilbert curve, for n=0 through n=13" border="0" width="600" height="660" />
<p class="figure-caption">Hilbert mapping for <em>t</em> = 0/13, 1/13, 2/13 &#8230; 13/13. The fractions <em>t</em> = 3/13, 4/13, 9/13 and 10/13 yield <em>x, y</em> coordinates on the perimeter of the square.</p>
</div>
<div class="figure-with-caption"><img class="aligncenter" src="http://bit-player.org/wp-content/uploads/2013/04/Hilbert-17ths.svg" alt="mapping of n/17 onto the Hilbert curve, for n=0 through n=17" border="0" width="600" height="660" />
<p class="figure-caption">Hilbert mapping for 17ths. The fractions <em>t</em> = 1/17, 4/17, 6/17 and 7/17 correspond to points on the perimeter, as well as the mirror images of these points when reflected through the vertical midline.</p>
</div>
<p class="indent">At this point I began to think that prime-denominator fractions yielding perimeter points must be lying around everywhere just waiting for me to gather them up. And I was not surprised by their seeming abundance. After all, there are infinitely many points on the perimeter of the square, and so there must be infinitely many corresponding <em>t</em> values&#8212;even if we confine our attention to the rational numbers.</p>
<p>When I continued the search, however, my luck ran out. In the &#8220;<em>t</em>=&#8221; box of the calculator I typed in all fractions of the form */<em>p</em> for primes <em>p</em> &lt; 100; I found no points on the perimeter other than the ones I already knew about, namely those for <em>p</em> = 3, 5, 13 and 17.</p>
<p>So I automated the search. It turns out the next prime denominator yielding perimeter points is 257. Typing */257 into the calculator produces this garish display:</p>
<div class="figure-with-caption"><img class="aligncenter" src="http://bit-player.org/wp-content/uploads/2013/04/Hilbert-257ths.svg" alt="mapping of n/257 onto the Hilbert curve, for n=0 through n=257" border="0" width="600" height="660" />
<p class="figure-caption">Points of the form <em>t</em> = <em>n</em>/257. There are 32 points that lie along the perimeter of the square.</p>
</div>
<p class="indent">Beyond 257 comes an even longer barren stretch. Surveying all prime denominators less than 10,000 failed to reveal any more that produce Hilbert-curve perimeter points.</p>
<p><footnote class="undent marginalia note">Why not search the other way? We can plug in <em>x, y</em> values on the perimeter and then use the inverse Hilbert transformation to find a corresponding <em>t</em> value. I tried that. It was easy to get a sequence of approximations to <em>t</em> but not so easy to deduce the limiting value.</footnote>To summarize, if <em>t</em> = <em>n/p</em> is a fraction that maps to a point on the perimeter of the Hilbert curve, and if <em>p</em> is a prime less than 10,000, then <em>p</em> must be one of the set {3, 5, 13, 17, 257}. Let&#8217;s pluck 13 out of this group and set it aside for a moment. The remaining elements of the sequence look familiar. They are all numbers of the form \(2^{2^n} + 1\). In other words, they are <a href="http://oeis.org/A000215">Fermat numbers</a>. In 1640 Pierre de Fermat examined the first five numbers in this sequence: 3, 5, 17, 257, 65537. He confirmed that each of them is a prime, and he conjectured that all further numbers formed on the same model would also be prime. So we come to the burning question of the moment: Does the fifth  Fermat prime 65537 generate perimeter points on the Hilbert curve? It sure does: 512 of them.</p>
<p>The obvious next step is to look at larger Fermat numbers, but there&#8217;s a complication. Fermat&#8217;s claim that all such numbers are prime turned out to be overreaching a little bit; beyond the first five, every Fermat number checked so far has turned out to be composite. Still, we can see if they give us Hilbert perimeter points. The sixth Fermat number is 4294967297, and sure enough there are fractions with this number in the denominator that land on the perimeter of the Hilbert curve. For example, <em>t</em> = 4/4294967297 converges to <em>x</em> = 0, <em>y</em> = 1/32768. We can also check the factors of this number (which have been known since <del datetime="2013-04-29T13:18:16+00:00">1729</del><ins datetime="2013-04-29T13:18:16+00:00">1732</ins>, when Euler identified them as 641 and 6700417). With a bit of effort I pinned down a few fractions with 6700417 in the denominator, such as 2181/6700417, that are on the perimeter. </p>
<p>It&#8217;s the same story with the seventh Fermat number, 18446744073709551617. Both this number and its largest prime factor, 67280421310721, yield perimeter points. I have not looked beyond the seventh <em>F</em> number. Would I be as reckless as Fermat if I were to conjecture that all such numbers generate Hilbert-curve perimeter points?</p>
<p>Thus the known prime denominators that give rise to perimeter points are the five Fermat primes, 3, 5, 17, 257 and 65537, as well as two prime factors of larger Fermat numbers, 6700417 and 67280421310721. Oh, and 13. I almost forgot 13. Who let <em>him</em> in?</p>
<p>Of course there are many (infinitely many) perimeter points whose associated <em>t</em> values do <em>not</em> have a prime denominator. If we run through all fractions whose denominator is less than 1,000 (when reduced to lowest terms), this is the set of denominators that maps to perimeter points:</p>
<blockquote><p>{3, 4, 5, 12, 13, 16, 17, 20, 48, 51, 52, 63, 64, 65, 68, 80, 192, 204, 205, 208, 252, 255, 256, 257, 260, 272, 273, 320, 341, 768, 771, 816, 819, 820, 832}</p></blockquote>
<p>It&#8217;s another curious bunch of numbers, with patterns that are hard to fathom. (The OEIS is no help.) I thought at first that the numbers might be composed exclusively of the primes I had identified earlier (as well as 2). This notion held together until I got to 63, which of course has a factor of 7. Then I thought a slightly weaker condition might hold: Other factors are allowed, but at least one factor must be drawn from the favored set. That lasted until I reached 341, which factors as 11 &times; 31. There must be <em>some</em> logic behind the selection of these numbers, but the rule escapes me. One more peculiarity: Every even power of 2 appears, but none of the odd powers.</p>
<p>Here is the analogous set of denominators for <em>t</em> values that project to the two midlines of the Hilbert curve:</p>
<blockquote><p>{2, 4, 6, 10, 12, 16, 20, 26, 34, 48, 52, 64, 68, 80, 102, 126, 130, 192, 204, 208, 252, 256, 260, 272, 320, 410, 510, 514, 546, 682, 768, 816, 820, 832}</p></blockquote>
<p>One difference jumps out immediately: All of these numbers are even. Yet the sets have more than half their elements in common. Every even member of the perimeter set is also a member of the midline set. Also note that again only even powers 2 are included (apart from 2 itself). </p>
<hr />
<p>I doubt that any deep mathematical truth hinges on the question of which numbers correspond to perimeter points on the Hilbert curve. Nevertheless, having allowed myself to get sucked into this murky business, I would really like to come out of it with some glimmer of understanding. So far that eludes me.</p>
<p>I can explain part of what&#8217;s happening here by looking more closely at the mechanism of the mapping from <em>t</em> to <em>x, y</em>. The process is easiest to follow if <em>t</em> is expressed as a quaternary fraction (i.e., base 4). Thus we view <em>t</em> as a list of &#8220;quadits,&#8221; digits drawn from the set {0, 1, 2, 3}. Each stage of the mapping process takes a single quadit and uses it to choose one of four affine transformations to apply to the current <em>x, y</em> coordinates, from <strong>H</strong><sub>0</sub> to <strong>H</strong><sub>3</sub>.</p>
<p>\[  \mathbf{H}_0 =<br />
    \left(<br />
      \begin{matrix}<br />
        0 &#038; 1/2\\<br />
        1/2 &#038; 0<br />
      \end{matrix}<br />
    \right)<br />
    \left(<br />
      \begin{matrix}<br />
        x\\<br />
        y<br />
      \end{matrix}<br />
    \right)<br />
    +<br />
    \left(<br />
      \begin{matrix}<br />
        0\\<br />
        0<br />
      \end{matrix}<br />
    \right)<br />
  \qquad<br />
  \mathbf{H}_1 =<br />
    \left(<br />
      \begin{matrix}<br />
        1/2 &#038; 0\\<br />
        0 &#038; 1/2<br />
      \end{matrix}<br />
    \right)<br />
    \left(<br />
      \begin{matrix}<br />
        x\\<br />
        y<br />
      \end{matrix}<br />
    \right)<br />
    +<br />
    \left(<br />
      \begin{matrix}<br />
        0\\<br />
        1/2<br />
      \end{matrix}<br />
    \right)<br />
\]</p>
<p>\[  \mathbf{H}_2 =<br />
    \left(<br />
      \begin{matrix}<br />
        1/2 &#038; 0\\<br />
        0 &#038; 1/2<br />
      \end{matrix}<br />
    \right)<br />
    \left(<br />
      \begin{matrix}<br />
        x\\<br />
        y<br />
      \end{matrix}<br />
    \right)<br />
    +<br />
    \left(<br />
      \begin{matrix}<br />
        1/2\\[0.3em]<br />
        1/2<br />
      \end{matrix}<br />
    \right)<br />
  \qquad<br />
  \mathbf{H}_3 =<br />
    \left(<br />
      \begin{matrix}<br />
        0 &#038; -1/2\\<br />
        -1/2 &#038; 0<br />
      \end{matrix}<br />
    \right)<br />
    \left(<br />
      \begin{matrix}<br />
        x\\<br />
        y<br />
      \end{matrix}<br />
    \right)<br />
    +<br />
    \left(<br />
      \begin{matrix}<br />
        1\\<br />
        1/2<br />
      \end{matrix}<br />
    \right)<br />
\]</p>
<p>The sequence of quadits determines a sequence of transformations, which in turn determines the mapping from <em>t</em> to <em>x, y</em>. Here is the Javascript that implements the mapping function in the online Hilbert-curve calculator:<br />
<footnote class="undent marginalia note">Most of the results reported here come not from the Javascript version but from a Lisp implementation, which can take advantage of Common Lisp&#8217;s arbitrary-precision rational numbers. (Javascript has only IEEE floats.)</footnote></p>
<pre class="brush: jscript; title: ; notranslate">function hilbertMap(quadits) {
  var pt, t, x, y;
  if ( quadits.length === 0 ) {
    return new Point(1/2, 1/2);   // center of the square
  }
  else {
    t = quadits.shift();          // get first quadit
    pt = hilbertMap(quadits);     // recursive call
    x = pt.x;
    y = pt.y;
    switch(t) {
      case 0:     // southwest, with a twist
        return new Point(y * 1/2 + 0, x * 1/2 + 0);
      case 1:     // northwest
        return new Point(x * 1/2 + 0, y * 1/2 + 1/2);
      case 2:     // northeast
        return new Point(x * 1/2 + 1/2, y * 1/2 + 1/2);
      case 3:     // southeast, with twist &amp; flip
        return new Point(y * -1/2 + 1, x * -1/2 + 1/2);
    }
  }
}</pre>
<p>If you&#8217;re not in a mood to pick your way through either the linear algebra or the source code, I can give a rough idea of what&#8217;s going on. With each 0 quadit, the <em>x, y</em> point drifts toward the southwest corner of the square. A 1 quadit steers the point toward the northwest, and likewise a 2 quadit nudges the point to the northeast and a 3 quadit to the southeast. From these facts alone you can predict the outcome of simple cases. An uninterrupted string of 0 quadits has to converge on the southwest corner of the square, which is just what&#8217;s observed for <em>t</em> = 0. In the same way, a quadit sequence of all 1s has to end up in the northwest corner. What <em>t</em> value corresponds to (0.1111111&#8230;)<sub>4</sub>? This is the quaternary expansion of 1/3, which explains why we see (<em>t</em> = 1/3) &rarr; (<em>x</em> = 0, <em>y</em> = 1).</p>
<p>The quaternary expansion of 2/5 is (0.121212&#8230;)<sub>4</sub>. Let&#8217;s trace what the Javascript code above does when it is given a finite prefix of this number. In the illustration below, the prefix is just four quadits, (0.1212)<sub>4</sub>. <img class="alignright" src="http://bit-player.org/wp-content/uploads/2013/04/hilbert-mapping-for-two-fifths.png" alt="sequence of x, y positions in mapping t = 2/5 = quaternary 0.1212" border="0" width="300" height="318" /> The recursive procedure effectively works back-to-front through the sequence of quadits. The <em>x</em> and <em>y</em> coordinates are given initial values of 1/2 (in the middle of the square). The first transformation is <strong>H</strong><sub>2</sub>, which amounts to <em>x</em> &rarr; (<em>y</em>/2 + 1/2), <em>y</em> &rarr; (<em>x</em>/2 + 1/2); after this operation, the position of the <em>x, y</em> point is (3/4, 3/4). The next quadit is 1, and so the <strong>H</strong><sub>1</sub> transformation is applied to the new <em>x, y</em> coordinates. <strong>H</strong><sub>1</sub> specifies <em>x</em> &rarr; (<em>x</em>/2), <em>y</em> &rarr; (<em>y</em>/2 + 1/2); as a result, the point moves to (3/8, 7/8). Another round of <strong>H</strong><sub>2</sub> followed by <strong>H</strong><sub>1</sub> brings the position to (11/32, 31/32). Generalizing to a more precise calculation with a longer string of quadits, it&#8217;s easy to see that the <em>n</em>th location in this progression will have a <em>y</em> coordinate equal to \(\frac{2^{n}-1}{2^{n}}\); as <em>n</em> goes to infinity, this expression converges to 1.</p>
<p>Here the quaternary expansion of 2/5 is compared with the expansions of a few other fractions that correspond to <em>y</em> = 1 perimeter points:</p>
<blockquote>
<p class="indent"><em>t</em> = 2/5 = (0.12121212&#8230;)<sub>4</sub> &rarr; (<em>x</em> = 1/3, <em>y</em> = 1)</p>
<p class="indent"><em>t</em> = 6/17 = (0.11221122&#8230;)<sub>4</sub> &rarr; (<em>x</em> = 1/5, <em>y</em> = 1)</p>
<p class="indent"><em>t</em> = 22/65 = (0.11122211&#8230;)<sub>4</sub> &rarr; (<em>x</em> = 1/9, <em>y</em> = 1)</p>
<p class="indent"><em>t</em> = 86/257 = (0.11112222&#8230;)<sub>4</sub> &rarr; (<em>x</em> = 1/17, <em>y</em> = 1)</p>
</blockquote>
<p>Every number <em>t</em> whose quaternary expansion consists exclusively of 1s and 2s projects to some point along the northern boundary of the square. It would be satisfyingly tidy if we could make an analogous statement about the other three boundary edges. For example, if all 1s and 2s head north, then quadits made up of 0s and 3s ought to wind up on the southern edge. But it&#8217;s not so simple. Consider these cases:</p>
<blockquote>
<p class="indent"><em>t</em> = 1/17 = (0.00330033&#8230;)<sub>4</sub> &rarr; (<em>x</em> = 1/5, <em>y</em> = 0)</p>
<p class="indent"><em>t</em> = 4/17 = (0.03300330&#8230;)<sub>4</sub> &rarr; (<em>x</em> = 0, <em>y</em> = 2/5)</p>
<p class="indent"><em>t</em> = 13/17 = (0.30033003&#8230;)<sub>4</sub> &rarr; (<em>x</em> = 1, <em>y</em> = 2/5)</p>
<p class="indent"><em>t</em> = 16/17 = (0.33003300&#8230;)<sub>4</sub> &rarr; (<em>x</em> = 4/5, <em>y</em> = 0)</p>
</blockquote>
<p>The behavior of 1/17 and 16/17 is what you might expect: They go south. But 4/17 and 13/17 migrate not to the bottom of the square but to the two sides. If strings of 1s and 2s are so well-behaved, what&#8217;s the matter with  strings of 0s and 3s? Well, the geometric transformations associated with quadrants 1 and 2 are simple scalings and translations. The matrices for quadrants 0 and 3 are more complicated: They introduce rotations and reflections. As a result it&#8217;s not so easy to predict the trajectory of an <em>x, y</em> point from the sequence of quadits in the <em>t</em> value. In any case I have not yet found a simple and obvious general rule.</p>
<p>The case of <em>t</em> = <em></em>n/13 is no less perplexing:</p>
<blockquote>
<p class="indent"><em>t</em> = 1/13 = (0.010323010323&#8230;)<sub>4</sub> &rarr; (<em>x</em> = 1/3, <em>y</em> = 0)</p>
<p class="indent"><em>t</em> = 4/13 = (0.103230103230&#8230;)<sub>4</sub> &rarr; (<em>x</em> = 0, <em>y</em> = 2/3)</p>
<p class="indent"><em>t</em> = 9/13 = (0.230103230103&#8230;)<sub>4</sub> &rarr; (<em>x</em> = 1, <em>y</em> = 2/3)</p>
<p class="indent"><em>t</em> = 12/13 = (0.323010323010&#8230;)<sub>4</sub> &rarr; (<em>x</em> = 2/3, <em>y</em> = 0)</p>
</blockquote>
<p>When I trace through these transformations, as I did above for <em>t</em> = 2/5, I get the right answer in the end, but I haven&#8217;t a clue to the logic that drives the trajectory. I certainly can&#8217;t look at such a sequence of quadits and predict where the point will wind up.</p>
<hr />
<p>I am left with more questions than answers. Furthermore, I don&#8217;t know whether the questions are genuinely difficult or if I am just missing something obvious. (It wouldn&#8217;t be the first time.) Anyway, here are the two big ones:</p>
<ul>
<li>Can we prove that all Fermat numbers give rise to Hilbert-curve perimeter points? And, for composite Fermat numbers, will we always find that at least one of the factors shares this property?</li>
<li>Apart from the Fermat primes and factors of composite Fermat numbers, is 13 the only &#8220;sporadic&#8221; case? If so, what&#8217;s so special about 13?</li>
</ul>
<p>I lack the mental muscle to answer these questions. Maybe someone else will make progress.</p>
<hr />
<p><strong>Update 2013-04-27</strong>: After publishing this story yesterday, I extended my search for &#8220;interesting&#8221; prime denominators, covering the territory between 257 and 65537. I found one new specimen: 61681. Twenty <em>t</em> values with this denominator yield perimeter points on the Hilbert curve. The smallest of them is t = 907/61681 &rarr; (<em>x</em> = 0, <em>y</em> = 101/1025). The repeating unit of the quaternary expansion of this fraction is (0.00033003223330033011)<sub>4</sub>.</p>
<hr />
<p><strong>Update 2013-04-29</strong>: Please see the comments! Several readers have provided illuminating insights, including a finite-state machine by ShreevatsaR that recognizes the class of quaternary-digit sequences that map to the perimeter of the square. And, as a further result of ShreevatsaR&#8217;s analysis, we have yet another &#8220;interesting&#8221; prime denominator: 15790321.</p>
]]></content:encoded>
			<wfw:commentRss>http://bit-player.org/2013/mapping-the-hilbert-curve/feed</wfw:commentRss>
		<slash:comments>16</slash:comments>
		</item>
		<item>
		<title>Flying Nonmetric Airways</title>
		<link>http://bit-player.org/2013/flying-nonmetric-airways</link>
		<comments>http://bit-player.org/2013/flying-nonmetric-airways#comments</comments>
		<pubDate>Thu, 04 Apr 2013 12:35:15 +0000</pubDate>
		<dc:creator>Brian Hayes</dc:creator>
				<category><![CDATA[mathematics]]></category>
		<category><![CDATA[modern life]]></category>

		<guid isPermaLink="false">http://bit-player.org/?p=1536</guid>
		<description><![CDATA[It&#8217;s the nature of triangles that no one side can be longer than the sum of the other two sides: For triangle ABC, AC &#8804; AB + BC. This is the triangle inequality. Euclid proved it (Book I, Proposition 20). &#8230; <a href="http://bit-player.org/2013/flying-nonmetric-airways">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>It&#8217;s the nature of triangles that no one side can be longer than the sum of the other two sides: For triangle <em>ABC</em>, <em>AC</em> &le; <em>AB</em> + <em>BC</em>. This is the triangle inequality. Euclid proved it (Book I, Proposition 20). With appropriate definitions it holds for triangles on the surface of a sphere as well as on a plane. And the everyday human experience of moving around in the universe amply confirms it. Unless you are booking a flight from Boston to Philadelphia.</p>
<p><img class="centered" src="http://bit-player.org/wp-content/uploads/2013/04/BOS-DTW-PHL-640px.jpg" alt="map of northeastern us showing direct route from Boston to Philadelphia and a detour via Detroit" border="0" width="640" height="433" /></p>
<p class="indent">Yesterday I had to arrange such a trip on short notice. I was offered a choice of several direct flights, with the cheapest round-trip ticket priced at $562. But I could get there and back for just $276 if I went via Detroit.</p>
<p>I am fascinated and appalled by the economics of this situation. From one point of view it makes perfect sense: A direct flight is faster and more convenient, so of course it should command a premium price. But when you look at the cost side of the equation, it seems crazy: The Detroit detour quadruples the mileage and adds an extra takeoff and landing. Shouldn&#8217;t those flyers who long for a view of Lake Erie and a stopover in the Motor City be asked to pay extra for the privilege?</p>
<p>The usual explanation of this paradox is the marginal-cost argument. If the BOS-PHL route is saturated, but there are empty seats on the BOS-DTW and DTW-PHL legs, the airline is better off filling the vacant seats at any price above the marginal cost of adding a single passenger. If the price is <em>too</em> attractive, however, customers will defect from the premium flight. No doubt the observed price differential was determined by some optimization program running in the airline&#8217;s back office, nudging the system toward an equilibrium point.</p>
<p>Sound sensible? Suppose I had wanted to go to Detroit instead of Philadelphia. When I looked up the fares this morning, I found that the cheapest nonstop BOS-DTW ticket is $1,224. But I could pay as little as $578 if I were willing to make a detour through&#8212;guess where&#8212;Philadelphia. Now it appears the load factors are reversed: It&#8217;s the Beantown&#8211;Motown corridor where demand is strong, while the City of Brotherly Love takes up the slack.</p>
<p>If that program in the back office were trying to optimize overall system efficiency&#8212;perhaps aiming to minimize aggregate passenger travel time as well as fuel consumption, pollution, labor inputs and other resources&#8212;I have a hard time believing it would come up with a solution anything like the itinerary I&#8217;m following today. </p>
<p>By the way, I&#8217;m not going to Detroit. I&#8217;m making a stop in Queens instead. At least the triangle is skinnier.</p>
<hr />
<p><strong>Update: Totally triangular</strong>. On the first leg of the trip, we pushed away from the gate at Logan airport and the pilot immediate announced that we&#8217;d be waiting an hour or more before takeoff because of air traffic congestion at JFK. What could cause such congestion? You don&#8217;t suppose the problem might possibly be caused or exacerbated by pricing policies that encourage people flying from Boston to Philadelphia to stop in New York?</p>
<p>As it turned out, the delay was only 10 or 15 minutes rather than an hour, and I made my connection to the Philadelphia flight. </p>
<p>On the return trip, I was getting emails and phone messages from the airline as I waited barefoot in the security queue at PHL. My departure time had been pushed back by 30 minutes, again because of JFK congestion. When I got to the gate, a weary but helpful agent told me: &#8220;If you want to get home tonight, go to Cincinnati.&#8221; So I took the fat triangle, flying 1,244 miles to go just 268 (a worse ratio than the Detroit route).</p>
<p>Is all this just the whining of an unhappy traveler? Maybe, but I there&#8217;s an economic puzzle that I&#8217;m wanting to solve. What rational business strategy rewards a customer or a company for wasting 1,000 miles worth of fuel?</p>
]]></content:encoded>
			<wfw:commentRss>http://bit-player.org/2013/flying-nonmetric-airways/feed</wfw:commentRss>
		<slash:comments>14</slash:comments>
		</item>
		<item>
		<title>Sphere packings and Hamiltonian paths</title>
		<link>http://bit-player.org/2013/sphere-packings-and-hamiltonian-paths</link>
		<comments>http://bit-player.org/2013/sphere-packings-and-hamiltonian-paths#comments</comments>
		<pubDate>Wed, 13 Mar 2013 16:57:54 +0000</pubDate>
		<dc:creator>Brian Hayes</dc:creator>
				<category><![CDATA[computing]]></category>
		<category><![CDATA[mathematics]]></category>
		<category><![CDATA[physics]]></category>

		<guid isPermaLink="false">http://bit-player.org/?p=1533</guid>
		<description><![CDATA[In an American Scientist column published last November, I discussed efforts by groups at Harvard and Yale to identify arrangements of n equal-size spheres that maximize the number of pairwise contacts between spheres. The Harvard collaboration (Natalie Arkus, Vinothan N. &#8230; <a href="http://bit-player.org/2013/sphere-packings-and-hamiltonian-paths">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p><script type="text/javascript">
    (new Image()).src = "http://bit-player.org/wp-content/uploads/2013/03/stellatedOctahedron-300x300-anim.gif";
</script></p>
<p>In an <a class="pdf-icon" href="http://www.americanscientist.org/libraries/documents/2012108167249287-2012-11Hayes.pdf"><em>American Scientist</em> column</a> published last November, I discussed efforts by groups at Harvard and Yale to identify arrangements of <em>n</em> equal-size spheres that maximize the number of pairwise contacts between spheres. The Harvard collaboration (Natalie Arkus, Vinothan N. Manoharan and Michael P. Brenner) solved this problem for clusters of up to <em>n</em> = 10 spheres. The Yale group (Robert S. Hoy, Jared Harwayne-Gidansky and Corey S. O&#8217;Hern) extended the result to <em>n</em> = 11.</p>
<p>In describing some algorithmic refinements by the Yale researchers I wrote the following sentence:</p>
<p><footnote class="marginalia note undent">The paper alluded to in this passage is: T. Biedl, E. Demaine, M. Demaine, S. Lazard, A. Lubiw, J. O&rsquo;Rourke, M. Overmars, S. Robbins, I. Streinu, G. Toussaint and S. Whitesides. 2001. Locked and unlocked polygonal chains in three dimensions. <em>Discrete and Computational Geometry</em> 26:269&ndash;281.</footnote></p>
<blockquote><p>For example, they took advantage of a curious fact proved by Therese Biedl, Erik Demaine and others: Any valid packing of spheres has a continuous, unbranched path that threads from one sphere to the next throughout the structure, like a long polymer chain.</p></blockquote>
<p class="indent">A few weeks ago Robert Connelly of Cornell wrote me to point out that this statement is erroneous in two ways. First, Biedl and Demaine and their colleagues did not prove (or even attempt to prove) the &#8220;curious fact&#8221; I mentioned. Second, the fact is not a fact. It&#8217;s simply not true that all &#8220;valid packings&#8221; have a continuous unbranched path from sphere to sphere&#8212;known as a Hamiltonian path, after William Rowan Hamilton.</p>
<p>What&#8217;s a &#8220;valid packing&#8221;? The Harvard and Yale groups focused on arrangements of spheres that meet two criteria: A cluster must have at least 3<em>n</em> &ndash; 6 sphere-to-sphere contacts overall, and every sphere must touch at least three other spheres. Clusters that satisfy these conditions are termed &#8220;minimally rigid.&#8221; Connelly showed that not all such clusters have a Hamiltonian path. The demonstration is direct. Working with Erik Demaine and Martin Demaine, he produced a counterexample&#8212;a 16-sphere minimally rigid cluster that can be proved to have no Hamiltonian path. It later emerged there is a smaller example, with just 14 spheres.</p>
<p>The concept of a Hamiltonian path comes from graph theory rather than geometry, but it&#8217;s easy to translate between the two realms. The spheres of a geometric cluster correspond to the vertices of a graph; two vertices in the graph are connected by an edge if and only if the corresponding spheres are in contact. A Hamiltonian path through the graph is a route along some subset of the edges that visits each vertex exactly once. A graph that has such a path is said to be <em>traceable</em>, since you can follow the route through a diagram without ever lifting the pencil. The Hamiltonian path is not required to traverse all the edges. Nor does it have to return to its starting point. (A path that <em>does</em> form a closed loop is a called a Hamiltonian circuit.)</p>
<p>Connelly&#8217;s 16-sphere counterexample is shown in the photographs below as a skeleton built with the Geomags construction kit. At right is the corresponding graph, with edge colors that match those in the photos.</p>
<p><img class="marginalia" src="http://bit-player.org/wp-content/uploads/2013/03/non-Ham-graph-16-220px.png" alt="The 16-vertex graph." border="0" width="220" height="280" /></p>
<p><img class="centered" src="http://bit-player.org/wp-content/uploads/2013/03/Connely-16-equitorial-and-polar.jpg" alt="two more views of the same 16-vertex cluster, from an equatorial position (left) and a polar point of view (right)" border="0" width="640" height="302" />
<p class="figure-caption">A 16-sphere cluster that has no Hamiltonian path is shown in equatorial and polar views. In this Geomags model, the sphere centers are represented by the shiny steel balls; spheres in contact are connected by a colored magnetic strut. All the struts are the same length. The graph at right preserves the pattern of connectivity of the cluster but not the geometry.</p>
<p class="indent">The core of this structure <em>(yellow)</em> is a pentagonal dipyramid with 10 triangular faces. Nine of the faces are decorated with tetrahedral caps <em>(red)</em>; the tenth face is left unadorned. Counting the balls and struts in the model or the vertices and edges in the graph shows that the structure satisfies the criteria for minimal rigidity: The 16 spheres are linked by 3 &times; 16 &ndash; 6 = 42 bonds, and every sphere touches at least three others.</p>
<p>How do we know that the graph has no Hamiltonian path? In general, answering this question is a difficult task (indeed, it&#8217;s NP-complete). But this particular graph was designed specifically to make the problem easy. Connelly explains why there can be no unbranched path that threads through all the vertices:</p>
<blockquote><p>The reason is a simple counting argument. Suppose there is a Hamiltonian path. Since there are 16 vertices in all, the Hamiltonian path must have 15 edges. Each of the 9 additional vertices is adjacent to 2 edges in the Hamiltonian path, except possibly for the 2 end points of the path, which each correspond to 1 edge of the path.  This is a disjoint set of at least 2 &times; 9 &ndash; 2 = 16 edges, one more than there are in the path, a contradiction.</p></blockquote>
<p>The smaller, 14-sphere counterexample is constructed in the same way, but instead of a pentagonal dipyramid the core of the structure is a square dipyramid&#8212;an object better known as an octahedron. All eight faces are capped with tetrahedra, making a stellate octahedron.</p>
<p><img class="marginalia" src="http://bit-player.org/wp-content/uploads/2013/03/non-Ham-graph-14-220px.png" alt="the 14-vertex non-Hamiltonian graph" border="0" width="220" height="232" /></p>
<p><img class="centered" src="http://bit-player.org/wp-content/uploads/2013/03/stellate-octahedron-geomags.jpg" alt="Stellate octahedron in equatorial and polar views" border="0" width="640" height="310" /></p>
<p>The argument for the impossibility of a Hamiltonian path takes exactly the same form as in Connelly&#8217;s example. Any path that reaches all eight of the stellate vertices must include at least 2 &times; 8 &ndash; 2 = 14 edges, but a Hamiltonian path in this graph has only 13 edges.</p>
<p><img class="alignleft" src="http://bit-player.org/wp-content/uploads/2013/03/stellatedOctahedron-300x300-static.gif" alt="sphere cluster: 14 spheres in a stellated octahedral configuration" border="0" width="300" height="300" onmouseover="this.src = 'http://bit-player.org/wp-content/uploads/2013/03/stellatedOctahedron-300x300-anim.gif'" onmouseout="this.src='http://bit-player.org/wp-content/uploads/2013/03/stellatedOctahedron-300x300-static.gif'" /></p>
<p class="indent">The illustration at left is another representation of the stellate octahedron, this time as a packing of equal-size spheres. (If you hover your mouse over the image, it might spin.)</p>
<p class="indent">The procedure for creating these non-Hamiltonian structures was devised by the geometer <a href="http://www.ams.org/samplings/feature-column/fcarc-klee">Victor Klee</a>; the resulting figures are now called <a href="http://en.wikipedia.org/wiki/Kleetope">Kleetopes</a>. The 14-node octahedral example, which Klee mentions in Branko Gr&uuml;nbaum&#8217;s book <em>Convex Polytopes</em>, is the smallest of an infinite series. You might think you could produce an even smaller example by starting with a triangular dipyramid, which has five vertices and six triangular faces. Adding six tetrahedral caps yields a cluster with 11 vertices in all. However, this structure <em>does</em> have Hamiltonian paths. (On the other hand, it has no Hamiltonian circuit.)</p>
<hr />
<p>When we give up the erroneous assumption that all minimally rigid arrangements have Hamiltonian paths, what is the status of the two searches for high-contact-number sphere packings? The following assessment is based on conversations and correspondence with several of the participants, but the wording and the conclusions are mine; others might well see it differently. </p>
<p>First of all, the Harvard group did not rely on any assumptions about Hamiltonian paths, so their enumeration of clusters up to <em>n</em> = 10 is entirely unaffected. </p>
<p>The Yale group adopted the Hamiltonian-path assumption as a way of containing the combinatorial explosion when they extended the search to <em>n</em> = 11. The computational burden can be measured in terms of the number of graph adjacency matrices, \(\bar{A}\), that need to be examined. Hoy, Harwayne-Gidansky and O&#8217;Hern wrote:</p>
<p><footnote class="marginalia note">Robert S. Hoy, Jared Harwayne-Gidansky and Corey S. O&rsquo;Hern.  2012. Structure of finite sphere packings via exact enumeration: Implications for colloidal crystal nucleation. <em>Physical Review E</em> 85:051403. <a href="http://jamming.research.yale.edu//files/papers/pre_85_051403.pdf">Link to author preprint</a>.</footnote></p>
<blockquote><p>All macrostates can be found with greatly reduced computational effort through appropriate selection of &#8220;topological&#8221; constraints on the elements of \(\bar{A}\). Biedl et al. . . . proved that all connected sphere packings admit linear polymeric paths, that is, for any valid packing, one can always permute particle indices so that the packing is fully traversed by a &#8220;polymeric&#8221; \(\bar{A}\) with \(A_{i,i+1} = 1\) for all \(i\).</p></blockquote>
<p>This assumption that all entries on the superdiagonal of the matrix can be set equal to 1 brings a huge reduction in computational cost. For <em>n</em> = 11, the number of matrices to be considered is slashed by more than three orders of magnitude. But of course that means 99.9 percent of all the candidate matrices are passed over without examination. If any of those ignored matrices were valid minimally rigid packings of 11 spheres, the Yale survey would have missed them.</p>
<p>How much should we worry about this potential omission? It depends on your point of view. If you look upon the result as a mathematical proof classifying all minimally rigid sphere clusters, then the proof has a big gap. But, as I noted in my <em>American Scientist</em> column, mathematical rigor was not the highest priority in this work and was already jeopardized by the use of a numerical algorithm (Newton&#8217;s method) that is not guaranteed to converge in all cases. The original motivation for both the Harvard and Yale projects came from chemistry and physics, not from geometry and graph theory. The idea was to identify the kinds of clusters that might form nuclei of condensing crystals or aggregations of colloidal particles. The physical significance of the findings is not much compromised by doubts about mathematical rigor.</p>
<p>In any case, the Yale results will require revision only if there exists at least one minimally rigid cluster of 11 or fewer spheres without a Hamiltonian path&#8212;and that now seems unlikely. Any such cluster with <em>n</em> &le; 10 would have been found by the Harvard survey (which, again, did not exclude untraceable graphs). Meanwhile, recent work by Miranda Holmes-Cerfon of NYU has produced a new enumeration of sphere packings up to <em>n</em> = 12. The full results are still unpublished but she reports no sign of clusters that were missed because of the incorrect Hamiltonian-path assumption. </p>
<p>The Holmes-Cerfon survey is based on a different methodology. Instead of generating vast numbers of adjacency matrices and testing them to see which ones correspond to valid packings, she begins with a known cluster and tries to transform it into all other valid packings with the same number of spheres. The transformations consist of all possible movements of a single bond that maintain the conditions for minimal rigidity. This process is computationally less arduous, although it does rely on the assumption that all valid configurations can be reached by some series of single-bond moves.</p>
<hr />
<p>When I first heard about the search for clusters that maximize contact number, I was surprised to learn that such simple questions remain unanswered. How could it be that we know so little about clusters of just a dozen spheres? I&#8217;m still intrigued, and now I have another question to noodle over: How come we know so little about Hamiltonian paths in small graphs? Is Klee&#8217;s 14-vertex example the smallest for minimally rigid structures? There can&#8217;t be any efficient way of answering this question (unless P = NP), but is it beyond our ability to close the gap between <em>n</em> = 11 and <em>n</em> = 14?</p>
<p>Acknowledgments: I&#8217;m grateful to Bob Connelly both for bring this matter to my attention and for helping me understand the issue. I have also benefitted from very helpful conversations and emails with Natalie Arkus, Michael P. Brenner, Karoly Bezdek, Miranda Holmes-Cerfon, Robert Hoy, David Wales and Zorana Zeravcic. (But if I still don&#8217;t have the story straight, it&#8217;s not their fault!)</p>
]]></content:encoded>
			<wfw:commentRss>http://bit-player.org/2013/sphere-packings-and-hamiltonian-paths/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Recursive driveling</title>
		<link>http://bit-player.org/2013/recursive-driveling</link>
		<comments>http://bit-player.org/2013/recursive-driveling#comments</comments>
		<pubDate>Fri, 01 Mar 2013 17:03:54 +0000</pubDate>
		<dc:creator>Brian Hayes</dc:creator>
				<category><![CDATA[computing]]></category>
		<category><![CDATA[linguistics]]></category>

		<guid isPermaLink="false">http://bit-player.org/?p=1525</guid>
		<description><![CDATA[If there&#8217;s anything inaner than turning literature into drivel, it&#8217;s turning drivel into drivel. I&#8217;ve added a &#8220;recurse&#8221; button to the drivel generator. It feeds the output back to the input, like xeroxing a xerox. What happens when this process &#8230; <a href="http://bit-player.org/2013/recursive-driveling">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>If there&#8217;s anything inaner than <a href="http://bit-player.org/2013/driveling">turning literature into drivel</a>, it&#8217;s turning drivel into drivel. I&#8217;ve added a &#8220;recurse&#8221; button to <a href="http://bit-player.org/extras/drivel/drivel.html">the drivel generator</a>. It feeds the output back to the input, like xeroxing a xerox.</p>
<p>What happens when this process is repeated many times? Before I tried the experiment, two quite different outcomes both seemed plausible. On the one hand, driveling is a recombinatory process that stirs up the text and thereby introduces novelty. <em>N</em>th-order drivel can&#8217;t create any <em>n</em>-grams that don&#8217;t also appear in the source text, but those <em>n</em>-grams are jammed together in new ways. Hodgepodge words and phrases can be expected to proliferate as the recursion continues, increasing the entropy of the drivel.</p>
<p>The counterargument says that driveling is also a sampling process. With each round of recursion, some elements of the source text are left behind&#8212;and once lost they can never be recovered. In the long run, then, we should expect the recursive drivel to grow more monotonous, with an ever-smaller vocabulary. It&#8217;s like a biological population that steadily loses diversity for lack of new germ plasm.</p>
<p>By all means try the experiment for yourself. Here are the results I got when I repeatedly recycled the text of Matthew Arnold&#8217;s poem &#8220;Dover Beach.&#8221; In each round of recursion, I generated a thousand characters of drivel, which became the source text for the next round. In the snippets below, I show only the first line of the output for each round. The integer in front of each line is the level of recursion.</p>
<blockquote><p><strong>second-order drivel</strong><br />
0&nbsp;&nbsp;&nbsp;Hating To trand is of Engles shor low, to Hat gone Fine shichocland,<br />
1&nbsp;&nbsp;&nbsp;p ful, Gles drawither lonce, Gles thdrand lon so of sh Only he again;<br />
2&nbsp;&nbsp;&nbsp;an, th Only heith re by th re Fret ebbland long Thering and is drawits<br />
3&nbsp;&nbsp;&nbsp;nly he And, thelas of dar turn, Wits of drawith turn, up fliffs ong<br />
4&nbsp;&nbsp;&nbsp;e and by herin; And, the and by th turn, we and brin; And by heit up<br />
5&nbsp;&nbsp;&nbsp;Wit up flike and, to-night up flike Fing pebblas onch&#8217;s of Fin; And, to-<br />
6&nbsp;&nbsp;&nbsp;tretretretretretretretretretretretretretretretretretretretretretretret
</p></blockquote>
<blockquote><p><strong>fourth-order drivel</strong><br />
0&nbsp;&nbsp;&nbsp;d flight Gleams, So various, so beautiful, so beautiful, so beautiful, so <br />
1&nbsp;&nbsp;&nbsp;beautiful, so beautiful, so beautiful, so beautiful, so beautiful, so 
</p></blockquote>
<blockquote><p><strong>sixth-order drivel</strong><br />
0&nbsp;&nbsp;&nbsp;his mind then again begin, and round earth&#8217;s shore Lay like the sound a  <br />
1&nbsp;&nbsp;&nbsp;rue To one another! for the world. Ah, love, let us be true To one <br />
2&nbsp;&nbsp;&nbsp;, let us be true To one another! for the world. Ah, love, let us be true <br />
3&nbsp;&nbsp;&nbsp;rue To one another! for the world. Ah, love, let us be true To one 
</p></blockquote>
<blockquote><p><strong>eighth-order drivel</strong><br />
0&nbsp;&nbsp;&nbsp;g ago Heard it on the Aegean, and it brought Into his mind the turbid <br />
1&nbsp;&nbsp;&nbsp;r the world. Ah, love, let us be true To one another! for the world. Ah, <br />
2&nbsp;&nbsp;&nbsp;ve, let us be true To one another! for the world. Ah, love, let us be true <br />
3&nbsp;&nbsp;&nbsp;world. Ah, love, let us be true To one another! for the world. Ah, love, 
</p></blockquote>
<p>In every case, the process quickly reaches a fixed point&#8212;and a rather boring one at that. The <a href="http://bit-player.org/2013/driveling#banana">banana phenomenon</a> is doubtless a major factor in what we&#8217;re seeing here; it would be interesting to rerun the experiment with an algorithm immune to that flaw. Also important are finite-size effects. I would like to believe that the outcome would be different if we could generate infinite streams of drivel from an infinitely long source text. The trouble is, I can&#8217;t really imagine what an infinitely long source text would look like. If an endless lyric by Matthew Arnold is not trivially repetitious (&#8220;so beautiful, so beautiful, so beautiful&#8221;) then it has to be some sort of enumeration of all possible combinations of <em>n</em>-grams. In either case, it seems rather drivelish, even without algorithmic help.</p>
]]></content:encoded>
			<wfw:commentRss>http://bit-player.org/2013/recursive-driveling/feed</wfw:commentRss>
		<slash:comments>9</slash:comments>
		</item>
		<item>
		<title>Driveling</title>
		<link>http://bit-player.org/2013/driveling</link>
		<comments>http://bit-player.org/2013/driveling#comments</comments>
		<pubDate>Sun, 24 Feb 2013 20:02:36 +0000</pubDate>
		<dc:creator>Brian Hayes</dc:creator>
				<category><![CDATA[computing]]></category>
		<category><![CDATA[linguistics]]></category>

		<guid isPermaLink="false">http://bit-player.org/?p=1524</guid>
		<description><![CDATA[&#8220;The fine art of turning literature into drivel&#8221; is a specialty of mine. I&#8217;ve been doing it for 30 years. Here is a specimen of drivel that I extracted from Walter Benjamin&#8217;s 1936 essay &#8220;The Work of Art in the &#8230; <a href="http://bit-player.org/2013/driveling">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>&#8220;The fine art of turning literature into drivel&#8221; is a specialty of mine. I&#8217;ve been doing it for 30 years. Here is a specimen of drivel that I extracted from Walter Benjamin&#8217;s 1936 essay &#8220;The Work of Art in the Age of Mechanical Reproduction&#8221;:</p>
<blockquote><p>Artistic receptivity which, by means of gas masks, terrifying megaphones, flame throwers, and beaches which face the public present conditions. The camera, with a theology of art. We do not deny that individual reactionary manner by the unarmed eye. A bird&#8217;s-eye view best captured by a clock.</p></blockquote>
<p>If the rhetoric of megaphones and flame throwers is too strident for your taste, try some Edgar Allan Poe, made even more breathless than usual by the algorithmic mixmaster:</p>
<blockquote><p>And the faintly rappiness of the accompare, name a tappiness: his holier odorous and unwonted heart a spirits hallowed fast all! While even in the Naiad from its purple curtain rustle throbbing bride In her brow What wild weird clime that her head, Repenting from the headlong&#8211; Her world of moan</p></blockquote>
<p>Maybe you can guess whose <em>n</em>-grams these are:</p>
<blockquote><p>These frequencies of memory. The programmer for banana phenomenon. Am I the original text, but writing familiarity. It is nonsense, but nevertheless it shows only those days, so I had to the rhetoric of megaphones, flame them down one another corresponding on typewriters. In second-order drivel.</p></blockquote>
<p>Yes: That&#8217;s a self-referential pastiche of the very document you are reading at this moment. And don&#8217;t bother telling me that the scrambled version is more fun than the original; I already know that.</p>
<hr />
<p>I&#8217;m going to say a bit more about the algorithms behind this silliness, but first I invite you to <a href="http://bit-player.org/extras/drivel/drivel.html">go make your own drivel.</a> The program that generates this mish-mash runs as a web app. You can mangle a few cultural treasures that I&#8217;ve looted from <a href="http://www.gutenberg.org/">Project Gutenberg</a> and elsewhere. And you may also be able to drivelize texts of your own choosing. (For this you&#8217;ll need an up-to-date web browser.) Have fun, but come back when you&#8217;re done.</p>
<hr />
<p>So how do we transform literature into drivel? The simplest strategy is just to choose letters randomly and independently from the source text and write them down one after the other. Call this zeroth-order drivel:</p>
<blockquote><p>,ca adigaigjr nre hs n eveel&#8217;adnwbtfs s!notm samhhd cdseghs xhi annm no,eghkg ne ttidpatlgtrirTefgsuw g ehilehn:tosiceerlI&#8221;u loaotiiuom aou</p></blockquote>
<p>The source text in this case is Alexander Pushkin&#8217;s novel-in-verse <em>Eugene Onegin</em> (in an English translation by Charles H. Johnson). The drivel mimics the letter frequencies of the original&#8212;lots of <em>e&#8217;</em>s and <em>t&#8217;</em>s, fewer <em>f&#8217;</em>s and <em>v&#8217;</em>s&#8212;but captures no information at all about the sequence in which the symbols appear in the original.</p>
<p>After zeroth-order drivel comes first-order drivel, which takes each character of the source text and tallies the frequencies of all the symbols that might possibly follow it. These frequencies yield a table of probabilities for the next drivel character. Suppose at some point in the driveling process we have just generated a <em>v</em>. Then we must find out what characters follow <em>v</em> in the source text, and how often each of them appears. It turns out there are 1,415 <em>v&#8217;</em>s in the <em>Onegin</em> text, and they are followed by 15 different characters:</p>
<pre>
   pair     count   proportion
    ve       974      0.6883
    vi       193      0.1364
    va       102      0.0721
    vo        72      0.0509
    vg        24      0.0170
    v         11      0.0078
    v,        10      0.0071
    vy         8      0.0057
    vs         5      0.0035
    vu         4      0.0028
    v'         3      0.0021
    vn         3      0.0021
    v&eacute;         3      0.0021
    v;         2      0.0014
    v&aacute;         1      0.0007</pre>
<p>Thus the next character of the drivel stream will be an <em>e</em> with probability 0.69, an <em>i</em> with probability 0.14, and so on. Whichever symbol is chosen from this list will become the seed for the next pass through the first-order driveling process. If it&#8217;s an <em>a</em>, for example, then in the next round the algorithm will look at all the characters that can follow <em>a</em> (there are 35 of them), and make a choice according to the relative frequencies.</p>
<p>First-order drivel is a huge improvement over the zeroth-order stuff, but nevertheless it shows only the vaguest glimmers of linguistic structure:</p>
<blockquote><p>andilielderonlyo oouadion t, honin Itheatishend aricivee d porg ad eandd t this. ad k: withiofou hene tone Gontrs ted)&mdash; ct), he touthet t h, te g owsin d.</p></blockquote>
<p>Common digraphs such as <em>th</em> have begun to show up, and every now and then we get a fully formed word, such as <em>this</em>. But for the most part it&#8217;s still monkeys pounding on typewriters.</p>
<p>In second-order drivel, symbols are taken two at a time, and probabilities are calculated for all possible successors to each pair. The result is something you could almost read aloud (perhaps with a Scots accent):</p>
<blockquote><p>The of hise fing flink waime ing, My rectearks the gold thaught worns haverne&#8217;s peave st ands he bre drink alloveremid, ane why ned, heady; ifer grens, evill </p></blockquote>
<p>With third-order drivel, probabilities are calculated from triples of letters:</p>
<blockquote><p>We meetness pressons, and of his longuisencess he giddles, bence wing; Tatyana ladiesteps, the pain in to the servings, or sere nevent I catch oth</p></blockquote>
<p>Here we enjoy brief moments of seeming lucidity, as letters condense into words, and sometimes the words organize themselves into phrases&#8212;but then the protodiscourse dissolves back into longuisencess again.</p>
<div class="figure-with-caption"><img class="centered" src="http://bit-player.org/wp-content/uploads/2013/02/drivel-algorithm.png" alt="algorithm for third-order drivel" border="0" width="640" height="220" /></p>
<p class="figure-caption">How to turn literature into drivel: The four panels show the third-order drivel algorithm in action with letter frequencies derived from Pushkin&#8217;s <em>Eugene Onegin</em>. The initial seed <em>(far left)</em> is the three-letter sequence <em>dri</em>. Out of the seven characters that are observed to follow <em>dri</em> in the Pushkin text&#8212;shown with their frequencies in parentheses&#8212;the algorithm makes a weighted random choice, which in this case is the letter <em>v</em>. In the next round, the seed sequence is <em>riv</em>, and the chosen letter is <em>e</em>. Then the pattern <em>ive</em> leads to selection of an <em>l</em>, and finally <em>vel</em> is followed by a word space (denoted <em>#</em>). It&#8217;s worth noting that the complete word <em>drivel</em> does not appear in the text of <em>Onegin</em>.</p>
</div>
<p>The drivel examples given at the beginning of this article come from higher-order drivelers, with probabilities calculated from strings of six, seven or eight characters. At this level there&#8217;s no doubt we&#8217;re in the realm of language rather than mere alphabet soup. Even though there&#8217;s no sign of grammatical structure or meaning, what comes out of the program is immediately recognizable as English. If you know what to look for, the writerly tics of individual authors begin to show through. This is what intrigued me when I first began driveling back in 1983. In a <a class="pdf-icon" href="http://bit-player.org/bph-publications/SciAm-1983-11-Hayes-drivel.pdf">&#8220;Computer Recreations&#8221; column</a> I wrote:</p>
<blockquote><p>What is remarkable is that the product of this simple exercise sometimes has a haunting familiarity. It is nonsense, but not undifferentiated nonsense; rather it is Chaucerian or Shakespearian or Jamesian nonsense. Indeed, with all semantic content eliminated, stylistic mannerisms become the more conspicuous. It makes one wonder: Just how close to the surface are the qualities that define an author&#8217;s style?</p></blockquote>
<hr />
<p>The program that generated my 1983 drivel was written in Microsoft BASIC and ran on a PC with two floppy drives but no hard disk. There was no Project Gutenberg in those days, so I had to type in the texts myself. I spent a long, bleary night transcribing the &#8220;Ithaca&#8221; chapter from James Joyce&#8217;s <em>Ulysses</em>. (The chapter, also known as Molly Bloom&#8217;s soliloquy, is a marathon run-on sentence.) Once the keyboarding was done, the program would grind out drivel at a rate of one or two characters per minute. </p>
<p>The first version of the program was built around matrices of precomputed probabilities. Given an alphabet of <em>s</em> symbols, a first-order drivel program needs an <em>s</em> &times; <em>s</em> matrix, like this one for a 28-symbol alphabet:</p>
<p><footnote class="marginalia note undent">The 1983 article used a different numbering scheme for drivel orders, calling this a second-order table.</footnote></p>
<p><img class="centered" src="http://bit-player.org/wp-content/uploads/2013/02/Hayes-drivel-matrix-640x418.jpg" alt="Hayes drivel matrix 640x418" border="0" width="640" height="418" /></p>
<p>The chart is based on the third act of <em>Hamlet</em>. Find the row corresponding to the current symbol in the drivel process, then scan across the columns to read off the probabilities for all possible successor symbols. (The last two symbols are the apostrophe and the word space, represented as &#8216;#&#8217;.) Note that this is a stochastic matrix: The entries in each row sum to exactly 1.</p>
<p>Moving on to second-order drivel, the matrix expands to <em>s</em><sup>2</sup> rows, which accommodate all the two-symbol sequences from <em>aa</em> through ##, each row having <em>s</em> columns. In the case of a 28-symbol alphabet, that comes to about 22,000 matrix elements, which seemed like Big Data back then. The next stage, a third-order matrix, would have more than 600,000 elements, which was more than I could squeeze into 256 kilobytes of memory. The array wouldn&#8217;t even fit on disk (maximum capacity 320 kilobytes).</p>
<p>I gave some thought to sparse-matrix methods, but then I had a better idea.</p>
<blockquote><p>The fact is, all the information that could be incorporated into any frequency table, however large, is present in the original text, and there it takes its most compact form&#8230;. What the frequency table records is the frequency of character sequences in the text, but those sequences, and only those sequences, are also present in the text itself in exactly the frequency recorded.</p></blockquote>
<p>The algorithm suggested by this observation searches through the full source text to create a new, one-dimensional frequency table for each seed pattern. Instead of precomputing and storing the probabilities associated with every possible seed, we regenerate them on the fly,  as needed. The  saving of space comes at the expense of wasting time, since the same search is repeated for every occurrence of an <em>n</em>-gram pattern. Various methods of hashing, caching or memoization could have fine-tuned the tradeoff between space and time, but I didn&#8217;t know that then. A few correspondents pointed it out after the article appeared.</p>
<p>Several other correspondents mentioned another shortcut, which I&#8217;m going to call the Shannon algorithm. In a followup column I wrote:</p>
<blockquote><p>Bobby Bryant, James W. Butler, Ronald E. Diel, William P. Dunlap and Jim Schirmer pointed out still another algorithm that is not only faster than the one I gave but also appreciably simpler. It eliminates frequency tables entirely. When a letter is to be selected to follow a given sequence of characters, a random position in the text is chosen as the starting point for a serial search. Instead of tabulating all instances of the sequence, however, the search stops when the first instance is found [wrapping around to the beginning if necessary], and the next character is the selected one. If the distribution of letter sequences throughout the text is reasonably uniform, the results should closely approximate those given by a frequency table.</p></blockquote>
<p id="banana">The caveat at the end of that paragraph merits a further comment. When the distribution of sequences is <em>not</em> uniform, the failure can be spectacular. In <a href="http://www.inwap.com/pdp10/hbaker/hakmem/algorithms.html#item176">HAKMEM item 176</a> Bill Gosper named it the banana phenomenon. Suppose you are running the Shannon algorithm on a 100,000-character text that includes a single instance of the word <em>banana</em> and no other instances of the trigrams <em>ana</em> and <em>nan</em>. Let the seed pattern be <em>ana</em>. When you start a sequential search from a random point in the string, you have 99,998 chances to come upon the first <em>ana</em> and only two chances to reach the second instance. </p>
<p>In spite of this pitfall, I have adopted the Shannon algorithm for the online drivel generator; it&#8217;s just too easy and elegant to pass up. But it can indeed wander into strange blind alleys. For a live demonstration of what can go wrong, try some third-order driveling with the file named &#8220;Hayes-banana.txt&#8221;.</p>
<p>Why do I call this the Shannon algorithm? Because Claude Shannon described it in 1948, in &#8220;<a class="pdf-icon" href="http://cm.bell-labs.com/cm/ms/what/shannonday/shannon1948.pdf">A Mathematical Theory of Communication</a>.&#8221; His implementation involved opening a book at a random page. He gave several examples of convincing drivel he produced by this pencil-and-paper method.</p>
<p>Shannon wasn&#8217;t the only predecessor. Even earlier&#8212;a full century ago&#8212;A. A. Markov wrote his paper on &#8220;An example of statistical investigation of the text <em>Eugene Onegin</em> concerning the connection of samples in chains.&#8221; It was a recent encounter with this paper that brought me back to driveling 30 years after my first adventure. As <a href="http://bit-player.org/2013/100-years-of-markov-chains">noted here a few weeks ago</a>, I have recently given a talk on the early history of Markov chains. The video (<a href="http://media.seas.harvard.edu/content/iacs/13_01_23%20Brian%20Hayes_100%20Yrs%20of%20Markov.flv?play">FLV</a>, <a href="http://media.seas.harvard.edu/content/iacs/13_01_23%20Brian%20Hayes_100%20Yrs%20of%20Markov.mp4?play">MP4</a>) and audio (<a href="http://media.seas.harvard.edu/content/iacs/13_01_23%20Brian%20Hayes_100%20Yrs%20of%20Markov.mp3?play">MP3</a>) are now online, and so are the slides (<a href="http://bit-player.org/wp-content/extras/markov/#/">HTML</a>). Finally, my <a href="http://www.americanscientist.org/issues/pub/2013/2/first-links-in-the-markov-chain">latest <em>American Scientist</em> column</a> is on the same theme.</p>
<hr />
<p>There remains a personal question: Why does this kind of goofiness amuse me so? Am I the only one susceptible to its charms? Perhaps it is a vice that I should keep to myself, like an inordinate fondness for puns or limericks. But, the fact is, I glimpse something both comic and poetic in some of this drivel. The fourth-order drivel below is based on the banana file. In some sense I wrote this, and yet I can take very little credit for its imagery, its cadences, its sheer cleverness for clues, theorems and eyeglasses. </p>
<blockquote><p>Figuring for banana or Mississississississississing for me, I have made it right, new particles, the University of sciency, but writing for its sheer clues, the University of the algorithm is widely admired for clues, theorems. As for banana or Missing link, the source of the back page of the source of the University of the University of the Holy Grail, the University of various permutations, and F&rsquo;s of the Holy Grail, the University of the University of my chosen pattern word algorithm has not easy. Indeed, I spend of the University of the University of sciency, but writing for newspaper, M&rsquo;s and F&rsquo;s of theorems. As for newspaper, now of theorems. As for newspaper, M&rsquo;s and eyeglasses. The detective search of the Northwest Passage, the Holy Grail, theorems. As for its sheer cleverness as a lot of one another, now of sciency, but writing a computer programmer for banana or Missississississississing link, the Holy Grail, theorems. As for its sheer clues, theorems. As for banana or Missississississing for bargains, the University of the University of the University of the Holy Grail, the source of the plumber for clues, the Northwest Passage, the University of the Holy Grail, theorems. As for me, I have made it right, the algorithm was invented by Robert S. Boyer and eyeglasses. </p></blockquote>
]]></content:encoded>
			<wfw:commentRss>http://bit-player.org/2013/driveling/feed</wfw:commentRss>
		<slash:comments>8</slash:comments>
<enclosure url="http://media.seas.harvard.edu/content/iacs/13_01_23%20Brian%20Hayes_100%20Yrs%20of%20Markov.flv?play" length="0" type="video/x-flv" />
<enclosure url="http://media.seas.harvard.edu/content/iacs/13_01_23%20Brian%20Hayes_100%20Yrs%20of%20Markov.mp4?play" length="0" type="video/mp4" />
<enclosure url="http://media.seas.harvard.edu/content/iacs/13_01_23%20Brian%20Hayes_100%20Yrs%20of%20Markov.mp3?play" length="0" type="audio/mpeg" />
		</item>
		<item>
		<title>Joshua Trees and Toothpicks</title>
		<link>http://bit-player.org/2013/joshua-trees-and-toothpicks</link>
		<comments>http://bit-player.org/2013/joshua-trees-and-toothpicks#comments</comments>
		<pubDate>Fri, 08 Feb 2013 18:53:26 +0000</pubDate>
		<dc:creator>Brian Hayes</dc:creator>
				<category><![CDATA[biology]]></category>
		<category><![CDATA[mathematics]]></category>
		<category><![CDATA[photography]]></category>

		<guid isPermaLink="false">http://bit-player.org/?p=1514</guid>
		<description><![CDATA[After the Joint Mathematics Meetings in San Diego last month, I took a day off for some botanical and mathematical tourism. I drove up to Joshua Tree National Park, in the high desert beyond the San Bernardino Mountains. The park&#8217;s &#8230; <a href="http://bit-player.org/2013/joshua-trees-and-toothpicks">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<div><script src='/extras/toothpicks/modernizr.custom.08602.js' type='text/javascript'></script><br />
<style type="text/css"> @import url("/extras/toothpicks/toothpicks.css");</style>
</div>
<p>After the <a href="http://jointmathematicsmeetings.org/meetings/national/jmm2013/2141_intro">Joint Mathematics Meetings</a> in San Diego last month, I took a day off for some botanical and mathematical tourism. I drove up to Joshua Tree National Park, in the high desert beyond the San Bernardino Mountains.</p>
<p><img class="centered" src="http://bit-player.org/wp-content/uploads/2013/02/Joshua-Tree-silhouette-1325-web.jpg" alt="Joshua tree silhouette, Hidden Valley, Joshua Tree National Park" border="0" width="640" height="674" /></p>
<p class="indent">The park&#8217;s namesake is the cheerfully odd <em>Yucca brevifolia</em>. According to a <a href="http://www.nps.gov/jotr/naturescience/jtrees.htm">park brochure and web site</a>, the Joshua tree used to be a lily, but now it&#8217;s an agave. The same brochure explains a little about the growth and development of the plant. Initially, a single stalk grows straight upward and eventually produces a flower at the apex. If that flower is fertilized, the fruiting process destroys the meristem&#8212;the actively growing tissue at the tip of the stem. The stalk then bifurcates, producing two limbs of roughly equal size, each with a new apical meristem. The branches grow in unpredictable directions. When the two new growth tips ultimately flower and fruit, they too bifurcate, creating four apices.</p>
<div class="figure-with-caption"><img class="centered" src="http://bit-player.org/wp-content/uploads/2013/02/Joshua-trees-with-1-2-4-8-branches.jpg" alt="Joshua trees with 1 2 4 8 branches" border="0" width="900" height="456" />
<p class="figure-caption">Joshua trees with 2<sup>0</sup>, 2<sup>1</sup>, 2<sup>2</sup> and 2<sup>3</sup> terminal tufts of green, bristly leaves.</p>
</div>
<p class="indent">What could be geekier than that? It&#8217;s a symmetrical binary tree, straight out of a computer science textbook. (Except that the textbook would turn the tree upside down.) Abstracting away all the shaggy biological details, a topological model of an idealized Joshua tree would look like this:</p>
<div class="figure-with-caption marginalia"><img class="centered" src="http://bit-player.org/wp-content/uploads/2013/02/Duke-window-with-binary-tree-pattern-0987.jpg" alt="Duke window with binary tree pattern 0987" border="0" width="220" height="309" /></p>
<p class="figure-caption">The same motif adorns the windows of a building at Duke University.</p>
</div>
<div style="background-color: #e5ddd7; width: 640px; height: 640px; margin-top: 20px; margin-bottom: 20px"><img type="img/svg+xml" class="centered" src="http://bit-player.org/wp-content/uploads/2013/02/joshua-tree-10.svg" alt="Joshua tree 10" border="0" width="100%" height="100%" /></div>
<p>In this diagram I have taken the liberty of filling in the unseen, underground portions of the plant by assuming symmetry: I give the root system the same branching structure as the above-ground parts. When this figure is turned 90 degrees, it is known as the H curve; in this orientation I guess it must be the I curve.</p>
<p>Before going any further with this story, I have to admit that the graph-theoretical structure of <em>Yucca brevifolia</em> is not quite as precise and regular as I first thought it might be. Not all the trees are strictly binary. As the sun came up in the park I soon spotted some trifurcations. Later in the day I found even odder branching patterns.</p>
<p><img class="centered" src="http://bit-player.org/wp-content/uploads/2013/02/trifurcated-Joshua-trees-1315-and-1414.png" alt="Trifurcated Joshua trees 1315 and 1414" border="0" width="640" height="465" /></p>
<p>So once again nature tries to implement an algorithm, and before long her mind begins to wander, producing doodles that are nowhere to be found in the specification. But that&#8217;s all right. My mind was wandering, too. As I trekked through the groves of Joshua trees, I kept reverting to thoughts of &#8220;toothpick trees.&#8221; These are structures I had learned about the day before from Neil J. A. Sloane, the sequencemeister of the <a href="http://oeis.org/">Online Encyclopedia of Integer Sequences</a>. I had run into Neil on the exhibit floor at the San Diego meeting, where the <a href="http://oeisf.org/">OEIS Foundation</a> had a booth.</p>
<p>I sensed a connection between Joshua trees and toothpick trees. In the idealized H curve shown above, the branches added in each generation are a little smaller than their parents. The shrinkage factor is \(1/\sqrt{2}\), which I applied to both the length and the thickness of the branches. What happens if the branches don&#8217;t shrink? They begin colliding with one another after just three generations. That&#8217;s the situation in a toothpick tree. It is formed on essentially the same pattern as the H curve, but without the shrinkage factor; instead we adopt a rule that whenever a branch touches another branch, the colliding tip is &#8220;sterilized&#8221; and no new branches grow there.</p>
<p>Here is a more precise description from the <a href="http://arxiv.org/abs/1004.3036">paper</a> by David Applegate, Omar E. Pol and Sloane that introduced the idea of toothpick trees:</p>
<blockquote><p>We start with an infinite sheet of graph paper and an infinite supply of line segments of length 1, called &ldquo;toothpicks.&rdquo; At stage 1, we place a toothpick on the <em>y</em>-axis and centered at the origin. Each toothpick we place has two ends, and an end is said to be &ldquo;exposed&rdquo; if this point on the plane is neither the end nor the midpoint of any other toothpick.</p>
<p>At each subsequent stage, for every exposed toothpick end, we place a toothpick centered at that end and perpendicular to that toothpick. The toothpicks placed at odd-numbered stages are therefore all parallel to the <em>y</em>-axis, while those placed at even-numbered stages are parallel to the <em>x</em>-axis.</p>
</blockquote>
<p>I have cobbled together a JavaScript-and-SVG program for assembling and disassembling toothpick trees up to stage <em>n</em> = 128. At this stage the number of toothpicks is 10,923, which is a lot of toothpicks if you buy them in boxes of 250. On the other hand, it&#8217;s a whole lot smaller than the 2<sup>128</sup>&ndash;1 branches of the full binary tree.</p>
<div class="marginalia note">The interactive version of this illustration relies on &#8220;inline SVG,&#8221; that is, Scalable Vector Graphics included directly within an HTML document. If you&#8217;re seeing a static illustration, without any buttons to click, I&#8217;m afraid your browser doesn&#8217;t support this feature. In my tests the program works in recent versions of Chrome, Safari, Firefox and Opera; it&#8217;s very unlikely to work in RSS readers. There is a stand-alone version of the interactive illustration <a href="http://bit-player.org/extras/toothpicks/toothpicks.html">here</a>. And David Applegate has another &#8220;<a href="http://www2.research.att.com/~david/oeis/toothpick.html">movie version</a>&#8221; based on different programming technology.</div>
<div id="toothpickContainer" class="aligncenter" width="500px" style="margin-top: 20px;">
<div id="toothpick-fallback">
		  <img src="/extras/toothpicks/toothpicks-static.png" width="500" height="498"/>
	</div>
</div>
<div id="controls" style="margin-bottom: 20px;"></div>
<div><script src='/extras/toothpicks/toothpicks.js' type='text/javascript'></script></div>
<p>The successive toothpick totals form <a href="http://oeis.org/A139250">sequence A139250</a> in Sloane&#8217;s OEIS. The notes accompanying that listing point out lots of interesting facts about the pattern and the process that generates it. If you run the animation, you can&#8217;t help noticing the distinctive behavior as <em>n</em> approaches each integer power of 2, or the repeating pattern in which a square block has a smaller square &#8220;ear&#8221; at each corner. And no toothpick after the initial <del datetime="2013-02-15T11:49:00+00:00">one</del> <ins datetime="2013-02-15T11:49:00+00:00">three</ins> crosses either the <em>x</em> or the <em>y</em> axis. (When the <em>x</em> or <em>y</em> coordinate is a power of 2, toothpicks from opposite sides meet at points along the axis, but they do not cross it.)</p>
<p>The notes also mention a conjecture, which I assume remains open:</p>
<blockquote><p>Conjecture: Consider the rectangles in the sieve (including the squares). The area of each rectangle (A=b*c) and the edges (b and c) are powers of 2, but at least one of the edges (b or c) is &lt;= 2.</p></blockquote>
<p>The rectangles at issue in this conjecture are &#8220;open&#8221; rectangles, with no toothpicks or parts of toothpicks inside of them. I&#8217;ve become curious about more general squares and rectangles, defined as any axis-aligned quadrilateral whose perimeter is traced by an unbroken chain of toothpicks or half-toothpicks, regardless of what&#8217;s in the interior. Here are a few squares discovered in a small sample of the toothpick pattern:</p>
<p><img class="centered" src="http://bit-player.org/wp-content/uploads/2013/02/squares-in-toothpick-graph.png" alt="Squares in toothpick graph" border="0" width="500" height="521" /></p>
<p><img class="marginalia" style="margin-top: 0px;" src="http://bit-player.org/wp-content/uploads/2013/02/matrix-of-rectangles.png" alt="Matrix of rectangles" border="0" width="220" height="227" /></p>
<p>The unit of distance in this compilation is half of a toothpick, since that&#8217;s the smallest square that can possibly appear. I have highlighted squares with side lengths of 1, 2, 3, 4, 6, 7 and 8 units. Is there a square of side length 5? How about 9 and 17? Looking for rectangles more generally rather than just squares, I enlisted the help of <a href="http://casw.org/users/ros">Ros</a>. The black dots in the matrix at right represent all the rectangles we were able to find by hand and eye. (I have not yet written a program to search more systematically.) The red circles at 5-by-5 and 9-by-9 are vacancies that seem particularly intriguing. Do those squares exist anywhere in the toothpick tree? If not, is there some simple argument to explain why?</p>
<hr />
<p><img class="centered" src="http://bit-player.org/wp-content/uploads/2013/02/into-the-sun-1337.jpg" alt="Into the sun 1337" border="0" width="640" height="314" /></p>
<div class="marginalia note" style="margin-top: 0px;">Just between us pedants, I should mention that neither Joshua trees nor toothpick trees are actually trees. The Joshua tree isn&#8217;t woody; the toothpick tree has cycles.</p>
</div>
<p>Joshua trees and toothpick trees, natural trees and mathematical trees: They are very different, but I&#8217;m fond of them both. </p>
<p>A day spent in the desert sun admiring the idiosyncrasies of <em>Yucca brevifolia</em>  feels quite unlike a day spent coding H curves or toothpick trees in JavaScript, or poring over printouts searching for 5-by-5 squares. But I wouldn&#8217;t want to have to choose between those activities. And I&#8217;m particularly pleased when I can make a connection between them, however tenuous and fanciful.</p>
]]></content:encoded>
			<wfw:commentRss>http://bit-player.org/2013/joshua-trees-and-toothpicks/feed</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>100 Years of Markov Chains</title>
		<link>http://bit-player.org/2013/100-years-of-markov-chains</link>
		<comments>http://bit-player.org/2013/100-years-of-markov-chains#comments</comments>
		<pubDate>Sat, 12 Jan 2013 15:58:53 +0000</pubDate>
		<dc:creator>Brian Hayes</dc:creator>
				<category><![CDATA[computing]]></category>
		<category><![CDATA[mathematics]]></category>

		<guid isPermaLink="false">http://bit-player.org/?p=1509</guid>
		<description><![CDATA[On January 23, 1913, the Russian mathematician Andrei Andreyevich Markov addressed the Imperial Academy of Sciences in St. Petersburg, reading a paper titled &#8220;An example of statistical investigation of the text Eugene Onegin concerning the connection of samples in chains.&#8221; &#8230; <a href="http://bit-player.org/2013/100-years-of-markov-chains">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>On January 23, 1913, the Russian mathematician Andrei Andreyevich Markov addressed the Imperial Academy of Sciences in St. Petersburg, reading a paper titled &#8220;An example of statistical investigation of the text <em>Eugene Onegin</em> concerning the connection of samples in chains.&#8221; The idea he introduced that day is the mathematical and computational device we now know as a Markov chain.</p>
<p><img class="centered" src="http://bit-player.org/wp-content/uploads/2013/01/Markov-chain-banner.png" alt="Markov chain banner" border="0" width="634" height="110" /></p>
<p class="indent">On January 23, 2013, the Institute for Applied Computational Science of the Harvard School of Engineering and Applied Sciences will celebrate the centenary of this event. If you are in the Boston area and would like to attend, consider this your invitation. See the <a href="http://computefest.seas.harvard.edu/markov">announcement</a> for details of when and where. There will be three talks:</p>
<p class="biblio"><strong>First Links in the Markov Chain: Poetry and Probability.</strong><br />
Brian Hayes, <em>American Scientist</em> magazine</p>
<p class="biblio"><strong>From Markov to Pearl: Conditional Independence as a Driving Principle<br /> for Probabilistic Modeling.</strong><br /> Ryan P. Adams, SEAS Computer Science</p>
<p class="biblio"><strong>Applications of Markov Chains in Science.</strong><br />
Pavlos Protopapas, Harvard-Smithsonian Center for Astrophysics and SEAS</p>
<p>Markov&#8217;s 1913 paper was not his first publication on &#8220;samples in chains&#8221;; he had written on the same theme as early as 1906. So why celebrate now? Well, for one thing, it&#8217;s too late to do it in 2006. But there is another reason: It was the 1913 paper that was widely noticed, both in Russia and abroad, and that inspired further work in the decades to come. The earlier discussions were abstract and technical, giving no hint of what the new probabilistic method might be good for; in 1913 Markov demonstrated his technique with a novel and intriguing application&#8212;analyzing the lexical structure of Alexander Pushkin&#8217;s poem <em>Eugene Onegin</em>. Direct extensions of that technique now help to identify genes in DNA and generate gobbledygook text for spammers.</p>
<p>Sticklers for calendrical accuracy might raise another question about the timing of this event. On January 23 it will not yet be 100 years since Markov spoke in St. Petersburg. In 1913 Russia had not yet adopted the Gregorian calendar; when the nation did so in 1918, it skipped ahead by 13 days. If you are troubled by this calendrical lacuna, you may want to organize your own symposium on February 5.</p>
<p><strong>Update:</strong> Coverage of Markov Day in the <a href="http://news.harvard.edu/gazette/story/2013/01/an-idea-that-changed-the-world">Harvard Gazette</a>.</p>
<p><strong>Update 2013-02-24</strong>: Recordings of the talk are now available. Audio: <a href="http://media.seas.harvard.edu/content/iacs/13_01_23%20Brian%20Hayes_100%20Yrs%20of%20Markov.mp3?play">MP3</a>. Video: <a href="http://media.seas.harvard.edu/content/iacs/13_01_23%20Brian%20Hayes_100%20Yrs%20of%20Markov.flv?play">FLV</a>, <a href="http://media.seas.harvard.edu/content/iacs/13_01_23%20Brian%20Hayes_100%20Yrs%20of%20Markov.mp4?play">MP4</a>. The slides are also on the web: <a href="http://bit-player.org/wp-content/extras/markov/#/">HTML</a>. Finally, my latest <em>American Scientist</em> column covers much of the same material: <a href="http://www.americanscientist.org/issues/pub/2013/2/first-links-in-the-markov-chain">HTML</a>, <a href="http://www.americanscientist.org/libraries/documents/201321152149545-2013-03Hayes.pdf">PDF</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://bit-player.org/2013/100-years-of-markov-chains/feed</wfw:commentRss>
		<slash:comments>3</slash:comments>
<enclosure url="http://media.seas.harvard.edu/content/iacs/13_01_23%20Brian%20Hayes_100%20Yrs%20of%20Markov.mp3?play" length="0" type="audio/mpeg" />
<enclosure url="http://media.seas.harvard.edu/content/iacs/13_01_23%20Brian%20Hayes_100%20Yrs%20of%20Markov.flv?play" length="0" type="video/x-flv" />
<enclosure url="http://media.seas.harvard.edu/content/iacs/13_01_23%20Brian%20Hayes_100%20Yrs%20of%20Markov.mp4?play" length="0" type="video/mp4" />
		</item>
		<item>
		<title>The Flyover States</title>
		<link>http://bit-player.org/2013/the-flyover-states</link>
		<comments>http://bit-player.org/2013/the-flyover-states#comments</comments>
		<pubDate>Wed, 09 Jan 2013 14:21:32 +0000</pubDate>
		<dc:creator>Brian Hayes</dc:creator>
				<category><![CDATA[photography]]></category>

		<guid isPermaLink="false">http://bit-player.org/?p=1507</guid>
		<description><![CDATA[On a flight from Boston to San Diego yesterday I had a window seat on the shady side. The weather was clear, and over much of the continent a dusting of snow combined with low winter sun angles to highlight &#8230; <a href="http://bit-player.org/2013/the-flyover-states">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p><img class="alignleft" src="http://bit-player.org/wp-content/uploads/2013/01/DSC01047.jpg" alt="contour plowing 01047" border="0" width="900" height="600" /></p>
<p>On a flight from Boston to San Diego yesterday I had a window seat on <a href="http://bit-player.org/2012/on-the-sunny-side">the shady side</a>. The weather was clear, and over much of the continent a dusting of snow combined with low winter sun angles to highlight subtle features of the landscape. It was like flying over a painting&#8212;maybe a Mondrian, maybe something by Chuck Close.</p>
<p>The photo above comes from central Kansas, just west of Manhattan. I don&#8217;t entirely understand what I&#8217;m seeing here. The conspicuous double wavy lines in the fields near the center of the image look like contour plowing, but the scale is all wrong; they are wider than the roads. I think they are either ditches to promote drainage or berms to prevent it. The structures are visible on Google Maps, but there they lack the chiaroscuro effect of snow and sun that gives them such drama here. What accounts for the color differences between fields?</p>
<p><img class="alignleft" src="http://bit-player.org/wp-content/uploads/2013/01/DSC01002.jpg" alt="somewhere over southwest Illinois" border="0" width="640" height="426" /></p>
<p>The image above is from 40 minutes earlier in the flight, over southwestern Illinois. Here the rectilinear grid of midwestern agriculture is a mere overlay on dendritic natural drainage patterns, again with bright highlighting. Apparently the snow has been swept off of flat land and gathered on slopes. The overall effect reminds me of military camouflage.</p>
<p><img class="alignleft" src="http://bit-player.org/wp-content/uploads/2013/01/DSC01054.jpg" alt="center-pivot irrigators" border="0" width="640" height="396" /></p>
<p>Western Kansas or southeastern Colorado: The landscape has gone all dotty with center-pivot irrigators. Always a cheering sight. If we&#8217;re going to turn the country into a checkerboard of quarter-section fields, we might as well put checkers on them. That&#8217;s probably the Cimarron River running through the middle of the frame, but I haven&#8217;t been able to identify the exact spot.</p>
<p><img class="alignleft" src="http://bit-player.org/wp-content/uploads/2013/01/DSC01077.jpg" alt="northern New Mexico" border="0" width="640" height="426" /></p>
<p>Above, more painterly drainage patterns, but this time the paintbrush is entirely in the hands of nature. I believe this is northern New Mexico, not far from Farmington.</p>
<p><img class="marginalia" src="http://bit-player.org/wp-content/uploads/2013/01/DSC01093-220px.jpg" alt="housing developments in Scottsdale, AZ" border="0" width="220" height="246" /></p>
<p class="indent">At right, we&#8217;re back on the grid again&#8212;sort of. Those tiny chiclets packed together so tighly are residential neighborhoods in Scottsdale, Arizona. They can&#8217;t escape the rectilinear pattern defined by the major streets, but inside those squares they do their best to imitate the swirly lanes and cul de sacs of a suburban housing development.</p>
<p>Finally, below, orthagonality reasserts itself with a vengeance in the Imperial Valley in southern California, the desert basin where most of the Colorado River winds up. At the top is the Great Oops called the Salton Sea&#8212;or what&#8217;s left of it.</p>
<p><img class="centered" src="http://bit-player.org/wp-content/uploads/2013/01/DSC01117.jpg" alt="Imperial Valley and Salton Sea" border="0" width="640" height="396" /></p>
]]></content:encoded>
			<wfw:commentRss>http://bit-player.org/2013/the-flyover-states/feed</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
		<item>
		<title>Dante&#8217;s Infernet</title>
		<link>http://bit-player.org/2013/dantes-infernet</link>
		<comments>http://bit-player.org/2013/dantes-infernet#comments</comments>
		<pubDate>Sat, 05 Jan 2013 00:37:15 +0000</pubDate>
		<dc:creator>Brian Hayes</dc:creator>
				<category><![CDATA[computing]]></category>
		<category><![CDATA[meta]]></category>

		<guid isPermaLink="false">http://bit-player.org/?p=1497</guid>
		<description><![CDATA[In a few days bit-player will celebrate its seventh birthday. (The first published post was dated January 9, 2006.) The original design for the web site was thrown together in haste, and I&#8217;ve long been meaning to give it a &#8230; <a href="http://bit-player.org/2013/dantes-infernet">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>In a few days bit-player will celebrate its seventh birthday. (The <a href="http://bit-player.org/2006/introducing">first published post</a> was dated January 9, 2006.) The original design for the web site was thrown together in haste, and I&#8217;ve long been meaning to give it a makeover. I&#8217;ve also had a hankering to get away from a managed hosting service and set up my own server. Over the past six weeks I&#8217;ve finally done both of those things. Here&#8217;s a brief account of the blog&#8217;s rebirth. (If you&#8217;re reading this via the RSS feed, you might want to take a glance at <a href="http://bit-player.org">the web site</a>.)</p>
<p class="marginalia undent" title="Abandon all hope, you who enter here">Lasciate ogne speranza, voi ch&#8217;intrate</p>
<div class="figure-with-caption"><img class="aligncenter" src="http://bit-player.org/wp-content/uploads/2013/01/Dore-Inferno-the-wood-of-suicides-640px.jpg" alt="Dore Inferno the wood of suicides" border="0" width="640" height="503" />
<p class="figure-caption">Gustave Dor&eacute;&#8217;s illustration for Canto 13 of Dante&#8217;s <em>Inferno</em>, where the narrator and his guide Virgil enter the wood of the suicides and spendthrifts. Source: <a href="http://www.wikipaintings.org/en/gustave-dore/the-inferno-canto-13-1">Wikipaintings</a>.</p>
</div>
<p><img class="marginalia" src="http://bit-player.org/wp-content/uploads/2013/01/circles-of-the-infernet.jpg" alt="the circles of the infernet" border="0" width="218" height="327" />After a few weeks of playing sysadmin, I&#8217;ve concluded that the modern world of internet computing is organized just like Dante&#8217;s <em>Inferno</em>, with concentric circles of torment that get progressively deeper and darker as you travel toward the center. </p>
<p>The outer suburbs are not such a bad place to live. The people there speak HTML and CSS and JavaScript, and they amuse themselves by writing cute little programs that display words and pictures on other peoples&#8217; screens. The worst punishment these souls suffer is being made to write <code>&lt;!--[if IE 6]&gt;</code> over and over again all day long. </p>
<p>As you descend into the inner circles of the computational underworld, however, the light fades; you find yourself in a maze of twisty little passages, all alike; in the darkness around you confused voices cry out in strange tongues; d&aelig;mons roam the woods.</p>
<p>In the case of bit-player, what lies immediately below the sunny stratum of HTML-CSS-JavaScript is the WordPress blogging platform. Beneath WordPress is the programming language PHP, which builds complete web pages from fragments of HTML. Next is a MySQL database, which has a programming language of its own. Deeper still, we come to the Apache web server. (I&#8217;ve only recently learned the story behind the name <em>Apache</em>. According to <a href="http://www.computer.org/csdl/mags/co/2012/10/mco2012100008.html">Brian Behlendorf</a>, it&#8217;s a play on &#8220;a patchy server&#8221;; although the <a href="http://www.apache.org/foundation/faq.html#name">Apache Foundation FAQ</a> pooh-poohs this idea, it has the ring of truth.) Under Apache lies the Linux operating system. </p>
<p>The Infernet has still deeper levels, although my Dantean tour didn&#8217;t spend much time at the bottom of the pit. I had to make a brief visit to the land of DNS&#8212;the domain name system&#8212;where the denizens speak knowingly of A records and CNAMEs and such. I never had a need to skate on the frozen lake of TCP/IP.</p>
<div class="figure-with-caption marginalia"><img class="aligncenter" src="http://bit-player.org/wp-content/uploads/2013/01/Newark-Bank-and-Halsey-220px.jpg" alt="Google Maps image of building at Bank and Halsey Streets in Newark NJ, with lots of generators and chillers on the roof" border="0" width="220" height="303"/>
<p class="figure-caption">Maybe my server is here? (This is 165 Halsey Street in Newark, where the rooftop is chockablock with chillers and generators.)</p>
</div>
<p class="indent">If you&#8217;re reading this, then in some sense my crazy project succeeded. I have a shiny new virtual server (from <a href="http://www.linode.com/">Linode</a>) running Linux and Apache and MySQL and PHP and WordPress. It spits out pages that web browsers seem to recognize as valid HTML and CSS and JavaScript. And when you ask the Internet for one of those pages, the series of tubes apparently knows how to find my little server and retrieve what you want. (That&#8217;s more than <em>I</em> can do. The machine is said to be in Newark, NJ, but I have no more specific coordinates.)</p>
<hr />
<p>Now that (most of) the work is done, I&#8217;m happy enough with the outcome. I&#8217;m having fun designing new ways to waste cpu cycles (yours as well as mine&#8212;the program animating the front-page banner runs in your browser, not on my server). As for the deeper levels&#8212;well, I can&#8217;t really say I&#8217;m getting a lot of personal fulfillment out of tweaking settings in <em>/etc/apache2/hpptd.conf</em> and running <em>sudo chmod -r 755</em> on directories, but I suppose these are things that every educated person in the 21st century is supposed to know about.</p>
<p>Next time, though, I may do it differently. Rather than move WordPress to a new server (a body transplant), I&#8217;ll keep the same server and replace WordPress with something else (a head transplant). </p>
<p>I hasten to add that I don&#8217;t blame WordPress for my troubles. It&#8217;s a marvel of our age: Fill in a few blanks, push a few buttons, and <em>Presto!</em> you&#8217;re a publisher. But there&#8217;s a price to be paid for the push-button interface. Simplicity on the surface leads to gnarly complexity inside. In the course of my redesign, I wanted to do a number of things for which WordPress has no built-in push button. I was soon hacking my way through dense thickets of other peoples&#8217; code. </p>
<p>I&#8217;m well aware that such slash-and-burn programming is frowned upon in the WordPress community. (&#8220;Every time you hack core, <a href="http://websynthesis.com/dont-hack-wordpress-core/">God kills a kitten</a>.&#8221;) I could make excuses. I could claim that none of the 1,656 themes offered on the WordPress web site matched my exact needs, and neither did any of the 22,956 plugins. I could argue that my way of doing things is intrinsically better than anything the hundreds (thousands?) of WordPress developers have come up with over the past 10 years.</p>
<p>No, I don&#8217;t believe those things either. </p>
<p>The simple truth is, I&#8217;m an <a href="http://bit-player.org/bph-publications/Sciences-1991-03-Hayes-do-it-yourself.pdf" class="pdf-icon">incorrigible do-it-yourselfer</a>. Call it a character flaw, or a way of life. But I suppose that if I really want to go it alone, I should go all the way, and build the next bit-player from scratch.</p>
]]></content:encoded>
			<wfw:commentRss>http://bit-player.org/2013/dantes-infernet/feed</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>New year, new bit-player</title>
		<link>http://bit-player.org/2013/new-year-new-bit-player</link>
		<comments>http://bit-player.org/2013/new-year-new-bit-player#comments</comments>
		<pubDate>Fri, 04 Jan 2013 03:16:47 +0000</pubDate>
		<dc:creator>Brian Hayes</dc:creator>
				<category><![CDATA[meta]]></category>

		<guid isPermaLink="false">http://bit-player.org/?p=1496</guid>
		<description><![CDATA[New server, new design, new ambitions. It&#8217;s been a big project. More later, when I&#8217;ve slept. In the meantime, feel free to poke around.]]></description>
			<content:encoded><![CDATA[<p>New server, new design, new ambitions. It&#8217;s been a big project. More later, when I&#8217;ve slept. In the meantime, feel free to poke around.</p>
]]></content:encoded>
			<wfw:commentRss>http://bit-player.org/2013/new-year-new-bit-player/feed</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>Powerlessness</title>
		<link>http://bit-player.org/2012/powerlessness</link>
		<comments>http://bit-player.org/2012/powerlessness#comments</comments>
		<pubDate>Tue, 13 Nov 2012 02:59:50 +0000</pubDate>
		<dc:creator>Brian Hayes</dc:creator>
				<category><![CDATA[modern life]]></category>
		<category><![CDATA[technology]]></category>

		<guid isPermaLink="false">http://bit-player.org/?p=1457</guid>
		<description><![CDATA[It&#8217;s been two weeks since the storm called Sandy hit the East Coast, with devastating effects on both people and infrastructure. I have some remarks to make about just one aspect of the damage: the prolonged power outage in parts &#8230; <a href="http://bit-player.org/2012/powerlessness">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>It&#8217;s been two weeks since the storm called Sandy hit the East Coast, with devastating effects on both people and infrastructure. I have some remarks to make about just one aspect of the damage: the prolonged power outage in parts of New Jersey, New York and a few other states. At the nadir, on October 30th, 8.2 million utility customers were without electricity. As of this morning, almost 99 percent of them have finally been reconnected&#8212;but that still leaves 89,000 in the dark, quite a sizeable number under ordinary circumstances.</p>
<p>I am outside the blackout area, but I have been following the story with particular care and interest because my daughter and her family are among those who have been living in pre-Edisonian gloom. She finally had service restored last night, after a wait 13 days.</p>
<p><img class="centered" src="http://bit-player.org/wp-content/uploads/2012/11/outage-stats.png" alt="time of course of power restoration following Sandy" border="0" width="450" height="320" /></p>
<p>The numbers charted above come from the <a href="http://www.oe.netl.doe.gov/emergency_sit_rpt.aspx">U.S. Departmenrt of Energy, Office of Electricity Delivery and Energy Reliability.</a> Note that they tally the number of customers&#8212;or in essence the number of electric meters&#8212;not the number of people. <a href="http://online.wsj.com/article/SB10001424127887324439804578107211399983452.html">Carl Bialik, writing in the <em>Wall Street Journal</em></a>, quotes an estimate by Brian Wolff of the Edison Electric Institute: The peak outage of 8.2 million customers may have represented 60 million people in the dark. Over the two-week period, the outages sum up to about 32 million customer-days.</p>
<p>A few days into the ordeal, when my daughter was seeing no sign of power-company line crews, I offered this optimistic hypothesis: Maybe there&#8217;s a lot of work going on behind the scenes that will allow many thousands of customers to be switched on all at once. In other words, the plot of outage numbers would be concave-downward, with an initial plateau where there&#8217;s little change from day to day, then a steep plunge when all the circuits are finally re-energized. A glance at the actual plot shows that my theory was quite wrong, a product of mere wishful thinking. The shape of the curve is definitely concave-upward. As a matter of fact, over the first nine days, the progress of restoration is modeled fairly well by a simple exponential function: Each day, about 25 percent of the remaining outage victims get their lights back. Thus the number of restorations per day steadily declines. If we suppose that the work crews are putting in constant effort, this pattern of diminishing returns suggests that the work required to restore a single customer doubles every two or three days.</p>
<p>Sandy is the third storm in a little over a year to cause very widespread and persistent power-system disruptions in the Northeast and mid-Atlantic states. Hurricane Irene, in August of 2011, left 6.7 million customers without electricity for about a week. Then, a Halloween-weekend snowstorm knocked out power for 3 million customers, many of whom again had to wait several days for repair crews to show up. (My daughter&#8217;s family was among the unlucky ones in both of those events, too. They&#8217;ve spent roughly one full month out of the last 15 months off the grid.)</p>
<p>It&#8217;s my impression, based on nothing more reliable than personal recollection, that power losses of this scale and duration are a new phenomenon. Until 1996, I don&#8217;t think I ever experienced a power failure of more than 24 hours. What happened in 1996? I was in North Carolina at the time, and Hurricane Fran had me living by candlelight and charcoal grill for a week. It seemed like quite a novelty at the time.</p>
<p>We&#8217;ve certainly seen other large-scale blackouts over the decades. A vast swath of the Northeast went dark in November of 1965. New York City had a particularly traumatic night in 1977. In the summer of 2003 a cascading outage began in Ohio and spread east to the coast and north into Ontario. But these three events differ from the recent storm-associated outages in at least two important ways. First, they didn&#8217;t last as long: Few customers were cut off for as much as 24 hours. Second, the source of the problems was at the &#8220;wholesale&#8221; level of the electric-power grid, with generating plants and high-voltage transmission lines. A single fault in this part of the network can knock out power to millions of people; on the other hand, a single repair can bring it back again. </p>
<p>The power-grid damage caused by Sandy and other recent storms was mainly at the &#8220;retail&#8221; level, with hundreds or thousands of local distribution lines out of commission. Those snagged lines and broken poles have to be fixed one by one. (Sandy brought at least one exception to this &#8220;retail&#8221; pattern: The power failure in lower Manhattan was caused by flooding of a major substation.)</p>
<p class="centered">&bull;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&bull;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&bull;</p>
<p>If it&#8217;s true that storm-damage outages have gotten bigger and more prolonged in the past couple of decades, what might account for the change? I don&#8217;t have an answer, but I have a  bunch of speculative hypotheses to offer. I&#8217;ll let other people shoot these ideas down.</p>
<ul>
<li><em>It&#8217;s the climate, stupid.</em> Intense storms are more frequent than they used to be. The problem is only going to get worse. Get used to it.</li>
<li><em>Sprawl.</em> Look at the hard-hit areas of New Jersey and Long Island, where millions of suburban and exurban residents have been suffering these past two weeks. Until recent years all those acres were farmland, occupied by cows and a few flinty farm families who knew how to light a kerosene lamp. When the power failed out in the sticks, only a few people were directly affected, and the rest of us never heard about it. Now those cow pastures are full of McMansions, whose occupants expect a much higher level of service.</li>
<li><em>Sharpen the axe.</em> When all that rural land was farmed, it was also cleared of trees. In the past 50 years or so, much of the northeast has been reforested at the same time it has been suburbanized. The roadside Norway maples planted circa 1960 are mature now&#8212;ready to fall on the nearest power line. If the power companies want to trim them, homeowners and municipalities won&#8217;t let them.</li>
<li><em>Deregulation, privatization, fragmentation.</em> In the good old days of my youth, the entire electric power industry was regulated by the Federal Power Commission and by state utility commissions. The companies themselves were vertically integrated, handling all aspects of electrical technology from generation to transmission to distribution to retail sales. There was an entrenched engineering culture that valued reliability above all else. After the 1965 blackout, the industry formed regional reliability councils to develop strategies and practices to avoid repetitions of that event. Now, in the post-Enron age, generating electricity, transmitting it and distributing it are economically separate activities. Organizations that were once cooperating divisions of the same parent company have become cut-throat competitors. Regulation has all but disappeared. Maintenance of right of way is seen as a cost and a threat to quarterly earnings, not as a prudent investment. No one corporate entity can be held responsible for keeping the lights on.</li>
<li><em>Shoot the messenger.</em> Most utility poles are owned by electric companies, but the owners also rent out the space beneath the power lines. The main tenants are telephone companies and cable TV. With the proliferation of communication circuits, poles carry more weight than they used to. Perhaps more important, fiber-optic telephone and cable-TV lines are often suspended from a very stout steel cable called a messenger wire. The poles along a suburban road could have two or three of these messenger wires. It used to be that a tree falling onto copper or aluminum wires would just snap them off; the repair was a quick splicing job. Now, the steel messenger wires can hold the weight of a fallen tree, and it&#8217;s the poles that give way. Replacing a snapped pole takes a lot longer than splicing a few wires. (During the Sandy recovery, there were rumors of pole shortages.)</li>
</ul>
<p>Following the big blackouts of 1965, 1977 and 2003, boards of inquiry were formed to root out the causes and suggest remedies. I&#8217;m hoping we see the same kind of thoughtful inquiry this time.</p>
]]></content:encoded>
			<wfw:commentRss>http://bit-player.org/2012/powerlessness/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Fly me to the end of the alphabet</title>
		<link>http://bit-player.org/2012/fly-me-to-the-end-of-the-alphabet</link>
		<comments>http://bit-player.org/2012/fly-me-to-the-end-of-the-alphabet#comments</comments>
		<pubDate>Thu, 08 Nov 2012 18:24:12 +0000</pubDate>
		<dc:creator>Brian Hayes</dc:creator>
				<category><![CDATA[computing]]></category>
		<category><![CDATA[statistics]]></category>
		<category><![CDATA[technology]]></category>

		<guid isPermaLink="false">http://bit-player.org/?p=1447</guid>
		<description><![CDATA[When I got to the Raleigh-Durham airport for a flight home last week, I was confronted with the following list of departures&#8212;almost half of which were actually nondepartures: I wasn&#8217;t surprised by the numerous cancellations and delays (flagged in red). &#8230; <a href="http://bit-player.org/2012/fly-me-to-the-end-of-the-alphabet">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>When I got to the Raleigh-Durham airport for a flight home last week, I was confronted with the following list of departures&#8212;almost half of which were actually <em>non</em>departures:</p>
<p><img class="aligncenter withLoupe" src="http://bit-player.org/wp-content/uploads/2012/11/flight-cancelations-1350px.jpg" alt="departing-flights display at RDU airport, 3:01 pm, October 30, 2012" border="0" width="600" height="385" data-magnified-width="1350px" data-magnified-height="866px"/></p>
<p>I wasn&#8217;t surprised by the numerous cancellations and delays (flagged in red). It was October 30th, a day after Post-Tropical Cyclone Sandy came ashore in New Jersey. But I would not have predicted the alphabetic bias visible in this list, which is sorted by city name. It looks as if the storm spared the early letters of the alphabet and clobbered the later ones. For cities in the alphabetic range from &#8220;Atlanta&#8221; to &#8220;Little Rock,&#8221; all but four of 35 flights were operating normally. For destinations from &#8220;Memphis&#8221; to &#8220;Washington,&#8221; all but three of 31 flights were canceled or delayed. That&#8217;s 11 percent versus 90 percent.</p>
<p>How fluky is this? Perhaps the proper question is: How unlikely is it that four major cities of the mid-Atlantic region would all have end-of-alphabet names: New York, Newark, Philadelphia, Washington? While, conversely, the early-letter cities served by flights from RDU are all elsewhere: Atlanta, Austin, Boston, Charlotte, Chicago, Cincinnati, Dallas, Detroit, Fort Lauderdale, Hartford, Houston, Indianapolis, Little Rock. Or maybe we should be asking why Minneapolis, Montreal and Omaha, though beyond the reach of Sandy, were also red-tag cities that afternoon.</p>
<hr />
<p>I have little to say in answer to the questions above. And, the truth is, this post is not really about aviation or my minor inconveniences in getting home. This post is a test rig for a bit of Javascript that I&#8217;ve been fooling around with for the past few days. The display of flight information above is too small to be readable, but try moving your mouse pointer over the image. (If hovering with the mouse&#8212;or your finger, on touch devices&#8212;does nothing useful, please <a href="mailto:brian@bit-player.org">send me a note</a> or leave a comment.)</p>
<p>Source code <a href="http://bit-player.org/wp-content/uploads/2012/11/loupe.js" title="source code for 'loupe.js'">here</a>. Inspiration from <a href="http://trent.marginallystable.com/code/magnifying-glass-effect-with-jquery/" title="Trent is marginally stable">Trent</a> and <a href="http://www.aplweb.co.uk/blog/js/magnifying-glass/demo.html">aplweb</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://bit-player.org/2012/fly-me-to-the-end-of-the-alphabet/feed</wfw:commentRss>
		<slash:comments>8</slash:comments>
		</item>
		<item>
		<title>On the sunny side</title>
		<link>http://bit-player.org/2012/on-the-sunny-side</link>
		<comments>http://bit-player.org/2012/on-the-sunny-side#comments</comments>
		<pubDate>Sat, 27 Oct 2012 20:41:25 +0000</pubDate>
		<dc:creator>Brian Hayes</dc:creator>
				<category><![CDATA[photography]]></category>

		<guid isPermaLink="false">http://bit-player.org/?p=1433</guid>
		<description><![CDATA[The invented etymology of posh&#8212;which says it&#8217;s an acronym for &#8220;port out, starboard home&#8221;&#8212;is utterly bogus. Nevertheless, when I book airline seats I always try to get a window on the shady side. Photography is easier with the sun at &#8230; <a href="http://bit-player.org/2012/on-the-sunny-side">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>The invented etymology of posh&#8212;which says it&#8217;s an acronym for &#8220;port out, starboard home&#8221;&#8212;is utterly bogus. Nevertheless, when I book airline seats I always try to get a window on the shady side. Photography is easier with the sun at your back. This morning, however, I was on the sunny side southbound out of Boston. The photographic result was fairly curious.</p>
<p><img class="centered" src="http://bit-player.org/wp-content/uploads/2012/10/wakes-450.jpg" alt="boat wakes in strong sunlight, Elizabeth Islands, MA" border="0" width="450" height="412" /></p>
<p>You might think you&#8217;re looking at a snowy landscape here, with bits of two lakes intruding into the left and right edges of the frame. But the lakes are actually islands, and the white field between them is the sea, with the specular reflection of the sun in the upper lefthand corner. Under these lighting conditions, it seems that small variations in angle or texture cause huge differences in brightness. It&#8217;s Snell&#8217;s Law in action.</p>
<p>A detail from a second frame&#8212;two was all I caught&#8212;shows the interference patterns in the boat wakes even more clearly.</p>
<p><img class="centered" src="http://bit-player.org/wp-content/uploads/2012/10/wakes-0815-450.jpg" alt="closeup of boat wakes and wave interference" border="0" width="450" height="366" /></p>
<p>Here is the uncropped and unenhanced version of the first image. (Uncropped but with grossly reduced pixel count.)</p>
<p><img class="centered withLoupe" src="http://bit-player.org/wp-content/uploads/2012/10/wakes-0814-900.jpg" alt="Wakes 0814 900" border="0" width="600" height="450" /> </p>
<p>The two islands are part of an archipelago that extends southwest from Woods Hole on Cape Cod, between the mainland and Martha&#8217;s Vineyard. I believe these two are Pasque Island on the left and Nashawena Island on the right. <a href="http://en.wikipedia.org/wiki/Elizabeth_Islands">Wikipedia tells me</a> that almost all of these islands, which are known as the Elizabeths, are owned by the Forbes family. How posh!</p>
]]></content:encoded>
			<wfw:commentRss>http://bit-player.org/2012/on-the-sunny-side/feed</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
	</channel>
</rss>
