A monochrome pattern that’s simpler than it looks

The following pattern is, I think, quite pretty. I hope you agree.


Here’s how it was made.

  1. First I made a simple pattern in Windows Paintbrush.
  2. Then I made a copy of the pattern in step one, and flipped it. (Horizontally or vertically: it makes no difference.)
  3. Finally I merged the two to create the pattern you see above. A pixel is white if the corresponding pixels in (1) and (2) are the same colour (be it white or black) and black if the corresponding pixels in (1) and (2) are opposite colours.

Perhaps this will inspire you to create patterns of your own.

Fractal poetry, and other links

This post contains what purports to be a fractal poem. It’s not a bad poem in its own right, but the link to fractal geometry was too subjective for my taste. However, it got me thinking about what else a “fractal poem” might mean, and I was up till two that morning bringing my idea into fruition. I shared the poem I came up with in the comments, but a fuller explanation appears below.

I based my poem on a simple L-system. An L-system contains a set of rules, applied iteratively, for replacing one symbol with a sequence of symbols. For example, suppose we agree to replace “A” with “ABBA” and “B”, with “BA”. Then, starting with “A”, the first iteration gives “ABBA”, the second iteration gives “ABBABABAABBA”, the third “ABBABABAABBABAABBABAABBAABBABABAABBA” and so on. The connection to fractal geometry is that if we interpret the symbols graphically (e.g. “A” for “go forward” and “B” for “turn left”), we get a squiggly line whose squiggliness depends upon the number of iterations.

I used an L-system where “A” becomes “ABBA”, “B” becomes “BCCB”, and so on. (Using numbers rather than letters, this is: “n → n, n+1, n+1, n”.) After two iterations, we have “ABBABCCBBCCBABBA”, which is the structure I used for my poem, interpreting each letter as representing a line and requiring all lines assigned the same letter to rhyme. In other words, it had to be a 16-line poem in which lines 1, 4, 13 & 16 rhyme, lines 2, 3, 5, 8, 9, 12, 14 & 15 rhyme, and lines 6, 7, 10 & 11 rhyme.

Here is the result. It has, I think, an interesting aesthetic quality when read aloud.

This doggerel does not intend
To satisfy the reader’s would
For art that is remotely good;
It will not serve to meet that end,
So don’t imagine that it could.
But in its rhyming structure you
Might find, if you are able to,
A pattern to be understood
That’s relevant to trees of wood
And clouds of water vapour, too –
The applications are not few –
For it possesses fractalhood.
Look closely, and you’ll comprehend
The secret pattern, bad or good,
Which, if this text were longer, could
By iterative means extend.

After a third iteration, the structure would be a challenging ABBA BCCB BCCB ABBA BCCB CDDC CDDC BCCB BCCB CDDC CDDC BCCB ABBA BCCB BCCB ABBA. Four iterations would give you an epic poem of 256 lines. You’re welcome to give that a go, or maybe you’d prefer to write your own variation on a shorter poem like mine.

Here are some more links that I found over the Christmas holidays:

  • The development of a foetus, animated.
  • Strong Language is a new linguistics blog about swearing. Mostly. Along the way it covers a variety of topics and is worth a look.
  • A well-presented and informative video on placenames ending in -stan.
  • A curious difference between the Andromeda Galaxy and our own.
  • All of the best arguments against vaccination together on one page. (No, it’s not blank, but you’ve got the right idea.)

As for the holidays themselves, I don’t feel like writing a report, but rest assured I had an excellent time. Here are two photographs that capture some special moments.


The photo on the left shows my niece and her parents (my sister on the left, pregnant with her second child) at the Christmas table as it is being prepared. Of note are the origami mangers, complete with jelly baby and paper straw, alternating with paper trees. The brown paper bags are what we used instead of crackers.

On the right is a framed photo set showing miscellaneous moments in Elke’s life so far. This was Rebecca’s Christmas present to me, and it is now hanging above the light switch in my bedroom.

Manual variation on the snowflake curve

Ever since I created the following image more than a year ago, it has inhabited that uncomfortable limbo of being too good to delete and too trivial to share. But then, a blog needs the occasional triviality, so here it is.

It’s a version of the famous Koch snowflake curve, but with a different-from-usual presentation. I can’t remember the precise method I used to draw it, but it was done manually in a version of Windows Paintbrush, and not with the help of any more specialist tools.


