I'm not going to use LiveJournal any more. Go here for my new blog location:

Back in 2004, LJ was perhaps still an active community. I think it died at around 2007 but inertia kept me here for another ten years.

But now I have no excuse to not take more control. Jekyll and GitHub hosting have several concrete advantages - exportability, full control, no ads, javascript.

So, thanks, and bye!

Crocheting into the third dimension: Chen-Gackstatter

I'm into crochet at the moment. Here's the latest thing I made:

From Curvature

It's a Chen-Gackstatter surface of genus 1. An approximation of it anyway. Really it's just a plane with a handle.

It's like a torus that has had one side split open so that the inside and outside are symmetrical.

One way to look at it is by touching your index fingers and thumbs together to make two loops. If you interlock them then you've got two rings at right angles to each other. Now think of all the points that are halfway between these two rings. You get this surface:

I made it because it is the simplest surface I could think of that has some slightly surprising properties, other than the Mobius strip. You can poke your fingers through the holes but the holes don't lead to the other side, they lead back to the same side. So there are two holes, one on each side of the sheet. This goes against our common idea of a hole being from one side of a sheet to the other.

The holes wrap around each other in a nice way. The boundary of one defines the other. A bit like the yin-yang symbol but in 3D. In fact you could argue that this is the natural extension of the yin-yang symbol into 3D, if such a thing makes any sense.

Working out how to make this in crochet was interesting. I started with two tiny loops joined in a figure-8 then twisted to be at right angles to each other. Then I carried on adding stitches around the outside, looping around to make this little thing:

From Curvature

And then it was just a matter of continuing to add stitches in the same figure-8 loop around the edge. It actually came as a surprise when I realised that was all I needed to do. I'd planned to make it in two pieces and then join them at a seam but I'm glad I didn't need to.

This use of crochet to explore maths is inspired by Daina Taimina's idea to crochet the hyperbolic plane. I wrote about that before, but it is only now that I'm getting round to trying the crochet myself. It's very interesting!

Daina Taimina showed us that you can change the curvature of the crocheted surface by adding more or fewer stitches around the edge as you go. Add too many and the edge ruffles up into what is called negative curvature and you get the hyperbolic plane. Add too few and the crochet pops into a dome shape, with positive curvature like a sphere. Presumably that's what the instructions tell you if you are crocheting a bobble hat. This surface has different curvature in different places, so it's a bit of a miracle when something vaguely pleasing comes out at the end.

Redesigning the analog clock

I made myself a clock. Here's the original Google+ post: where I said:
Analog clocks have always annoyed me, so I decided to make my own. This is the logical solution I think. There's only one hand, which moves round once a day and shows where the sun is on the map. In the photo it is nearly 10pm in the UK so the sun is over the Alaska timezone. The 6am-6pm line is your horizon, so the top half is your daytime.

This one is for GMT/UTC - you'd need to rotate the map for different timezones, to put your location at the top under the noon marker.

Since then my daughter and I have decorated the clock a bit more. She colored in the countries green and I fixed a Sun on the hour hand above the equator:

I promised some details about how to make your own. It's really very simple indeed, and cheap.

1) Buy a 24-hour clock. I bought this one from Amazon in the UK. It was less than £20.

Make sure you get one that has an hour hand that goes round once per day!

Alternatively you can buy a 24-hour clock mechanism and make your own face plate. Probably best to buy the hands at the same time so you can be sure they will fit.

Here's an EBay link to lots of different 24-hour clocks and mechanisms:

2) Take your clock apart. Mine had crosshead screws on the back so it was easy. Then pull off the hands. Every clock mechanism I've come across has hands that fit by friction, so you can take them off and put them back on again by hand.

3) Extend the hour hand. This is optional. Typically the hour hand is shorter and doesn't reach to the edge of the circle, which affects our clock design where we need a bit more precision from the read-out, since we only have one hand.

There are lots of options here. I snipped off the second hand and glued it to the underside of the hour hand. It did make it look like there were two hands with one on top of the other but later the sun covered it up, as you can see in the images above.

Possibly a better option is to replace the pointer completely. Keep the center bit of course because you'll need it to push back onto the spindle. Fashion a pointer from a bamboo skewer or something like that and glue it on.

Optionally you can add a little sun sticker to make it more obvious what the clock is showing. I just made one from a little bit of card and glued it on. I would suggest sticking it over the equator circle, since that is the average latitude of the sun. (By a happy coincidence this also covered up the join in my two-part hour hand.)

4) Snip the second hand and replace the center cap. With my clock the central spindle looked a bit bare with just the hour hand. Often the smallest hand has a decorative dome cap, which you can re-use. It is missing in the top image, if you can see. Just push it back on after removing the second hand pointer.

