Shifting Patterns

akaaka to
hi wa tsurenaku mo
aki no kaze

How hot the sun glows,
Pretending not to notice
An autumn wind blows!*

  — Matsuo Basho

What is a haiku? Or, more specifically, what makes a particular composition a haiku, as opposed to one of the many other poetic forms? The defining feature most people will be familiar with is the 5-7-5 syllable structure. Within that basic structure, of course, the possibilities are almost endless, and this is what makes haiku so tantalizing to write: you can shift the words and syllables around to craft your message, and as long as you retain the classic 5-7-5 syllable structure you can still call your work a haiku**.

This is not an isolated trait. We constantly define, and categorise, and classify, according to patterns. We determine a basic pattern, an underlying structure, and then classify anything consistent with that structure accordingly. This is our natural talent for abstraction at work again, seeking underlying patterns and structure, and mentally grouping together everything that possesses that structure. It is the means by which we partition and cope with the chaotic diversity of the world. And yet, despite our natural talent for this, it wasn’t until the last couple of centuries that we had any treatment for this sort of abstraction comparable to our use of numbers to formalise quantity.

Since, unlike numbers, very few people have had the requisite abstractions drilled into them from a young age, we will have to go a little more slowly, and try and tease out the details. The first point to address is that fact that we have been very vague. It is certainly true that we find patterns, and classify things according to whether they preserve the pattern or not, but the very concept of a pattern is itself only very loosely sketched: we are hiding a lot of detail in words like “pattern” and “structure”. The best way to come to grips with this is to start with very simple examples for which we can agree on what we mean by pattern, and see if we can’t build up an abstraction from there.

Let’s consider an arrangement of coloured marbles (red, green, and blue) that looks like this:
Pattern of coloured marbles
and agree (hopefully) that by the “pattern” here, we mean the specific triangular layout with the colours arranged just so (two blue marbles in the top corners, a small triangle of green marbles, and a red marble at the bottom corner). We are interested in other arrangements of marbles that also have that pattern. That might sound like an impossible task since the only way to lay out marbles such that they are in that pattern is to lay out the marbles exactly as shown… there are no other ways, right? Not exactly, no. You see each green marble is different, so we could swap a couple of the green marbles; the marbles would then be laid out differently (we have put specific marbles in different places) but the pattern of colours has remained the same. It helps if we label the marbles like so:
Labelled pattern of marbles
and then we can see that this rearrangement of marbles still preserves the pattern of colours:
A different arrangement of marbles that preserves the pattern
So what happened here? It may help to think in terms of the actions we need to take to go from the initial arrangement to the new rearranged version. We swapped the blue marbles, and rotated the green marbles around in a circle:
Showing how the rearrangement was made
The trick now is to notice that, as long as we are thinking in terms of forming a rearrangement by interchanging marbles, any rearrangement that preserves the pattern works even more generally. That is, if we started with a different initial arrangement of the marbles like this:
The same marbles in a rectangular arrangement
then making the same interchanges of marbles as before (swapping the blue marbles, and cycling the three green marbles) will preserve this pattern as well. Of course if we were to add more marbles, or take some away (and thus alter our numbering scheme) things would once again get more complicated. Still, by thinking in terms of interchanging items we have managed to generalise across a wide variety of particular patterns. We should be taking that as a hint that this particular line of thinking is worth investigating further.

What we are seeing is that if we think if terms of rearrangements that preserve the internal relationships that make up a particular pattern, then those rearrangements will continue to preserve those same internal relationships for any other pattern that has them. In our case with the marbles the internal relationships were defined by which marbles we could tell apart from one another — that is, which marbles were the same colour. If we had swapped a red and green marble we would have broken the pattern; and that would have happened had we done so with the triangular arrangement, or the rectangular one. As long as we work in terms of rearrangements that refer to swapping marbles we can generalise over all the different particular spatial patterns at once. Don’t worry if that isn’t sinking in yet, there’s another example coming up. In the meantime, however, I want you to notice that the “rotation” of the green marbles can also be achieved by simply swapping marbles 2 and 5, and then swapping marbles 2 and 4 — try it out yourself. This sort of decomposition fo rearrangements will prove important.

