Skip to content

Turing Drawings Followup

May 15, 2013

Late last night, I was surprised when a friend informed me that a fork of my Turing Drawings project had made its way to the front page of Hacker News. The fork by Darius Bacon includes new features such as the ability to make the rendering faster or slower, as well as a new backend which compiles the Turing machines to asm.js instead of interpreting them, offering impressive speedups. The Hacker News community responded with great enthusiasm and found many interesting drawings, some of which I’ve collected below:

Posters also contributed interesting bits of information. It seems that the idea behind Turing Drawings is not entirely new, but rather an independent re-discovery of an existing formalism called a Turmite, with a finite tape instead of an infinite one. Another poster had the following insight:

The world is finite, so every drawing eventually loops. However, the state space is something like k * 2^18 * n^(2^18), where k is the number of states and n the number of symbols. For the default (4, 3) this is 3.125 * 10^125080, so you could be waiting for a while :)

Someone associated with Wolfram even suggested that it may be possible to participate in a summer school project involving 2D Turing Machines:

Wolframite here: these would make a good summer school project for our summer school (plug: the 2013 one is coming up, apply at https://www.wolframscience.com/summerschool/ if you’re interested in this kind of stuff and want to do a 3-week project).

In fact I studied the space-filling behavior of precisely these 2D Turing machines in 2009. For low numbers of states and colors you can enumerate them exhaustively and calculate the distribution of space-filling efficiency (log-normal, if anyone is interested).

The full spectrum of behavior is quite fascinating to catalog. All these kinds of simple computational system have a character and ‘zaniness’ all their own.

The idea behind Turing Drawings came to me while pondering generative art. I had already experimented with various approaches, such as plotting mathematical functions of two-variables, but had little success in creating interesting patterns. Intuitively, it seemed that Turing machines would be an ideal formalism because, even if they were randomly generated in a naive fashion, they would have a high likelihood of creating complex (and potentially interesting) visual patterns as a side effect of their computational process.

Users of Turing Drawings may find themselves clicking the “random” button many times before seeing anything interesting, but through the power of crowdsourcing, it becomes possible to explore hundreds of thousands of patterns in a relatively short time. Turing Drawings is a toy, but it’s interesting to observe the dynamics of chaos and entropy at play, and to see order come out of randomness and very simple rules.

It’s the first time one of my hobby projects gathers so much attention online (even foreign blogs are covering it :)). I’m happy to see that by making it open source, it’s been possible for Turing Drawings to take on a life of its own. Someone has already informed me that they were interested in adding features to visualize the transitions and better analyze the behavior of the machines. I anticipate that after the Hacker News coverage, more forks are likely to occur.

In case anyone is interested, I should also mention that I tried to apply the idea of Turing Drawings to procedural music generation, with moderate success. The project is called Turing Tunes, and is also open source.

EDIT: Turing Drawings was also covered on MetaFilter and on ikono‘s art blog.

4 Comments
  1. Foreign-Blog-Dude here ;)

    Well done, very interesting work and I wouldn’t call the Turing Tunes “moderate”. Generative Music is a thing, actually, and combining this with Turing Machines is awesome. One should combine this with a sampler and there you go: A Turing Autechre-Thingy. :D

  2. Ibniz is also worth a look. http://pelulamu.net/ibniz/

    It’s a stack based vm where pixel coordinates are pushed on the stack and whatever is on the stack when the code finishes goes on screen.

    Also does music which, while cool, makes it a pain to code for.

  3. David Brooks Pokorny permalink

    Thank you for this, it is beautiful and fascinating! There are a couple of ways to alter the experience, or rather, have the user spend more time looking at fascinating evolutions vs. clicking on “random/mutate” repeatedly in the hopes of finding a particularly complex one. The first is to use visitor data and assign a value that could be called “complexity” based on the amount of time the visitor spends looking at it. Also, clicking “slower”, “faster”, or “restart” is an indication that the visitor finds the animation more complex. So all of this data (if it is sent back to the server and logged) can be used to estimate the visitor’s interest, which can then be fed back into the user experience via a “top 10 most complex machines seen in the last week” or something like this.

    The second is an offline approach: for each machine description and each frame, the tape state can be compressed using something like gzip (or a lossy summary), then the size of the resulting file recorded. The point is to produce a scalar time series statistic (sizes of compressed frames), then look for qualitative changes in behavior evidenced by a sudden increase or decrease. It might be necessary to smooth (http://en.wikipedia.org/wiki/Smoothing) the time series first to eliminate noise.

    Some machines are “multi-modal” in the sense of filling the square with one type of pattern, and only after that pattern has taken over does a new pattern start to emerge, which then slowly takes over. The point is that the time series statistic can be used to find such multi-modal/multi-phase examples. For example this one looks like grass in the wind, but one must wait a long time (or have good timing in clicking faster/slower) in order to see it, and even then the effect only lasts for a little while.

    http://wry.me/hacking/Turing-Drawings/#4,3,0,1,1,1,2,1,2,1,0,2,1,0,3,1,1,3,1,2,1,1,1,2,2,1,2,1,2,1,2,3,2,1,0,0,1,3

    In this particular case it would be handy to have a checkbox “automatically reduce speed when things start to get interesting”

    In addition, users may find it interesting to explore not only the “raw” visual data of the tape state but also derivations of this. For example, instead of coloring each pixel according to the mark it holds, color it with value according to exp(alpha*(-)). This produces a sort of “heat map” of where the head of the machine has last changed the tape mark. The alpha would then be tuned by the user to see a longer or shorter trail.

Trackbacks & Pingbacks

  1. Dogfooding Higgs with the Turing Turtle | Pointers Gone Wild

Leave a comment