Video 4, chapter 10

The Dragon Curve, Folding a Path

How folding a strip in half again and again gives the Heighway dragon, why its turn sequence, the paperfolding sequence, grows by a reversed and exchanged copy, and how the paths approach the dragon curve.

  • Video 4, chapter 10
  • Measuring the unfamiliar

Fold a strip of paper in half, fold the folded strip in half the same way, and keep going. When you open it out and set every crease at a right angle, the edge of the strip traces a path of short segments, and after a few folds the path curls into a shape called the dragon curve. Which way does each corner turn, and can the turns be predicted without folding any paper? This page writes the turns as a sequence of letters, explains the rule that builds each stage from the one before, and shows how the paths settle down to a limiting curve.

Key terms

Heighway dragon

Definition The Heighway dragon comes from a folding rule. Lay a long strip of paper flat and fold it in half by lifting its right end over onto its left end. Fold the folded strip in half in exactly the same way, and repeat until it has been folded nn times, where n≥1n \ge 1. Then unfold it, open every crease to a right angle and stand the strip on its long edge. Seen from above, the strip is a path of 2n2^n equal segments joined by 2n−12^n - 1 right-angle turns. As seen from the side of the strip that faced up at the start, each crease is a valley or a mountain, and the strip bends toward that side at every valley and away from it at every mountain. Travel along the path from the left end, which never moved, with the side that faced up at the start turned toward the right of the direction of travel. Then every valley is a right turn, written R, and every mountain is a left turn, written L. Standing the strip with that side turned to the left instead exchanges every R and L and draws the mirror image of the path, which is just as correct, and reading from the other end draws the same path traveled backward. The surprise is that the turns follow a short rule, so no folding is needed. Write SnS_n for the list of turns after nn folds. The first list S1S_1 is the single letter R, and for every n≥1n \ge 1

Sn+1=Sn R Sn~,S_{n+1} = S_n \, \text{R} \, \widetilde{S_n},

where Sn~\widetilde{S_n} means SnS_n read backward with every R changed to L and every L changed to R. As nn grows, the paths, shrunk to a common size, approach a limiting curve, which is also called the Heighway dragon or simply the dragon curve. It is named after John Heighway, one of the physicists who studied it in the 1960s.

In plain words Each fold doubles the number of segments, and the new list of turns can be written down from the old list alone. Copy the old list, put one R after it, and then add the old list again, backward and with left and right swapped.

Example Start from S1=RS_1 = \text{R}. Read backward, the single letter R is still R, and swapped it becomes L, so S2S_2 is RRL. Read backward, RRL is LRR, and swapped it is RLL, so

S3=RRL R RLL=RRLRRLL.\begin{aligned} S_3 &= \text{RRL} \, \text{R} \, \text{RLL} \\[0.4em] &= \text{RRLRRLL}. \end{aligned}

These are the 7 creases of a strip folded three times, valley, valley, mountain, valley, valley, mountain and mountain from the left end. Draw the path with segments of length 1, starting at the point (0,0)(0, 0) along the positive xx direction, where R is a quarter turn clockwise. Its corners, in order, are (0,0)(0, 0), (1,0)(1, 0), (1,−1)(1, -1), (0,−1)(0, -1), (0,−2)(0, -2), (−1,−2)(-1, -2), (−1,−1)(-1, -1), (−2,−1)(-2, -1) and (−2,−2)(-2, -2). The counts double with every fold, and there is always one turn fewer than segments.

Folds nn1234
Segments24816
Turns13715

A real strip gets twice as thick with every fold and soon cannot be folded again, so the larger stages are always drawn from the rule.

Turn sequence

Definition A turn sequence describes a path made of segments of equal length in which every corner is a right angle. It lists the corners in the order the path meets them, writing R when the direction of travel turns a quarter turn clockwise and L when it turns a quarter turn counterclockwise. A path of mm segments has m−1m - 1 turns. Once the first segment is drawn, the turn sequence fixes the rest of the path, so two paths with the same turn sequence differ only by a shift, a rotation and a change of segment length. Traveling a path from its other end lists its turns in reverse order with R and L exchanged, because a corner that turns clockwise on the way out turns counterclockwise on the way back. Reflecting a path in a mirror exchanges R and L without changing the order.

In plain words A turn sequence is the list of instructions a walker on a grid follows, turn right or turn left at each corner. Walking the same route back means reading the list from the end and swapping every left and right.