Operational algebra

I vaguely remember wondering — as a child of seven or eight — how new mathematics became established. I pictured a long line of people in front of a guy with a desk (or maybe a tent), waiting to register their latest idea — such as a new mathematical operation.

I had one such idea myself. I knew by this age that multiplication consisted of repeated addition, so I thought why not define something else in terms of repeated multiplication? Thus I invented integer exponentiation. (It’s an obvious idea: I blame the Childcraft books for arousing my interest.)

When I was older and learned that exponentiation actually existed, I was troubled by a curiosity of language. When people talk about 104, they say “ten to the power of four” — and yet 102, 103, 104 are collectively referred to as “powers of ten”. In one context, the number after the “of” is the exponent, and in the other context, it’s the base. Why is this? Isn’t mathematics supposed to be consistent?

If I could answer my childhood self, I’d point out that the same ambiguity crops up in everyday language. We say that x-ray vision is one of the powers of Superman, but we also say that Superman has the power of x-ray vision. When we use terms like “power of” we are translating mathematical notation into English, which has no use for consistency.

I not surprisingly came to speculate about an operation defined in terms of repeated exponentiation, another operation defined in terms of that, and so on ad infinitum. Some of you will find this familiar.

Let’s adopt the symbol ➀ for addition, ➁ for multiplication and ➂ for exponentiation, and let’s have ➊ for subtraction, ➋ for division and ➌ for the calculation of roots (although exponentiation actually has two inverse operations — the other being the calculation of logarithms — so we’ll leave that well alone).

Now we can specify operations using algebraic variables — and for that reason I referred to this system as operational algebra. I’ll use the symbol ✪ for “operation”, and write 2 [✪3] 5 to mean the same as 2 ➂ 5 which means the same as 25. For inverse operations I’ll insert a minus sign so that 2 [-✪2] 5 means the same as 2 ➋ 5 which means the same as 2/5. My original notation was handwritten, obviously, but this is a reasonable compromise. I won’t pretend it’s perfect.

For positive integers, higher-order operations can be defined as:

a [✪n+1] b = a [✪n] a [✪n] … [✪n] a {b terms}

But because exponentiation is non-associative, this presents us with a choice. If we bracket the expression from right to left — as in 2(2^(2^(2^…))) — then we are in the same realm as Knuth arrow notation (which I didn’t know about at the time). But if we bracket it from left to right — as in (((22)2)2) — then because (ab)c=abc, it follows under this definition that ➃ can be extended to non-integer operands using the formula a ➃ b = a(a^(b-1)), and then a ➄ b can be defined for non-integer a. I always used the latter (left-associative) definition.

As for higher operations in this sequence, I was convinced at the time that they could all be extended to non-integer operands, but my reasoning was faulty.

The fun wasn’t all at the high end, though. Early on I recorded the trivial fact that there is no zeroth operation. That is, no operation can be consistently defined such that a + b = a ✪ a ✪ … ✪ a {b terms}.

I don’t propose to share everything I did with this system. For one thing, a lot of it was wrong, and for another, I threw my notes away years ago. But here is something worth finishing on. Recall that an inverse operation can be defined such that:

(a [-✪n] b) [✪n] b = a