Our next example, to try and get a feel for things, is a square. We’re interested all the different things we can do to the square that will have it end up looking the same we started (symmetries of the square, if you want to think of it that way). If you’re still feeling a little lost with all of this it might help to cut out a square of paper to manipulate yourself as you follow along. First, just as we did with the marbles, we’re going to label the square so we can keep track of what we’re doing — in this case we’re going to number the corners (it will probably be helpful to do this on your square of paper if you have one):
A square with labelled corners
What we want to do is find all the different manipulations of the square that result in a square in exactly the position we started with, and we’ll keep track of the different manipulations by how they move the labels in the corners. With a bit of experimentation you’ll quickly find that we have three rotations like so:
The three different rotations of a square
and we can flip the square across four different axes like so:
The four different flips of a square
and that’s all we can do; for example, if we tried just swapping corners 1 and 2 we would end up with something that isn’t a square anymore:
A distorted square -- not a square anymore
How is this similar to our example with marbles? In the same way that we found new arrangements of marbles by swapping marbles around, we are finding new arrangements for the corners of the square. With the marbles we were concerned about the internal relationships formed by the different colours (and our ability to distinguish marbles of different colour, but not marbles of the same colour). With the square the internal relationships are formed by adjacency relations of the corners; that is, we require, for instance, that the corner 1 is always between corners 4 and 2 and opposite to 3; similarly the corner 2 is always between corners 1 and 3, and opposite to 4. Thus swapping just corners 1 and 2, for example, results in the corner 1 being between 2 and 3, and hence breaking the internal relationship. What determines a pattern is how internal sub-objects relate to one another. What determines a different arrangement that preserves a pattern is whether that arrangement preserves those inter-relationships.

There is more that we can exploit with this example however. As with the marbles example, we can decompose complex rearrangements in terms of simpler ones. Let’s consider just two rearrangements of the square: a rotation by 90 degrees, and a flip through the vertical axis, which we’ll refer to by the letters r and f:
Two basic operations for rearranging a square
Through combination of just these two rearrangements we can produce all seven possible pattern preserving rearrangements; for example if we first flip through vertical axis, and then rotate by 90 degrees (which we will shorthand to fr for a flip followed by a rotation) then the resulting arrangement is the same as flipping about the diagonal through corners 2 and 4.

Our seven rearrangements turn out to decompose as follows:

  1. Rotation by 90 degrees: r
  2. Rotation by 180 degrees: rr
  3. Rotation by 270 degrees: rrr
  4. Flip about vertical axis: f
  5. Flip about horizontal axis: frr
  6. Flip about leading diagonal axis: frrr
  7. Flip about trailing diagonal axis: fr

More importantly, any combination of flips and rotations will still result in a rearrangement that preserves the square, since each individual flip and rotation along the way will preserve the square. That means, for instance, that the sequence of flips and rotations frrfrfrrr should correspond to one of these seven possibilities (or simply do nothing at all), but which one? Equally, what happens when we rotate by 270 degrees, then flip about the leading diagonal and rotate by a further 90 degrees? This turns out to be surprisingly easy (no playing with paper squares is required).

A first point to notice is that two consecutive flips (ff) is the same as doing nothing — we end up with our original arrangement. The same happens with four consecutive rotations (rrrr). Letting the symbol ⋅ stand for the null rearrangement of doing nothing, we can write these rules as

ff = ⋅
rrrr = ⋅

The last observation we need is that a rotation followed by a flip (rf) results in the same rearrangement as a flip followed by three rotations (frrr); that is

rf = frrr

We can put these rules together to completely understand any possible combination of flips and rotations.