Example The path RRL from (0,0)(0, 0) ends at (0,−2)(0, -2). Walked back from (0,−2)(0, -2), it heads up to (0,−1)(0, -1), turns right to (1,−1)(1, -1), turns left to (1,0)(1, 0) and turns left to (0,0)(0, 0), so its turn sequence is RLL, which is RRL read backward with the letters swapped. This is exactly why the folding rule works. After the first fold, the two halves of the strip lie on top of each other and receive every later fold together. So when all the other creases are opened, the second half lies along the first half, doubled back at the middle crease. That crease was made by the first fold, so it is a valley and gives the R in the middle. Opening it swings the second half a quarter turn about the middle point. Read from the middle outward, the second half retraces the first half from its end back to its start, so its turns are those of SnS_n read backward with R and L exchanged.

Paperfolding sequence

Definition Each list Sn+1S_{n+1} begins with SnS_n, so all the lists are beginnings of one infinite sequence t1t2t3…t_1 t_2 t_3 \ldots of letters R and L, called the regular paperfolding sequence. For every nn its first 2n−12^n - 1 terms are SnS_n. Its terms can also be found directly. Write a position k≥1k \ge 1 as k=2amk = 2^a m, with a≥0a \ge 0 a whole number and mm odd. Then the term tkt_k is R when mm leaves remainder 1 on division by 4, and L when mm leaves remainder 3. Equivalently, the terms in the odd positions 1, 3, 5, and so on alternate R, L, R, L, and the terms in the even positions repeat the whole sequence, t2k=tkt_{2k} = t_k for every kk. On a strip folded n+1n + 1 times, the creases in even positions are made by the first nn folds, which is why they repeat the creases of a strip folded nn times. The creases in odd positions are made by the last fold. They alternate because every earlier crease turns the strip over, so neighboring sections face opposite ways in the folded stack, while the last fold bends all of them in the same direction.

In plain words The paperfolding sequence is the pattern of R and L on the strip, continued forever. Every other letter alternates, and the letters in between spell out the whole sequence again from its start.

Example The first 15 terms are RRLRRLLRRRLLRLL, which is S4S_4. Its odd positions read RLRLRLRL, and its even positions read RRLRRLL, which is S3S_3. For position 12, write 12=4⋅312 = 4 \cdot 3. The odd part 3 leaves remainder 3 on division by 4, so t12t_{12} is L, and the twelfth letter of S4S_4 is indeed L. The even position rule agrees, because t12=t6=t3t_{12} = t_6 = t_3 and the third letter is L.

Dragon curve

Definition Draw stage nn of the folding path with segments of length 1, starting at (0,0)(0, 0) along the positive xx direction. Unfolding the middle crease turns the second half of stage n+1n + 1 a quarter turn counterclockwise about the end of the first half. So if stage nn ends at the point (a,b)(a, b), stage n+1n + 1 ends where that quarter turn sends the starting point,

(a+b, b−a),(a + b,\ b - a),

which is 2\sqrt{2} times as far from the start. Stage nn therefore ends at distance 2n/22^{n/2} from its start. Now shrink and turn each stage so that it runs from (0,0)(0, 0) to (1,0)(1, 0). Its 2n2^n segments then have length 2−n/22^{-n/2}, and stage n+1n + 1 comes from stage nn by replacing every segment by the two shorter sides of a right isosceles triangle built on that segment, with the right-angle corners placed alternately to the left and to the right of the path, starting on the left. If two consecutive stages are traced at constant speed over the same time, the two tracing points are never farther apart than half a segment of the earlier stage. These distances shrink by the factor 1/21/\sqrt{2} from stage to stage and add up to a finite total, so the paths approach a single limiting curve. This limit is the dragon curve, or Heighway dragon. It is made of two copies of itself, each shrunk by the factor 1/21/\sqrt{2}. The first copy runs from (0,0)(0, 0) to (12,12)(\tfrac{1}{2}, \tfrac{1}{2}) and the second from (12,12)(\tfrac{1}{2}, \tfrac{1}{2}) to (1,0)(1, 0). The name dragon curve is sometimes used for a whole family of related curves, but the Heighway dragon is not the Lévy C curve. That curve uses the same triangles with every new corner on the same side of the path, and already at its second stage it goes straight on at its middle point instead of turning, so its turns cannot be written with R and L alone.

