Ready 0.5
Dec. 20th, 2012 | 12:22 pm
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:
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!
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++)
{
if(neighbor_weights[offset+i]<0.0001f)
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!
Link | Leave a comment | Add to Memories | Share
Space-filling polyhedra
Sep. 14th, 2012 | 03:16 pm
There are several interesting tilings in 2D, even if we restrict ourselves to single symmetric convex tiles:

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:

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:

Rhombi have some very interesting properties.
3. Triakis Truncated Tetrahedra:

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.)
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:

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:

Rhombi have some very interesting properties.
3. Triakis Truncated Tetrahedra:

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.)
Link | Leave a comment | Add to Memories | Share
time slip
Feb. 15th, 2012 | 01:10 pm
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!
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!
Link | Leave a comment | Add to Memories | Share
rcd controlling circuit
Jan. 11th, 2012 | 10:27 am
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:
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.)
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.)
Link | Leave a comment | Add to Memories | Share
brains versus the exponential
Nov. 1st, 2011 | 12:33 pm
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.
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.
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.
| year | duration (years) | completion date |
| 2010 | 1000 | 3010 |
| 2011.5 | 500 | 2511 |
| 2013 | 250 | 2263 |
| 2014.5 | 125 | 2140 |
| 2016 | 62.5 | 2079 |
| 2017.5 | 31.3 | 2049 |
| 2019 | 15.6 | 2035 |
| 2020.5 | 7.8 | 2028 |
| 2022 | 3.9 | 2026 |
| 2023.5 | 2.0 | 2025 |
| 2025 | 1.0 | 2026 |
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.
Link | Leave a comment {4} | Add to Memories | Share
Haar
Aug. 15th, 2011 | 11:40 pm
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.
Link | Leave a comment | Add to Memories | Share
topical and Bollywood
Jul. 18th, 2011 | 10:29 pm
We've watched a couple of excellent Indian films recently. Firstly, My Name Is Khan, featuring George W. Bush, Barack Obama and Shahrukh Khan (who actually manages to do some acting, which is astonishing). A study of autism and terrorism.

Secondly, Guru which has Big B's son doing an excellent bit of acting as a Gujurati cloth businessman who has a stroke after getting exposed for corruption but fights back in an excellent courtroom speech climax. Topically it manages to skewer the paradox about big business and corruption, namely that businesses need to get their way to make money for the people whatever the cost, but a country can't allow corruption because everything goes wrong. (Likewise in A Few Good Men where Jack Nicholson points out that we need psychos on the front line to defend us rational people.)