5) Prepare a new face image. If the clock is for GMT/UTC then you're welcome to use my image. I've put a high-res version here: (not this 400 pixel thumbnail, click through for the 4000 pixel image)

From Clock

Otherwise you can use GIMP to rotate this image:

From Clock

and overlay it with this image of just the numbers and marks:

From Clock

To rotate in GIMP, use Layer > Transform > Arbitrary Rotation...

To overlay in GIMP, use File > Import as Layers... to open the two images, then change the Mode in the Layers dialog to Darken Only. Use the Move tool if the two layers aren't aligned correctly.

When rotating, each hour is 15 degrees. It's not critical that the sun is in exactly the right place (we're not allowing for daylight saving time for example) but try to get your location to be at the top, because noon is when the sun is highest in the sky. Let me know if you need me to make the face image for you.

If you don't want the horizon line then I've put a version up without it, in the same album.

You can use a different map image of course. As long as it's a polar projection of the North pole then it will work fine. I made mine using NASA G.Projector: which is a really nice tool and comes with maps and images included. Change the projection to Azimuthal, centered on 90 degrees North. I used a radius of 140 degrees, to include most countries. Add borders using the Overlay 1 list. Change the background to white so you can see the graticule. Keep the graticule spacing at 15 degrees so that each one is an hour. Finally you can save out the image using File > Save Map As...

If you have a color printer then now is a good time to add some color to the image.

6) Print the image. Specify the print size by the diameter of your clock (mine was 10.5 inches). I had to print mine in two halves because the clock was larger than A4. Cut into a circle and cut a hole out for the spindle in the center. Check it fits on the clock face.

If you have a black and white printer like me then now is a good time to decorate your image. I asked to borrow my daughter's coloring pencils. Later she helped me color in with a green crayon which worked well too.

Now glue the image down. Be careful to line it up so that the spindle is in the center and the noon marker is at the top.

7) Put the clock back together. Enjoy your new improved analog clock. Please let me know if you end up making your own clock, and send me a photo.

Tools used: crosshead screwdriver, pliers with metal scissors for snipping the hands, glue for extending the hour hand (I used Araldite), printer, colored pencil/crayon, scissors, image editing software (I used GIMP), glue for the printout (I used Pritt Stick).


Here's a fantastic blog site full of designs for 24-hour clocks:

There's a long history of 24-hour clocks. What motivated me was that the clock obviously evolved from sundials and yet somehow we lost the connection somewhere and made clocks into 12-hour rotations. And the minute and second hands need a different scale completely, which makes it unnecessarily hard to teach kids to read the time from a traditional analog clock.

If you're in the Southern hemisphere then you might be feeling hard done by. But fear not. On this page there is an idea for a Southern hemisphere rotating map clock:

To make that, you'd need to print out the image onto a stiff piece of card and glue the whole thing to the hour hand. Then with the numbers fixed on the clock behind the map will rotate round. You can put an image of the Sun at 12 noon to show which half is daylit.

Here's a high-res image of the Southern hemisphere projection, if you want to use it:

From Clock

You would need some mark on the edge of the map to show the exact time point, like this:

From Clock

A nice side-effect of using the Southern hemisphere is that the time in different places can be read off directly. When it is 9am in Australia you will see immediately that it is 2pm in Alaska. Let me know if you make this sort of clock.

Changing history in a self-consistent universe

Some time ago, my five-year old daughter and I were playing a game, where she had drawn a 'wishing circle' that we could use to make wishes. She went first, and wished for sweets. "Ta-da!" she exclaimed, and pointed on top of the fridge where we had some. I joined in the game, saying that I wished I had a lovely sweet daughter. "Ta-da!" she cried and gave me a hug with her 'loving' face on.

Now, obviously this was just a silly game we were playing. She explained to Mum that it was a pretend wishing circle, not a real one. But later it struck me that this is exactly what having the power to change history would be like in a self-consistent universe. All of our memories would be consistent with the new history, of course, and we wouldn't really believe that we had the power to change history (that would be logically impossible) but still we would try and who knows, maybe we succeeded.

I have no idea what the universe was like before those wishes. I strongly believe that it is better now that a) I have a daughter, and b) she has sweets on top of the fridge.

More: Novikov self-consistency principle

Ready 0.5

It has been an exciting few months developing Ready, our open-source program for exploring continuous cellular automata and reaction-diffusion systems. Version 0.5 has now been released, for Windows, MacOS and Linux. Go and try it out!