In plain words Scaled to a fixed size, each stage replaces every straight piece by a small bent corner, bending alternately left and right. The corners get smaller every time, and the paths settle into one curve with endless detail.

Example Stage 4 with segments of length 1 has the turns RRLRRLLRRRLLRLL. Stage 3 ends at (−2,−2)(-2, -2), so stage 4 ends at (−4,0)(-4, 0), at distance 4=24/24 = 2^{4/2} from its start. Stage 4 is the first stage that comes back to a point it has visited, the corner (−2,−1)(-2, -1). It passes there once heading west and turning south, and later heading east and turning north, so the path touches itself at that corner without crossing. No stage ever uses the same segment twice. Every stage is still a finite path of straight segments, so it covers no area, however crowded a thick drawing of it looks. Whether the limiting curve takes up area is a question about dimension, which is where the lesson Fractal Dimension, Between a Line and an Area begins.

Check yourself

  1. Build S4S_4 from S3S_3. Check that it has the right number of turns, that its odd positions alternate and its even positions spell S3S_3, and find where stage 4 ends when it is drawn with segments of length 1 from (0,0)(0, 0) along the positive xx direction.
Show the answer

The list S3S_3 is RRLRRLL. Read backward it is LLRRLRR, and with R and L swapped it is RRLLRLL. So

S4=S3 R S3~=RRLRRLL RRRLLRLL,\begin{aligned} S_4 &= S_3 \, \text{R} \, \widetilde{S_3} \\[0.4em] &= \text{RRLRRLL} \, \text{R} \\[0.4em] &\qquad \text{RRLLRLL}, \end{aligned}

which is RRLRRLLRRRLLRLL. It has 15=24−115 = 2^4 - 1 turns, 8 of them R and 7 of them L, for the 16 segments of a strip folded four times. The letters in positions 1, 3, 5, up to 15 read RLRLRLRL, and the letters in positions 2, 4, up to 14 read RRLRRLL, which is S3S_3. Stage 3 ends at (a,b)=(−2,−2)(a, b) = (-2, -2), so stage 4 ends at

(a+b, b−a)=(−4,0).(a + b,\ b - a) = (-4, 0).

Tracing the turns from (0,0)(0, 0) gives the same end point, at distance 4 from the start.

  1. Change a rule. Suppose each new stage copied the old turns unchanged, so that the next list is the old list, then R, then the old list again. What do the stages look like, and what goes wrong?
Show the answer

Starting from R, the lists are RRR, then RRRRRRR, and every later list contains only the letter R. Drawn with segments of length 1 from (0,0)(0, 0), the second stage visits (1,0)(1, 0), (1,−1)(1, -1) and (0,−1)(0, -1) and comes back to (0,0)(0, 0), so it closes up into a unit square. The third stage goes around the same square twice and uses each of its four segments twice, and every later stage just keeps circling. The path never grows. A folded strip cannot do this, because its second half retraces the first half backward, and walking a path backward reverses the order of its turns and swaps left and right. Reversing alone would not help here, since a list of only R reads the same backward. Swapping alone gives RRLRLLR at stage 3, a different path that no strip folded in half again and again produces. Both changes are needed to describe the strip.

  1. Extend the pattern. Which letter is the 100th term of the paperfolding sequence, and which is the first stage with at least 100 turns? Where does that stage end when it is drawn with segments of length 1 from (0,0)(0, 0) along the positive xx direction?
Show the answer

Write 100=4⋅25100 = 4 \cdot 25. The odd part 25 leaves remainder 1 on division by 4, so the 100th term is R. The even position rule agrees, since t100=t50=t25t_{100} = t_{50} = t_{25}, and position 25 is the 13th odd position, where the alternation R, L, R, L gives R. Stage nn has 2n−12^n - 1 turns, and 26−1=632^6 - 1 = 63 is too few while 27−1=1272^7 - 1 = 127 is enough, so stage 7 is the first with a 100th turn. Every later stage begins with stage 7, so the 100th turn stays R from then on. For the end point, apply the rule that sends (a,b)(a, b) to (a+b,b−a)(a + b, b - a), starting from the end (−4,0)(-4, 0) of stage 4. Stage 5 ends at (−4,4)(-4, 4), stage 6 at (0,8)(0, 8) and stage 7 at (8,8)(8, 8), at distance

82=27/2≈11.318\sqrt{2} = 2^{7/2} \approx 11.31

from the start.