(Normally I would call these films "Bollywood" films but (as an outsider) I'm beginning to think that that term is better reserved for the colourful singing and dancing films. Guru has songs and dancing but maybe it's vestigial and there's a new wave of more thoughtful Indian film-making, harking back to the days of Satyajit Ray and the social conscience of Raj Kapoor.)
(Both of these films recommended by my sister-in-law Pari - thanks!)

Secondly, Guru which has Big B's son doing an excellent bit of acting as a Gujurati cloth businessman who has a stroke after getting exposed for corruption but fights back in an excellent courtroom speech climax. Topically it manages to skewer the paradox about big business and corruption, namely that businesses need to get their way to make money for the people whatever the cost, but a country can't allow corruption because everything goes wrong. (Likewise in A Few Good Men where Jack Nicholson points out that we need psychos on the front line to defend us rational people.)

(Normally I would call these films "Bollywood" films but (as an outsider) I'm beginning to think that that term is better reserved for the colourful singing and dancing films. Guru has songs and dancing but maybe it's vestigial and there's a new wave of more thoughtful Indian film-making, harking back to the days of Satyajit Ray and the social conscience of Raj Kapoor.)
(Both of these films recommended by my sister-in-law Pari - thanks!)
Link | Leave a comment | Add to Memories | Share
making tables with kids
Jul. 13th, 2011 | 12:55 pm
This is a wonderful story:
http://gamesbyemail.com/WoodTape/
Go and read it straight away!
(via mefi)
I've been doing something along these lines myself recently:

Ashi said he wanted to build a table, to learn about how to do it. Mostly I think because he is irrestibly drawn to powertools, like any young person. We found some thick dowels that had been part of a clothes horse, and are cutting them to size in this photo. We're all holding the saw to 'help' which makes it really hard to cut a straight line!



Ashi glueing the underside of the tabletop before screwing.




The finished table. A bit wobbly but fully functional. It has been in constant use ever since as Mnki's bedside table.

http://gamesbyemail.com/WoodTape/
Go and read it straight away!
(via mefi)
I've been doing something along these lines myself recently:
Ashi said he wanted to build a table, to learn about how to do it. Mostly I think because he is irrestibly drawn to powertools, like any young person. We found some thick dowels that had been part of a clothes horse, and are cutting them to size in this photo. We're all holding the saw to 'help' which makes it really hard to cut a straight line!
Ashi glueing the underside of the tabletop before screwing.
The finished table. A bit wobbly but fully functional. It has been in constant use ever since as Mnki's bedside table.
Link | Leave a comment | Add to Memories | Share
Four moral what-ifs
Jul. 8th, 2011 | 05:09 pm
I often catch myself wishing for a science of morality, something to settle thorny political problems once and for all. Clearly this is absurd. However, a few simple what-if questions can map out the territory of possible moralities by signposting different directions. (These aren't the sort of questions that have answers, unless you consider these questions themselves to constitute an answer, which of course is itself a question for you to decide.)
0) What if no-one else is real?
1) What if you'd been born as someone else?
2) What if everyone acted in the same way as you?
3) What if you'd never been born?
These are important questions and it's tempting to suppose that a common set of answers might be the basis for a universal morality. But all of this, even the questions themselves, are rationalising-after-the-event (not to mention pompous): As studies into what's called social intuitionism show, when presented with a moral situation we first have an emotional response, and only afterwards do we (sometimes) think through a logical framework for those feelings. In other words, our morals don't come from a set of moral theories, as one of H. G. Wells' characters points out in Ann Veronica (1909):
Further reading: Kohlberg's_stages_of_moral_development, moral relativism, moral universalism, evolution of morality, evolutionary ethics, science of morality, is-ought problem, value pluralism, truth.
0) What if no-one else is real?
It cannot be established scientifically that our universe is real, by definition, so this has to remain an open question. You are entitled to believe that you are the only real person in a simulation created for your benefit (or as punishment). You may even be right.
1) What if you'd been born as someone else?
It's the lottery of life that some be born into riches and others into poverty. The Veil of Ignorance idea suggests that we should build our social systems upon empathy with the legions of unborn children who have yet to draw a straw, and try to at least create conditions of equal opportunity for them. I think this question more than any other separates us morally - some people just don't accept the premise and answer 'well I wasn't' and suffer inequality to exist.
But if you accept the thought experiment then consider also this: could you have been born as an animal? Or as a plant? If you'd been born as a plant, would it matter to you if you were killed?
2) What if everyone acted in the same way as you?
This is of course the golden rule, expressed as a question. And it's a double-edged sword: not only should you not be selfish but also you needn't be too generous. If everyone gave all of their money away we'd end up in a very horrid world where everyone would have to be a monk and no-one got to do what they wanted. [1]
3) What if you'd never been born?
The rather obvious answer is that the world would have carried on in its usual stumbling historical fashion. But since, undeniably, you have been born, you might as well do something, even if it means having a lazy day in bed.
These are important questions and it's tempting to suppose that a common set of answers might be the basis for a universal morality. But all of this, even the questions themselves, are rationalising-after-the-event (not to mention pompous): As studies into what's called social intuitionism show, when presented with a moral situation we first have an emotional response, and only afterwards do we (sometimes) think through a logical framework for those feelings. In other words, our morals don't come from a set of moral theories, as one of H. G. Wells' characters points out in Ann Veronica (1909):
"There's no sense in morality, I suppose, unless you are fundamentally immoral." textIf there was a science of morality it would have to study this emotional response first and foremost, and evaluate its variation across cultures and across time. For example: does our emotional response to a moral situation change over our lifetime, in response to thinking about questions such as the above, or is it fixed from childhood? Does a baby get its emotional response to a moral situation [2] from its parents or from its genes?
Further reading: Kohlberg's_stages_of_moral_development, moral relativism, moral universalism, evolution of morality, evolutionary ethics, science of morality, is-ought problem, value pluralism, truth.
Link | Leave a comment | Add to Memories | Share
Zooming in on Tycho
Jul. 1st, 2011 | 10:31 am
Here's a picture of the moon. That splat on the bottom is Tycho crater, a relatively young impact.

The crater is about 82 km (51 miles) across. (Bristol to London is about 100 miles. The M25 around London would fit neatly inside the crater.)
The radial lines are exactly what they look like: debris from the impact.
Here's a closeup of the crater:

Impact craters often have a central peak like this, caused by material falling back after being flung out.
Here's a closeup of the peak, which is about 2000m high:

Here's a closeup of the tiny white dot on top, which is a boulder about 100m across.

Here's a closeup of the boulder, taken from above:

Source: http://www.physorg.com/news/2011-06-sunr ise-view-tycho-crater-peak.html

The crater is about 82 km (51 miles) across. (Bristol to London is about 100 miles. The M25 around London would fit neatly inside the crater.)
The radial lines are exactly what they look like: debris from the impact.
Here's a closeup of the crater:

Impact craters often have a central peak like this, caused by material falling back after being flung out.
Here's a closeup of the peak, which is about 2000m high:

Here's a closeup of the tiny white dot on top, which is a boulder about 100m across.

Here's a closeup of the boulder, taken from above:

Source: http://www.physorg.com/news/2011-06-sunr