One change is that we now support normal (discrete) cellular automata in a more natural way, despite the fact that we're storing floats internally. Here's the OpenCL code for Frank Buss' hexagonal life-life rule:

__kernel void rd_compute(
        __global float* a_in,
        __global float* a_out,
        __global int* neighbor_indices,
        __global float* neighbor_weights,
        const int max_neighbors) 
    const int x = get_global_id(0);

    // count neighbors of each type
    int n1=0,n2=0;
    int offset = x * max_neighbors;
    for(int i=0;i<max_neighbors;i++)
            continue; // not a neighbor
        int y = round(a_in[neighbor_indices[offset+i]]);
        if(y==1) n1++;
        else if(y==2) n2++;

    // update step
    int a = round(a_in[x]);
    if(n1==0 && n2==1 && a==0)  a_out[x] = 2.0f;
    else if(n1==1 && n2==1)     a_out[x] = 1.0f;
    else if(n2==2)              a_out[x] = 1.0f;
    else if(n2==3)              a_out[x] = 2.0f;
    else                        a_out[x] = 0.0f;

Given that this code will run on arbitrary meshes, with a variable number of neighbors, I think it's pretty readable!

Here are some of the cellular automata patterns we now include. Our support for arbitrary meshes means that we can run CA on Penrose tilings - the third image shows a new rule discovered in the last few months that supports gliders.

Here's an animation of that Penrose rule, discovered by Katsunobu Imai:

Another big change is that we now support polyhedral meshes. The most familiar of these are the cubes, but we also support three more kinds, as mentioned in a previous post. You can run cellular automata on them, as well as reaction-diffusion systems. This area is completely unexplored, so let us know what you find! Here's Gray-Scott running on a truncated octahedral honeycomb, contoured at 0.25:

Our use of OpenCL for the rules means that Ready can be programmed to do almost anything. Version 0.5 includes some SmoothLife rules, by Stephan Rafler. A video made by Ready of the SmoothLifeL rule went viral in October 2012, with 130,000 views on YouTube and discussions in several places.

Other rules supporting gliders are now included, such as this 3-chemical reaction-diffusion system discovered in 1999:

Robert Munafo's amazing U-Skate World continues to be an inspiration. Here are some videos showing various gliders, in 2D and 3D:

Here's the full changelist for Ready: changes.html

If you want to keep up with changes to Ready then please join our mailing list.

Let us know if Ready doesn't work on your machine, or if you find any bugs. And please keep us informed of any interesting discoveries you make!

Space-filling polyhedra

There are several interesting tilings in 2D, even if we restrict ourselves to single symmetric convex tiles:

square triangular hexagonal deltille

But in 3D? Until a few days ago I was familiar with only one - the cubes. I knew that none of the other Platonic solids filled space.

With help from Adam Goucher I have now learned about three more space-filling polyhedra:

1. Truncated Octahedra:

truncated octahedra fill space

Thought for a long time to be the densest foam, only beaten in 1993 by the Weaire-Phelan structure (but that uses two different cells).

2. Rhombic Dodecahedra:

rhombic dodecahedra fill space

Rhombi have some very interesting properties.

3. Triakis Truncated Tetrahedra:

triakis truncated tetrahedra fill space

The Voronoi cells of the carbon atoms in diamond are this shape. It's the closest we get to packing regular tetrahedra. It seems that this shape is under-appreciated - there are only a few references to it on the web, and no Wikipedia page yet.

Edit! I've now added Wikipedia pages: 1, 2, which included making this funky animation from a hacked-around bit of POVRay code:

There are other honeycombs but arguably none are as simple or as pleasing as these. The others either use prisms, cells based on prisms, multiple shapes or irregular shapes.

My reason to be interested in this family is that they are the most accessible for running cellular automata on, because each cell has the same shape and the same number of face-neighbors: 14, 12 and 16 respectively. The next version of Ready (0.5) will support polyhedral grids and will have generators for these three.

(The top three renderings were made by exporting VTU files from Ready, applying the Shrink filter in ParaView, then importing as X3D into Blender and rendering with the new Cycles engine.)

time slip

Sometimes it's interesting to pick up on the fleeting thoughts that your brain throws out, before they get processed as nonsense. Here's one that just happened to me:

I went to make some coffee in the kitchen.

1) I noticed that a drawer had been left open. I closed it.

2) After making the coffee I remembered that I needed a knife for my apple, so I opened the drawer and got one out.

My brain now says to me: Maybe you can walk off now without closing the drawer, because you've already closed it. You could walk off without closing it and then look round and it would be closed. Maybe step (1) happened *after* step (2) and you just forgot which order they were in.

Thanks brain!

rcd controlling circuit

This is for the long tail, because Google failed me when we needed it last night.

Our electrical sockets tripped last night. The fuse box trip switches were all still on apart from a special one labelled "RCD controlling circuit". RCD is Residual Current Device. Turns out that one of our appliances (an electric radiator) had developed an earth-neutral fault, where the earth and neutral wires get connected internally. The RCD detects this and trips out. An electrician located the fault and advised us to dispose of the radiator. Problem solved.

This is not our fusebox but it's very similar.

We could have solved this ourselves, however, had we known how to search for RCD faults. We had carefully turned off all the sockets at the wall and were confused when the RCD kept tripping. It wouldn't trip immediately but would take a few minutes. Even more strangely, when we turned various appliances on, sometimes that would trip the RCD immediately. This caused us to think that e.g. our TV was the problem. Other times it tripped when we had turned several appliances on (ones we had decided were OK), as if we were overloading the circuit. But the RCD doesn't detect overloading, that's what the normal trip switches are for.

Googling didn't help us diagnose these symptoms and so I've written this:

How to search for RCD faults in your home:
  • Unplug everything from the sockets (turning them off at the wall isn't enough!). Turn everything else off.
  • Reset the RCD. If it still trips then there's a problem in your wiring and you need an electrician.
  • Plug things in one by one, and wait for the RCD to trip again. Eventually you should be able to find which one is causing the problem. It's tricky, because the problem may not show up immediately, and the appliances interact. But elimination should get you there eventually. Probably the only reliable method is to turn on everything except one thing, and see if the RCD stays on.

Disclaimers: I'm not an electrician, so to be safe you should definitely call one. We are in the UK, so this advice might not apply where you live.

Our electrician was very friendly. We were in the cellar and our 4-year old daughter had come down to watch. The electrician was talking to himself while he tested the circuits in the fuse box, saying "it must be one of these monkeys". And of course my daughter immediately informed him that there weren't any monkeys in there. He conceded the point and suggested that she was a monkey. She said that actually she was a turtle, and it was Mummy that was a monkey. (This is a nickname thing.)

brains versus the exponential

In my 2010 paper on Codd's self-replicating computer I estimated that it would take at least 1000 years for the machine to replicate. If we left it running we might expect it to complete in the year 3010.

But of course computing power is always increasing, so how soon should we expect it to happen?

Moore's law says that computing performance doubles every 18 months. So by now (18 months after the paper came out) the machine should take only 500 years to replicate, completing in 2511.
yearduration (years)completion date

If Moore's law continues to hold, and we ignore any possible developments in software, then running the figures forward the best time to start would be in 2023 when it would take 2 years, giving the earliest expected completion date of 2025. Check back then to see if this came true!

(We could keep the program running and move it onto faster computers each year but this would only save us a couple of years so it's hardly worth bothering, we might just as well wait for Moore's law to catch us up.)

By 2046 (I will be 70) the machine should replicate in 30 minutes, on computers 8 million times faster than today's.

It's interesting to speculate what algorithm advances might lead to self-replication happening earlier than 2025. The hashlife idea that Golly uses is extremely helpful. On stable, repeating structures like the static wiring of Codd's machine the algorithm excels, allowing it to make jumps of millions of timesteps in one go by re-using results from before.

Conceivably this could be beaten by an algorithm that was capable of analysing the function of each component in Codd's design, and making a symbolic representation of how it would work. Such a thing has been used by Heiner Marxen for analysing Turing machines (which are much like 1D cellular automata) in the search for Busy Beavers. He calls them Macro Machines. If someone manages to adapt Macro Machines to work on generic 2D cellular automata then all the work of Codd's machine could happen near-instantly, even on today's machines. Suddenly 1000 years looks a lot closer than before.


We noticed that our camera was recognising pictures of faces in the newspaper to focus on, so I explained how Haar cascades worked - this is the algorithm that cameras use, I understand.

Here's a diagram of some of the Haar features, superimposed on their face locations:

Here's the image from the paper, showing the two top Haar features for a face:

Turtle started copying my diagrams of the Haar features.

We decided to see whether we could sketch a face sufficiently well that the camera would recognise it and focus on it. This face looks great but didn't work.

Adding a mass of hair around this face made it work - the camera identified it as a face. But it hasn't worked in Picasa, they must have different parameters for their face detection.

I was at CVPR in 2001 and will never forget the moment when the speakers turned the video camera on the audience and we saw real-time face recognition for the first time, with a cloud of boxes appearing over our faces. The reaction of the audience (serious academics) was amazing, like a bunch of delighted children, all standing up and waving.