Skip to content

Turing Drawings

December 31, 2012
turing2d

After watching a documentary about Alan Turing, I started thinking about Turing machines again. They’re a very useful tool for computer science proofs and an elegantly simple computational model. Beyond this, however, Turing machines seem relatively useless in terms of “real-world” applications. Any computable function can be computed by a Turing machine, but you probably wouldn’t want to use one as a compilation target: it would be too inefficient.

One possible application for Turing machines is to use them as programs to generate data procedurally. Their simplicity makes it possible, for example, to create working programs randomly. Generating a random stream of x86 instructions that doesn’t crash could be tricky, but with a Turing machine, it’s quite easy. I decided to try something like this to produce so-called generative art. The program I wrote generates random Turing machines that operate on a two-dimensional grid instead of a one-dimensional tape. The symbols written on the grid can be interpreted as colors, and voilà: we have procedural drawings.

I prototyped this in JavaScript and named the project Turing Drawings. This is available on GitHub if you’re interested in seeing the source code. Better yet, I put a live demo up on GitHub pages (first time trying gh-pages, works great!) and I started collecting a list of interesting patterns produced by Turing Drawings:

Last night, by chance, I randomly generated something that looked very much like the Sierpinski fractal, but unfortunately lost the encoding for that one. If you happen to find fractal patterns, be sure to let me know!

EDIT: seems the people on reddit.com/r/compsci have gotten pretty excited about this. I’m surprised at how much of a positive response I got. Here are some of the nicest patterns they’ve found:

For future work, I’m thinking it might be interesting to try using Turing machines to generate music procedurally. Certainly, music could be represented by notes on a tape, or even multiple tapes.

19 Comments
    • A binary counter, fascinating. I feel like the algorithm for counting in binary is quite “natural” in its simplicity, in a sense. The fact that we can randomly stumble upon it sort of proves that point.

      Funnily enough, I made this electronic circuit just 2 days ago:

Trackbacks & Pingbacks

  1. Dibujos hechos a partir del concepto de máquinas de Turing [ENG]
  2. More Fun with Turing Machines « Pointers Gone Wild
  3. Turing Drawings ∴ HODGE
  4. Nerdcore › Turing Drawing Machines
  5. Turing Drawings Followup | Pointers Gone Wild
  6. Generate Turing Drawings & Turing Tunes - ikono
  7. Dogfooding Higgs with the Turing Turtle | Pointers Gone Wild

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Follow

Get every new post delivered to your Inbox.

Join 2,715 other followers

%d bloggers like this: