Archive for the ‘mathematics’ Category

Math, fonts, and HTML

Monday, February 16th, 2009

In the latest issue of American Scientist I write about the awkward and ugly business of trying to present mathematical typography on the web. All the while I was writing the column, I had constantly in mind the uncomfortable knowledge that the column itself—with all of its examples of equations and arcane symbols—would have to be prepared for presentation in HTML. The conversion went more smoothly than I expected, thanks to the energy and expertise of Anna Lena Phillips. Nevertheless, I recommend reading the PDF version.

One issue that arises in this story goes beyond the particular problems of making mathematical notation intelligible. Why is it that a web page can’t include the fonts that are needed to display the text properly? It’s routine for web documents to incorporate images and audio and video and various kinds of code that affect the display of information—CSS, JavaScript, etc. When it comes to fonts, however, the web server is not empowered to supply what’s needed; instead, it has to play a silly guessing game with the client computer. “Do you have ‘Times New Roman’?” the server asks. “No, well how about ‘Times’? ‘Georgia’? Okay, give me anything with serifs, please.” It would be easier for both parties if the server could just package up a font and send it along—or so it seems to me.

This is not a new idea. Most of the recent discussion of embedable or linkable fonts focuses on legal impediments, which seem quite manageable to me (though of course I’m not a lawyer, nor am I an owner of typeface copyrights). Are there other reasons to back away from such a proposal? The bandwidth required seems moderate by present-day standards, and there are obvious schemes for avoiding waste by sending only glyphs that are actually needed in a document and not already present on the client computer. Publishers and advertisers would doubtless abuse the facility with garish attempts to attract attention, but we survived the <marquee> and <blink> tags back in the nineties, and an attack of circus-poster typefaces seems no more obnoxious. Am I missing something obvious?

jsMath

Sunday, December 28th, 2008

A famous equation:

$$\nabla\times\mathbf{E}=-\frac{\partial\mathbf{B}}{\partial{t}}$$

Imagine that—mathematics on the Web!

Double-click for the LaTeX source. There’s more info in the tiny box you ought to find in the lower right hand corner of your browser window.

I’ll have more to say about all this in a few days.

Zimaths

Tuesday, December 16th, 2008

A friend pointed me to Zimaths, a magazine for high school mathematics students, published in Zimbabwe in happier times. (The last issue available online is from 2005. The next-to-the-last issue has a helpful tutorial on inflation, which was then running at about 600 percent per year in Zimbabwe. The rate has gone up considerably since then, and lately the country has had even worse troubles.)

Looking back to the first issue of Zimaths, from October of 1996, I happened upon a list of problems from the Zimbabwe Maths Olympiad of that year. Problem 5 looked like something I might be able to do in my head:

The number a is randomly selected from the set {0, 1, 2, 3, …, 98, 99}. The number b is selected from the same set. What is the probabilty that the number 3a + 7b has a units digit equal to 8?

Clearly, all positive integer powers of 3 and 7 are odd numbers not divisible by 5, and so they must end in 1, 3, 7 or 9. Running through the first few of those powers (1, 3, 9, 27, …; 1, 7, 49, 343, …) suggested that all possible terminal digits appear with equal probability. The sum of two such odd numbers must be an even number. It seemed like a good bet that all even terminal digits would be equally likely—that is, each of 0, 2, 4, 6 and 8 would appear with probability 1/5. I checked this hypothesis by listing all possible pairs of the four allowed odd digits (with addition done modulo 10):

1 + 1 = 2
1 + 3 = 4
1 + 7 = 8
1 + 9 = 0
3 + 3 = 6
3 + 7 = 0
3 + 9 = 2
7 + 7 = 4
7 + 9 = 6
9 + 9 = 8

Sure enough, in this list of 10 combinations each even digit appears twice, confirming that the probability of seeing an 8 should be 0.2. If I had been competing in the Olympiad, I would have written down that answer and gone on to the next problem without a further thought.

Later in the day, though, I was looking for something I could use to test a new toy—the latest version of Mathematica. Here’s what I came up with:

f[] := Mod[3^RandomInteger[{0, 99}]
         + 7^RandomInteger[{0, 99}], 10]
BarChart[Part[#,2]&
    /@ Sort[Tally[Table[f[], {100000}]]]]

This generates 100,000 values of 3a + 7b mod 10 and tallies them up:

Zisums.png

So I’ve discovered a bug in Mathematica, right? I know there’s nothing wrong with my program, and as for a mistake in my thinking—well, that’s just unthinkable.

Update: Thank you, commenters.

Svat’s question — “How do you think that error could have been avoided?” — goes right to the heart of the matter, but I need to start with a prior question: “How do I know which of my answers is the erroneous one?” When a computer program and my own reasoning yield different results, how should I resolve the conflict? Where should I look first for a mistake?

I don’t expect to find a universal and eternal answer to this question. On the contrary, everything depends on one’s personal equation. Some of us are better at analytical thinking and some of us are bit-players. Nevertheless, in this case I think it’s pretty clear that the computer calculation relies on fewer and simpler assumptions. It asks us to trust the random number generator and certain arithmetic operations, but if we grant that the implementation of those functions is correct, the program can hardly go wrong. Its structure follows directly from the problem statement. (Of course there’s also statistical uncertainty, but if we’re patient enough, we can reduce that to any level we please.)

The probability analysis depends crucially — as I discovered to my chagrin — on properly counting all the cases. My mistake was a very elementary one; I suspect it is also a very common one. It was when I saw the empirical results, with probability values clustered near 3/16, that I realized I should be looking at 16 cases rather than 10.

The point I want to make here isn’t about mathematical truths but about the art of problem solving — even when, as in this case, there’s no artistry involved. Barry’s variation on the problem (see the comments) offers me another sterling opportunity to make a fool of myself. So I present below, in first-person present-tense stream-of-consciousness diary style, a record of my wary engagement with that problem.

  • First, why the shift from {0..99} to {1..100}? Because including zeroth powers would contaminate each term in the sum with a 1. For example, 2n mod 10 is {2, 4, 6, 8} for n={1..100}, but for n={0..99} there’s a 1 percent chance of turning up a 1. That would make the sum much messier.
  • 1n and 5n are easy. After a further moment’s thought: So is 6n. So every sum will include a term equal to (1 + 5 + 6) mod 10, or in other words 2.
  • 4n is {4, 6} and 9n is {1, 9}. We can combine them — but carefully, now, let’s not make the same mistake again — to produce a single term of {3, 5, 5, 7}.
  • We already know that 3n and 7n both yield {1, 3, 7, 9}. And 2n and 8n generate {2, 4, 6, 8}. Therefore the whole sum is
    {2}1 + {3, 5, 5, 7}1 + {1, 3, 7, 9}2 + {2, 4, 6, 8}2,

    where the superscripts indicate the number of elements we are to choose (independently at random with replacement) from each of these sets. (Not sets, really. Bags.)

  • Parity: There are an odd number of odd terms, so the sum will be odd.
  • Is there some cute number-theoretical trick that’s going to make this easy? I don’t see it.
  • Stuck. Back to the computer to do it the unclever way:

    g[]:=Mod[Sum[i^RandomInteger[{1,100}],{i,1,9}],10]

    Tallying 100,000 repetitions of this function produces the following result:

    barrysums.png

    Repeating the computation a few times more suggests that the slight excess of 7s is not statistical noise. So now I think I know the answer, but I don’t know where it came from.

  • Back to the probability calculation. The 4 × 4 sum matrix for the original problem was easy (once I knew what to do with it). This one is 1 × 4 × 4 × 4 × 4 × 4. There must be a shortcut; that’s too much to do with pencil and paper.
  • [After a break.] Aha: The sum matrix for {2, 4, 6, 8}2 is exactly the same as the matrix for {1, 3, 7, 9}2 (after permuting some columns and rows). Thus the sum can be expressed as:

    {2}1 + {3, 5, 5, 7}1 + {1, 3, 7, 9}4.

    However, this still looks like a 4 × 256 matrix, which exceeds my patience.

  • Back to the computer again, this time to do all those little sums. What I want is something along the lines of:

    Outer[PlusMod, {1, 3, 7, 9}, {1, 3, 7, 9}],

    where Outer is like a cross product; but instead of multiplying it applies the PlusMod procedure, which I define to do addition modulo 10. The result returned by the expression above is the answer to the original Zimbabwe Olympiad problem:

    {{2, 4, 8, 0},
     {4, 6, 0, 2},
     {8, 0, 4, 6},
     {0, 2, 6, 8}}
    

    For Barry’s more-elaborate variation the full program (without shortcuts) is:

    Sort[Tally[Flatten[
      Outer[PlusMod, {1}, {2, 4, 6, 8}, {1, 3, 7, 9},
         {4, 6}, {5}, {6}, {1, 3, 7, 9},
         {2, 4, 6, 8}, {1, 9}]]]]
    

    The Outer[] expression yields 1,024 values, which are then tallied up. The returned value is:

    {{1, 204}, {3, 204}, {5, 205}, {7, 206}, {9, 205}}

    This appears to be our answer. Barry asked about the frequency of the digit 5: It is 205/1024. The 7 digit is most common by a slight edge, at 206/1024.

  • Going back to the simulation program and running 1,024 × 100,000 iterations to get better statistics yields this result (about an hour later):
    {{1, 20400852},
     {3, 20396224},
     {5, 20501004},
     {7, 20601096},
     {9, 20500824}}
  • In the end I still wonder if there’s an easier way. Barry?

Cows, Colleges and Contentment

Friday, November 7th, 2008

It must be something in the milk. For expository writers who specialize in mathematical subject matter, there’s a strange attractor in Northfield, Minnesota. That’s where Lynn Arthur Steen and his colleagues produced “telegraphic reviews” of mathematical writing for many years. Math Horizons, the student math magazine published by the MAA, was edited there for a while by Steve Kennedy and Deanna Haunsperger. Barry Cipra lives there. And I used to live there too.

I’ll be making a pilgrimage back to my old hometown next week. Thanks to the generosity of Paul Zorn and the hospitality of Barry Cipra, I’ll be giving a talk at St. Olaf College Tuesday afternoon. Details here. And Rosalind Reid and I will be meeting with Mary Steen’s class of potential future math scribes.

The Chromatic Number of Liechtenstein

Tuesday, October 28th, 2008

Four colors suffice for any planar map: We’ve known that since 1977. If a map is divided into countries or provinces or other regions, and you want to color the map so that no two adjacent regions have the same color, you’ll never need more than four crayons. But there are a couple of definitions that have to be accepted if this theorem is to hold. First, “adjacent” means that two regions share a boundary segment, not merely a point or a discontinuous set of points. Second, a “region” has to be a connected area, so that you can reach any point in the interior from any other such point without crossing a boundary.

A few days ago the strange and wonderful Strange Maps blog called attention to this map of the Principality of Liechtenstein:

382px-Liechtenstein-admin.png

(The map comes from the Wikimedia Commons Atlas of Liechtenstein, which has a larger image.)

It seems that Liechtenstein is divided into 11 communes, which emphatically do not satisfy the connectivity requirement of the four color map theorem. Just four of the communes consist of a single connected area (Ruggell, Schellenberg and Mauren in the north, and Triesen in the south). All the rest of the communes have enclaves and/or exclaves. (I confess that I didn’t know the distinction between these words until yesterday. They make a nice pair.) The most fragmented commune is Vaduz, which includes the principality’s capital. Vaduz consists of six isolated pieces; the smallest is a sliver about a kilometer northeast of the town of Planken.

In the map above, each commune is assigned its own color, and so we have an 11-coloring. It’s easy to see we could make do with fewer colors, but how many fewer? I have found a five-clique within the map; that is, there are five communes that all share a segment of border with one another. It follows that a four-coloring is impossible. Is there a five-coloring? What is the chromatic number of Liechtenstein?

Demaine event

Thursday, October 16th, 2008

“Between The Folds” uncovers the stories of ten fine artists and intrepid theoretical scientists who abandoned careers and scoffed at hard-earned graduate degrees—all to forge unconventional lives as modern-day paperfolders.

Perhaps such a film should be kept from impressionable youth, lest more degree-scoffers be lost to a life in the creases. Nevertheless, the one-hour documentary, written and directed by Vanessa Gould, is showing online this weekend, today through Sunday only, in connection with the Hamptons International Film Festival. Several of the featured folders come from the world of science and math: Robert Lang, Tom Hull, Erik Demaine, and Erik’s father Martin Demaine.

ErikDemaine1877.jpg

If you’d like still more cinematic experience of Erik Demaine, his recent talk at the opening symposium for the Microsoft New England research center is now online, where he performs magic tricks as well as showing off origami. (But the video is in a Windows-only format—what’s with that?)

At right Erik makes a hand-waving argument while blindfolded.

Thanks to Barry and Ros for tips on these items.

An amiable companion

Thursday, September 25th, 2008

GowersCompanionCover.gif

The mail has brought me an early copy of The Princeton Companion to Mathematics, a 1,034-page compendium edited by Timothy Gowers (as well as June Barrow-Green and Imre Leader, associate editors), with contributions from more than 130 other authors. I’ve only just begun to browse through its pages, but already I’m completely charmed. This is one of those books that makes you wish you had a desert island to be marooned on.

In the preface, Gowers is at pains to establish that his book is a companion, not an encyclopedia. What that means, in part, is that authors are allowed to exhibit attitude and personality. Gowers wastes no time in doing so himself. The preface begins by citing a definition of “pure mathematics” written by Bertrand Russell in 1903:

Pure Mathematics is the class of all propositions of the form “p implies q,” where p and q are propositions containing one or more variables, the same in the two propositions, and neither p nor q contains any constants except logical constants….

Russell is allowed to go on in this vein for another eight lines, and then Gowers remarks: “The Princeton Companion to Mathematics could be said to be about everything that Russell’s definition leaves out.”

Since I haven’t yet read more than 5 percent of the book, I’m in no position to review it here, but I think I can say a little more about the nature of what’s in it. Two big sections are essentially reference material: 99 short articles on mathematical concepts (arranged alphabetically) and 96 biographies of mathematicians (arranged chronologically, excluding living persons; the median birthdate is 1822). A third section gives brief accounts of 35 “theorems and problems,” many of them either open or recently solved (the Riemann hypothesis, the Mordell conjecture, Fermat’s Last Theorem) but also including a few classics (the three-body problem, the insolubility of the quintic).

Lots of good stuff in all of those sections, but not a lot of surprises. What I’m really warming up to are the parts of the book where authors are given freer rein to follow their own particular instincts or obsessions and where they express more distinctively personal views.

Gowers himself wrote a 76-page introduction that undertakes to explain what mathematics is all about, not only as a body of knowledge but also as a cultural phenomenon and as a way of thinking about the world. (The last section of the chapter is titled “What do you find in a mathematical paper?” At one point, Gowers begins to sound a little like Russell: “The object of a typical paper is to establish mathematical statements.”)

Seven more essays take another stab at introducing mathematics, this time working from a historical perspective. For the most part the sequence of topics follows an uncontroversial trajectory through the past two millennia: numbers, geometry, algebra, analysis, proof. But the editors have also decided to put algorithms on an equal footing with these subjects, a choice that would have been unlikely 50 years ago. On the other hand, the historical progression culminates in “The Crisis in the Foundation of Mathematics.” The crisis in question is that of the intuitionist rebellion and Gödel’s incompleteness results, events of the 1920s and 30s. It’s rather like a political history of the world that ends with the conflict between communism and fascism. But I suppose that the rest of the book could be taken as an effort to fill in the record of what’s happened since then.

The best bits of all come at the end of this weighty volume. Although the Companion claims to focus on “pure” mathematics, 14 chapters on “The Influence of Mathematics” show a definite leaning toward applications. We get views of mathematics in chemistry, biology, economics, statistics, music and art. And there are a few more narrowly focused essays, on topics such as wavelets, traffic and cryptography.

The book’s last section, titled “Final Perspectives,” is where I would recommend beginning. Here are the contents:

  • The Art of Problem Solving, by A. Gardiner.
  • “Why Mathematics?” You Might Ask, by Michael Harris.
  • The Ubiquity of Mathematics, by T. W. Körner.
  • Numeracy, by Eleanor Robson.
  • Mathematics: An Experimental Science, by Herbert S. Wilf.
  • Advice to a Young Mathematician, with contributions from Sir Michael Atiyah, Béla Bollobás, Alain Connes, Dusa McDuff and Peter Sarnak.
  • A Chronology of Mathematical Events, by Adrian Rice.

Details: Princeton University Press. ISBN: 978-0-691-11880-2. Price: $99. The book’s web page has PDFs of a few chapters, as well as an interview with Gowers. Gowers also has a blog with a few entries pertaining to the book.

arXival mysteries

Wednesday, July 2nd, 2008

Catching up on new submissions to the arXiv, I came across a paper by Robert Baillie, “Summing the Curious Series of Kempner and Irwin,” which is item 0806.4410 in the mathematics listings. Here’s the abstract, exactly as it appears at http://lanl.arxiv.org/abs/0806.4410v1:

In 1914, Kempner proved that the series 1/1 + 1/2 + … + 1/8 + 1/10 + 1/11 +… + 1/18 + 1/20 + 1/21 + …, where the denominators are the positive integers that do not contain the digit 9, converges to a sum less than 90. (The actual sum is about 22.92068.) In 1916, Irwin proved that the sum of 1/n where n has at most a finite number of 9’s is also a convergent series. We show how to compute sums of Irwins’ series to high precision. For example, the sum of the series 1/9 + 1/19 + 1/29 + 1/39+ 1/49 + … where the denominators have exactly one 9, is about 23.04428708074784831968. Note that this is larger than the sum of Kempner’s “no 9″ series. We also show how to construct nontrivial subseries of the harmonic series that have arbitrarily large, but computable, sums. For example, the sum of 1/n where n has at most 434 occurrences of the digit 0 is about 10016.32364577640186109739.

Baillie’s article is full of really interesting mathematics and algorithmics, which ought to be reason enough to mention the paper here. But it was something stranger that caught my attention. Look closely at the large number in the last line of the abstract. The HTML source of the arXiv page looks like this:

  1<a href="abs/0016.3236">0016.3236</a>4577640186109739.

It seems the sequence 0016.3236, embedded in a larger string of digits, has been interpreted as an arXiv identifier. I can only guess that some program at arXiv.org is scanning abstracts looking for strings of the form nnnn.nnnn, where n is any decimal digit. It’s a little like those rogue search-and-replace scripts that do amusing things like turning every “gay” into a “homosexual.”

As it happens, there is no arXiv paper with the identifier 0016.3236. There can’t be because the identifier format is actually yymm.nnnn, encoding the year and month of submission in the first four digits. Obviously there is no month 16, and the identifier scheme had not yet been introduced in the year 00. Thus, as far as I know, the competition is still open for the first perfectly self-referential arXiv preprint—one that finds a legitimate reason to embed its own identifier in its abstract. (Part of the challenge is that you can’t know in advance—at least not with high precision—what number will be assigned to a paper when it is submitted.)

[More on the Kempner series: Baillie and Thomas Schmelzer also have an article on related work in the latest American Mathematical Monthly. The article is available (pdf) from Schmelzer's web site.]

Update 2008-09-07: Because this post makes fun of programs that automatically scan and “fix” text, it inevitably suffers that very fate. Although the long quotation above was pasted into my editor window exactly as it appeared in the original arXiv abstract, that’s not how the quotation will arrive on your screen. If you try to follow the link embedded in that long number, you’ll find that the address is not “abs/0016.3236″ but “bit-player.org/2008/abs/0016.3236″. Somewhere in the WordPress software is a routine that “corrects” any URL lacking a top-level domain. I have resisted the urge to correct the correction. I note that arXiv is following the same policy: The latest version of the Baillie abstract (posted 17 August) still includes the curious embedded link.

Update 2009-07-31: In the 2008-09-07 update I unjustly impugned WordPress. It is not WordPress that is munging the URL; it is my very own browser (and probably yours too). A URL without a fully qualified domain name is interpreted by the browser as a link relative to the current site. Viewing the page source shows that the “abs/0016.3236″ is not changed within the HTML. Many thanks to Keith Beckman for setting me straight on this.

Unnatural logarithms

Sunday, June 1st, 2008

I have a longstanding friendly feud with my Editor-in-Chief over the use of logarithmic scales in graphs. I tend to go for a log plot if there’s the slightest hint of an exponential trend in the data; she argues that the human sense of numbers is inherently linear, and thus a nonlinear scale should be used only in exceptional circumstances. Linear is natural, she says; logs are for geeks.

numberline.pngVindication is always sweet, so I was delighted to see a report in the latest issue of Science (subscription needed for full-text access) suggesting that members of an Amazonian indigenous group seem to order numbers on a logarithmic scale. Stanislas Dehaene, Véronique Izard, Elizabeth Spelke and Pierre Pica worked with 33 adults and children of the Mundurucu group in Brazil’s Para province. The subjects were shown a line segment with labeled end points (illustration above) and asked to place various other numbers within this interval. The numbers were presented as patterns of dots, as sequences of tones or as spoken number words in the Mundurucu language or in Portuguese. The results of the experiment show, according to Dehaene et al.:

The Mundurucu seem to hold intuitions of numbers as a log scale where the middle of the interval 1 through 10 is 3 or 4, not 5 or 6.

In contrast, 16 American control subjects from the Boston area placed numbers on the scale pretty much in proportion to their magnitude.

resultgraphs.png

For the sake of my ongoing quibble with the E-in-C, it’s in my interest to support and endorse this finding. I wish could do so.

logcurves2.pngExactly what does it mean to “hold intuitions of numbers as a log scale”? Simply taking base-10 logarithms of numbers isn’t quite what’s wanted. The logarithm function maps the integers 1 through 10 onto a range from 0 to 1. To map numbers in the domain [1, 10] onto the same co-domain “logarithmically,” we need a transformation along the lines of R = (9 log10 S) + 1, where R is the “response location” and S is the “stimulus number.” But the resulting curve, superimposed in red on the graph above, doesn’t match the experimental data very well at all. And, looking at the data more closely, it’s hard to see how any plausible transformation is going to account for the positions of those dots and error bars. There’s trouble in the middle, where 5 was judged larger than 6. And there’s trouble at both ends: No matter where you place the numbers 2 through 9 on the scale, shouldn’t 1=1 and 10=10? The anomalies at the ends are made more puzzling by the instructions given to the test subjects:

Only two training trials were presented, with sets of dots whose numerosity corresponded to the ends of the scale (1 and 10). The participants were told that these two stimuli belonged to their respective ends, but that other stimuli could be placed at any location.

In view of these instructions, it seems peculiar that stimulus number 1 has a response location near 1.5, and stimulus number 10 corresponds to a response location of roughly 8.

I wonder if the data aren’t better explained by a simple step function. Perhaps the subjects counted dots up to 4, but beyond that merely estimated the number of spots, lumping together any stimulus with 5, 6 or 7 dots in one class, and putting patterns of 8, 9 or 10 spots in a second class.

Or maybe the arrangement is logarithmic after all. The Mundurucu may have a lot more mathematical sophistication than Dehaene et al. give them credit for. When presented with a scale that runs from 1 to 10, rather than 0 to 10, they intuit that the interval belongs to the series …, 0.01, 0.1, 1, 10, 100,…, rather than the more prosaic series …, –10, 0, 10, 20, 30, …. Anyway, I think that’s what I’ll tell my Editor-in-Chief.

The problem of describing trees

Wednesday, April 30th, 2008

When I finished writing about the Zeno wagering game recently, I had some trees left over, so I thought I would try planting them here.

In the Zeno article I was trying to understand and explain the structure of this peculiar-looking tree, which I’ll call the tangled tree:

zenotree.jpg

As a warmup exercise, I started out with this simpler example, the combed tree:

binarytree.jpg

These are both binary trees: Each node has exactly two descendants. And the trees also share a basic internal symmetry. In both structures, if a node has horizontal coordinate x, the two descendant nodes are symmetrically arrayed at x-d and x+d. The difference between the two trees is all in how the displacement distance d is calculated. In the combed tree, d has the initial value 1/4 at the root node, and it is reduced by half at each lower level of the tree. In the tangled tree, the formula is d = 1/2 min(x, 1-x). In other words, d is half the distance to the nearer boundary of the interval [0,1].

There was a third tree I didn’t have room to include in the article. I had stumbled upon it when I made a programming error. This rogue structure looks like this, and I’m calling it the braided tree:

crosstree.jpg

The nature of my programming error is not hard to see. Intending to generate the tangled tree, I had meant to calculate the positions of the child nodes as follows:

      left = x - 1/2 min(x, 1 - x)
      right = x + 1/2 min(x, 1 - x)

But instead I carelessly wrote:

      left = x - 1/2 x
      right = x + 1/2 (1 - x)

Stupid goof, but the result is visually intriguing. And although the braided tree is a botched version of the tangled tree, it actually has a lot in common with the combed tree. In particular, both the combed and the braided trees have exactly the same set of nodes; the difference is that those nodes are wired differently.

One way to understand the difference is to look at the paths leading from the root to any given node. Each such path is a sequence of left and right turns. For example, in the combed tree you can get from the root to the node at x = 3/16 by turning left at the root, then left again at 1/4 and finally right at 1/8. In the braided tree the path to 3/16 goes right to 3/4 then left to 3/8 and left to 3/16. Paths of this kind can be encoded as binary numerals, letting a 0 stand for each left turn and a 1 for each right turn. In this scheme the two paths described above are 001 and 100.

In essence, the braided tree is a permutation of the combed tree. If you list all the nodes at some fixed level in the combed tree (say those three levels below the root, where all denominators are 16), then the corresponding paths are in numerical order:

    1/16    000    (0)
    3/16    001    (1)
    5/16    010    (2)
    7/16    011    (3)
    9/16    100    (4)
   11/16    101    (5)
   13/16    110    (6)
   15/16    111    (7)

Here’s the corresponding tabulation for the braided tree:

    1/16    000    (0)
    3/16    100    (4)
    5/16    010    (2)
    7/16    110    (6)
    9/16    001    (1)
   11/16    101    (5)
   13/16    011    (3)
   15/16    111    (7)

The order is “counting from the left,” incrementing the most significant bit first. I wonder what other permutations give interesting-looking trees.

Turning back to the tangled tree that began this whole investigation, I would argue that it looks tangled and unruly not so much because lots of edges cross (there are even more crossings in the braided tree) but because of many near collisions and coincidences. For example, just below the root of the tangled tree, the mirror-image paths <left-right-right> and <right-left-left> almost converge on the same value, but they miss by just a bit. We can fix this! All it takes is an adjustment in the formula for the displacement d. In the tangled tree that displacement is 1/2 min(x, 1-x). The constant 1/2 in this expression is quite arbitrary, and we can substitute any other value a, with 0 < a < 1.

So what is the magic value of a in the following tree, which I am inclined to call the crocheted tree?

phitree.jpg

Note: If the title of this post fails to ring a bell, see the poem by Robert Hass:

The gene pool threw up a wobbly stem
And the tree danced. No.
The tree capitalized.
No. There are limits to saying,
In language, what the tree did.