At this point you should be noticing that things are looking a lot less like geometry and a lot more like algebra. This is a different sort of algebra altogether however. Previously, we developed algebra by letting a letter stand in for any possible number; something we could do because we had determined which arithmetic rules were true regardless of which particular numbers were used. Here we have letters standing not for numbers, but for rearrangements. The result is that the arithmetic rules look very different. When we were abstracting numbers we had the commutative law that x×y = y×x; here we find that isn’t true at all: instead of rf=fr we have rf = frrr. We do have, however, exactly what algebra offered us for numbers: a set of rules for what operations we can perform. In this case we know that we can use the fact that rf = frrr to steadily move all the rs to the right of any fs. That means we can rearrange any sequence of flips and rotations so that all the fs are together on the left, and all the rs are together on the right. Then all we have to do is use the other two rules to cancel down the fs and rs. We can have either 0 or 1 consecutive fs followed by 0, 1, 2, or 3 consecutive rs. A quick scan of our decomposition of seven rearrangements will show these cover all such possibilities (except the null case of 0 fs and 0 rs) .

This is perhaps best illustrated with an example, so lets consider our complex sequence of flips and rotations given by frrfrfrrr. We have

frrf(rf)rrr = frrf(frrr)rrr = frr(ff)(rrrr)rr = frr⋅⋅rr = f(rrrr) = f⋅ = f

So the end result is identical to a simple flip about the horizontal axis. Similarly, our other question, what happens if we rotate by 270 degrees, then flip about the leading diagonal and rotate by a further 90 degrees, can be resolved easily by expressing those complex rearrangements in their decomposed form and simplifying according to the rules:

(rrr)(frrr)(r) = rrrf(rrrr) = rrrf⋅ = rr(rf) = rr(frrr) = r(rf)rrr = r(frrr)rrr = (rf)(rrrr)rr = (frrr)⋅rr = f(rrrr)r = f⋅r = fr

which is a flip about the trailing diagonal.

What we have here is an algebra for the symmetries of a square. In this algebra letters symbolise not numbers, but rearrangements of the corners of a square, and as a result the rules of this algebra are quite different. Were we to perform a similar analysis for the rearrangements of marbles in our earlier example, we would find 11 rearrangements (plus the null rearrangement that does nothing), with three base rearrangements, and a different set of rules again. I leave the determination of these rules as an exercise for the interested reader. Indeed each distinct pattern (that is, each distinct set of internal relationships between some set of sub-objects) will have its own set of rules, and its own associated algebra. Our world is filled with patterns, and each and every such pattern has its own algebra describing how objects within the pattern can be rearranged while preserving that pattern. A whole new world begins to open up before us: what are all the possible algebras***, and what patterns do they describe? Are there different sets of rules that produce the same algebras, and if so, how can we tell?

Those questions, and a fuller exploration of this rich world which we have only just glimpsed here, will have to wait however. Next time we will return to the continuum, and continue to try and unravel the many paradoxes that surround it.

* Translation by Dorothy Britton, Haiku Journey: Basho’s Narrow Road to a Far Province, Kodansha International, 1974.

** In practice Japanese haiku have rather more subtle demands, and are both more, and less flexible than this; this example is more for illustrative purposes.

*** Note that I am using algebra here in an informal sense — there is a strict mathematical sense which is quite different.