Now observe:

  • 2 ➊ 2 = 2 – 2 = 0
  • 2 ➋ 2 = 2 / 2 = 1
  • 2 ➌ 2 = sqrt(2) = 1.41421…
  • 2 ➍ 2 = [solution of nn = 2] = 1.55961…
  • 2 ➎ 2 = [solution of (n^(n^(n-1)) = 2] = 1.6498…

Based on this, it seems intuitively likely that if we could extend all higher operations to non-integer operands, then as n approaches infinity, we’d find that 2 [-✪n] 2 approaches 2, giving us a glimpse into the infinite operation. This intrigued me.

I abandoned my speculations in operational algebra around the time I left school and started university. I am vaguely aware that everything I explored (except the wrong bits) exists in established mathematics, if often subsumed under much more abstract generalisations. This makes no difference to the fact that a teenager had fun messing about.

As a final word: please don’t take from this blog post the idea that I’m good at maths. I lack the rigour to be good at it; I am merely playful.

If conversation were chemistry

Today’s blog post is for the geeks. Seriously, if you don’t think frequency analysis for its own sake can be fun, you probably won’t enjoy this much.

Stan Carey has a blog post about the length of the chemical name of the largest known protein, considered as though it were a word. It takes three and a half hours to read aloud, so it would easily be the longest word in the English language were it not for the fact that it doesn’t count.

I decided to play around, so I started by taking the chemical name, and (after removing hyphens/whitespace from raw text) ran it through a character frequency analyser. This told me that the letter L occurs 14645 times, accounting for 22.9% of the text. At the low end, the letter D occurs a measly 238 times, which is just 0.4%. Letters not present at all are B, F, J, K, Q, W, X and Z.

Noticing that the chemical name contains a multitude of components ending in ‘yl’, I inserted a space after each occurence of that pair, then fed the result through a word frequency analyser. It gave me the following totals for each component word. Read the rest of this entry »

Imaginary musings

Regardless of the school you went to, if you did final year maths then you’ll relate to the following anecdote. Your stories might differ in specifics, but this is pretty much the archetype of what goes on in the classroom. (No doubt it also rings a bell if you’re a teacher.)

  • In a maths class, I asserted that the intelligence quotient of the classmate I was talking to was zero.
  • Said classmate replied that my IQ was zero POINT zero.
  • Me: “Yours is zero point zero times ten to the minus INFINITY.”
  • Him: “Yours is MINUS zero point zero times ten to the minus infinity.”
  • Me: “Yours is minus zero point zero times ten to the minus infinity *i*.”
  • Finally he concluded that my IQ was just i, a wholly imaginary quantity, and that at least his was real.

I tell this story as a gentle way to raise the topic of imaginary (and complex) numbers, which I’ve been musing on lately. I think my latest bout of musings were triggered by reading this, which I read via a chain of links that I can’t remember now, but would have included this.

The subject of my muse was why most attempts to explain the applications of complex numbers strike me as unilluminating.

Classroom banter doesn’t count as an application. Neither do pretty fractal patterns — they’re lovely, but like a game, the rules don’t have to mean anything. Neither is it remarkable that one abstraction can be used in the service of another abstraction, as in esoteric results from advanced mathematics. What counts are situations where it’s fruitful to take a quantity derived from real world measurements, and relate it to the square root of a negative number.

I never studied any applications of complex numbers myself, having not done any physics beyond first year university. But I’ve occasionally listened to, or read, people trying to explain how imaginary numbers are useful in their fields, and I almost invariably have no idea what they’re talking about. They might assert that imaginary numbers are useful for such-and-such, but in a way that leaves me no wiser about what said context has to do with squaring something and getting a negative result.

So it occurred to me that perhaps most explanations fail because they show the audience an imaginary-shaped peg without first cutting an imaginary-shaped hole. Let me illustrate the point with reference to negative numbers, and then relate it to imaginary/complex ones later on.

Once upon a time, negative numbers were widely regarded as an affront to common sense. Quantities less than nothing? Crazy. But applications soon became apparent, and those applications tended to fit very particular patterns. One can sensibly answer questions like: if you’re looking for a scenario that lends itself to being modelled with negative numbers, then what sort of characteristics should you look for?

In my metaphor, the answer to that question is the negative-shaped hole, and a particular scenario which has those characteristics is the negative-shaped peg. And here’s the answer: you look for a scenario where every quantity has a corresponding opposite. The opposite of having a particular speed is having the same speed in the opposite direction. The opposite of being so high off the ground is being so far under it (and, preferably, upside down). The opposite of having so much money is being so far in debt. And so on.

If you have a scenario in which various quantities have corresponding opposites, then you have a scenario that lends itself to being modelled with the aid of negative numbers. There’s your hole, and you’ll find any number of pegs to fit. Note also that negative numbers don’t measure anything mysterious; simply flip the coordinate system around and they become positive.

If we carry this pedagogical approach over to the imaginary case, the question becomes as follows. Suppose you’re looking for a scenario that lends itself to being modelled with imaginary numbers. What characteristics would you look for?

And for a pretty good answer, consider that in the world of imaginary numbers, there exists a function such that f(f(x)) = -x. In fact there are two such functions (multiplying by i and multiplying by -i), but the point is made by translating that formula into everyday language. It means there is something you can do to a quantity twice and always get back the opposite of what you started with.

That’s probably the simplest imaginary-shaped hole you can find. If you have a scenario in which there’s something you can do to a quantity twice and always get back the opposite of the quantity you started with, then you have a scenario that lends itself to being modelled with the aid of imaginary numbers. As for pegs, no problem. Try anything involving rotations and waves.

In the case of rotations, the thing you can do twice and end up with the opposite of what you started with is to rotate a quarter of the way around. In the case of waves, it’s to wait for a quarter of a wavelength to go by. Given such tools, if a physicist’s eyes roll at an elementary blunder in this blog post, you can calculate what that physicist will be looking at by the end of it. You can almost as simply calculate the same thing using old-fashioned real numbers, of course, but with a good i you can fit into a single formula what otherwise requires an algorithm. And you can show that the principle neatly carries over to finer intervals — less than a quarter of the whole.

I haven’t mentioned Euler’s equation — an oft-celebrated result of a very clever procedure that makes it meaningful to raise numbers to imaginary powers, and is typically taught in first year mathematics at university. The relevant consequence is that i can be re-written as e to the power of πi/2, and hence that i to the power of some number n is the same as e to the power of nπi/2 [note: π is pi — but my blog happens to use a font that doesn’t draw it very well]. Re-writing everything as exponents of e may make things more complicated for algebra, but simplifies things for calculus. But because I haven’t done any calculus since the 1990s (and wasn’t much good at it then), I won’t go there.

(Exponents of e are also neater if you measure angles in radians rather than quarter-revolutions, but I’m pretty sure the reason mathematicians measure angles in radians is because it leads to trigonometric functions having neat power series and hence Euler’s equation etc, so the causality is kind of inverted there.)

I’m definitely not going to mention quantum physics. If you’re interested, try a blog by someone who understands it. You didn’t come here for that.


I drew this manually in Windows Paintbrush, mostly by copy-and-drag.


I’ve named it “superknot”, but actually the shape it represents is a topological loop.

It’s a fractal generated in an L-system-like manner, replacing corners and unit edge pieces at each iteration with corresponding schematic drawings of a segment of tangled string that fills a unit square.

Feel free to use for any purpose.

Two nodable challenges

Here are two challenges that are completely unrelated except that both involve nodes in some way.

The first challenge is different for every reader, and is one example of a whole family of challenges you can invent for yourself.

Sometimes, in idle moments, my mind is drawn to the geometic layout of buttons on remote control devices. Considering the buttons simply as nodes and abstracting away all extraneous detail, you can invent puzzles for yourself that involve partitioning these nodes according to set rules.

For example: see if you can partition the remote control into multiple rectangular grids, such that there’s a grid containing one button, a grid containing two buttons, a grid containing three buttons, and so on, until there aren’t enough buttons left for another grid. A grid is an n×m rectangle with a node at every point. It’s most elegant if you make each grid as “square” as possible (i.e. better 2×2 than 1×4, better 2×3 than 1×6, etc). Are yours solveable?

Read the rest of this entry »

General updates 2011: Mar/Apr

Welcome to another general update. It’s a bit late because I haven’t been feeling my best for the last couple of days (nothing to worry about, just lethargic, that’s all).

I’ve been doing some interesting projects at work recently. I’ll save the details for another time, but one of these projects is the poetry of Pam Marlow, the friend of mine who died of cancer last year. She always intended to have her poetry published but never actually did so in life, so with her family as the client it’s now being done through the graphic design place that I work for. I’ve been looking forward to this assignment for quite some time.

I have little else to say about real life for now. Most of what follows are web page recommendations.

Read the rest of this entry »

Solution: Knights and Pages

Last week I posted a puzzle that I originally found in the book The Chicken From Minsk And 99 Other Infuriating Brainteasers by Yuri B Chernyak and Robert M. Rose. Here is a scan of the puzzle as it appears in that book.


And here is a composite scan showing the official solution from the book. Click on the thumbnail to read. (I have some issues with their solution for the second part, but we’ll get to that later.)

Now, if all you came for was a solution, then you’ve already read as far as you need to. But if you want to go a little deeper, read on. I’ll start by describing how I personally went about solving the first part of the puzzle.

Read the rest of this entry »