The Hodgepodge Machine
“The pleasure of complexity… the inconceivable nature of nature” - Richard Feynmann
Back in the 80s, my Dad used to work as a security guard at a geothermal energy research site and sometimes I would accompany him on his rounds. The facility was well funded and very advanced for its time and there was all kinds of computer equipment which was at that time both fascinating and alien to me. There was also a collection of science and technology magazines and sometimes I would read them for hours.
The magazines I liked most were Computer Weekly and Scientific American. I liked them mostly for their programming sections. Back in those pre-internet days it was common for the articles to include listings, mostly in Fortran, BASIC and maybe Pascal and even AssemblerYep, we used to type machine code by hand! . That’s how I learned to code.
One article I remember particularly fondly was in Scientific American’s Computer Recreations section with the caption “The hodgepodge machine makes waves“Dewdney, A. (1988). COMPUTER RECREATIONS. Scientific American, 259(2), 104-107. Retrieved from http://www.jstor.org/stable/24989205 . The date was August 1988. It described a set of rules which mimicked a type of chemical reaction, the so called Belousov-Zhabotinsky reaction, and resulted in fantastic shapes and behaviours emerging almost like magic. I was able to reproduce that at the time on my Amstrad CPC even though it took ages to update each frame. It was one of my first programming successes.
A few weeks ago one of my colleagues at Codurance wrote an article called Nature in Code where she simulated biological interactions in code and how interesting phenomena emerge naturally. It reminded me of the Hodgepodge Machine and inspired me to try it again with more modern techniques (thank you Solange). So I sat down this morning, and with a little help from this blog post, wrote it in Julia. This is the result.
Compare that to this real reaction:
This ties in with recent work I’ve been doing on dynamical systems and complexity. The hodgepodge machine is a dynamical system: deterministic but, under certain conditions, totally unpredictable.
As Feynman said, “And it’s all really there…but you’ve got to stop and think about it to really get the pleasure about the complexity; the inconceivable [he chuckles] nature of nature.”.
Code is on GitHub here.