1D cellular automata in Python using itertools and dictionaries for speed, numpy and matplotlib for magic.