10 Responses to “Shifting Patterns”

  1. Jesse Says:

    Nice post. Reminds me of the MU-Puzzle in Hofstadter’s Gödel, Escher, Bach.

  2. Jesse Says:

    I leave the determination of these rules as an exercise for the interested reader.

    Here’s one way (surely there are others). The numbers refer to the positions in the second marble graphic.

    b: Swap marbles in positions 1 & 3
    g: Swap marbles in positions 2 & 4
    h: Swap marbles in positions 2 & 5

    b[foo]b = [foo] (where [foo] is any sequence)
    gg = hh = ⋅ (null)
    ghg = hgh (swaps marbles in positions 4 & 5)

    Using these, the 11 non-null rearrangements are:

  3. Leland McInnes Says:

    Jesse: Looks right to me. There are, as you’ve probably discovered, several ways to express this — which in itself raises the interesting question of how we can tell when when things are simply different expressions of the same group. Once we’ve done a little more group theory we’ll see that we can naturally construct the marble case as S3×C2, which makes calculating things a little easier. Then we’ll get on to homomorphisms, which will let us see that your approach is indeed expressing the identical algebraic structure.

  4. Jesse Says:

    There are, as you’ve probably discovered, several ways to express this

    Yep; for fun, here’s a similar one:

    b: swap blues (13)
    r: rotate greens clockwise (2->5->4->2)
    s: swap greens 2 & 4

    b[foo]b = [foo] (where [foo] is any sequence)
    rrr = ss = ⋅ (null)
    rs = srr

    The 11 rearrangements are then:

    Which can obviously be expressed in terms of my first set of rules (and vice versa). Both take 24 characters to express the 11 rearrangements… wonder if there’s a formulation that takes less..

  5. Ben Royal Says:

    what an astonishingly beautiful site. thank you.

  6. The Gaijin Haijin Says:

    A note on haiku:

    Although it’s taught as such, English haiku is neither defined as nor actually limited to a strict 5/7/5 structure. Some of the reasoning as to why this is so can be found here: and here:

    外人 俳人

  7. The Narrow Road » Blog Archive » Paradoxes of the Continuum, Part II Says:

    […] The Narrow Road Zen and the Art of Mathematics « Shifting Patterns […]

  8. Helen Andreson Says:


    You have awesome site, very interesttng. What do you think about B4875S586 style?

  9. The Narrow Road » Blog Archive » Permutations and Applications Says:

    […] Numbers are remarkably tricky. We tend not to notice because we live in a world that is immersed in a sea of numbers. We see and deal with numbers all the time, to the point where most basic manipulations seem simple and obvious to the point of absurdity. It was not always this way of course. In times past anything much beyond counting on fingers was the domain of the educated few. If I ask you what half of 60 is, you’ll tell me 30 straight away; if I ask you to stop and think about how you now that to be true you’ll have to think a little more, and start to realise that there is a significant amount of learning there; learning that you now take for granted. Almost everyone uses numbers regularly every day in our current society, be it through money, weights and measures, times of day, or in the course of their work. Through this constant exposure and use we’ve come to instinctively manipulate numbers without having to even think about it anymore (in much the same way that you no longer have to sound out words letter by letter to read). That means that when we meet a new abstraction, like the symmetries discussed in Shifting Patterns, it seems comparatively complex and unnatural. In reality the algebra of symmetries is in many ways just as natural as the algebra of numbers, we just lack experience. Thus, the only way forward is to look at more examples, and see how they might apply to the world around us. […]

  10. The Narrow Road » Blog Archive » Grouping Symmetries Says:

    […] In the previous entries Shifting Patterns and Permutations and Applications we have looked at how patterns and symmetry can be abstracted into algebras. Each different pattern provided its own unique algebra, with different algebraic rules. These are, in a sense, our islands; each different and unique and beautiful. What we need to explore now is the entire bay. To do this we need to take a step back, or more accurately up, and try to examine the whole. The aim is to abstract across all the different algebras that different patterns generate. We could, perhaps, liken this to the process of developing algebra from numbers by abstraction; here, however, we have different pattern-algebras standing in place of different numbers. In abstracting up from numbers to basic algebra we looked for those properties that held true regardless of the particular numbers under consideration — each different number has its own unique properties (indeed, there is a vast richness of material here that is studied in number theory) — but there are certain properties that are common to all. What we seek is a set of basic algebraic rules that are true for all pattern-algebras; each different pattern algebra may have its own idiosyncratic rules, but hopefully we can find a basic set of underlying rules. In practice we’re going to hope for even more than that. Not only do we want the algebraic rules we determine to be common to all pattern-algebras, we would very much like it if any algebra that satisfied the basic rules turned out to the pattern-algebra for some pattern. That is, we want a two way correspondence: every pattern-algebra should satisfy these rules, and everything that satisfies these rules should be a pattern-algebra. […]

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s

%d bloggers like this: