
Cryptography with Cellular Automata (1985) [pdf] - Cieplak
http://www.stephenwolfram.com/publications/academic/cryptography-cellular-automata.pdf
======
JoeDaDude
Anyone wanting to tinker with Cellular Automata may be interested in Golly
[1], an open source cellular automata simulator which allows you to play with
different neighborhoods and rules and see the results.

[1]. [http://golly.sourceforge.net/](http://golly.sourceforge.net/)

------
0xFFC
Can anybody explain concepts of Cellular Automata?

I am familiar with DFA, NFAs. But I always had problem understanding Cellular
Automata and it’s usage.

~~~
Jtsummers
Each cell can be thought of as its own finite automaton in the DFA/NFA sense.
A cell has some properties: current state, set of states, set of transition
functions, input alphabet. Like how a typical FA receives inputs from
_somewhere_ (for example, with regular expressions, an input string), your
cells in a CA will also receive input: the states of the (usually immediate)
neighbors.

Consider a simple 1d cellular automata. It's either _dead_ (0) or _alive_ (1).
It has a simple set of rules:

If both neighbors are _dead_ , it will become _dead_.

If both neighbors are _alive_ and it is _dead_ , it will become _alive_.

If both neighbors are _alive_ and it is _alive_ , it will become _dead_.

If one neighbor is _alive_ and the other _dead_ , its state is unchanged.

So there are 2 states ( _dead_ /0, _alive_ /1), and 2 sources of input which
can be put into a 2-tuple in _{0,1}x{0,1}_ , becoming a single input.

Putting this into a typical tabular format since diagrams are hard in ascii:

    
    
           | dead | alive |
      =====================
      (0,0)| dead | dead  |
      (0,1)| dead | alive |
      (1,0)| dead | alive |
      (1,1)| alive| dead  |
    

So at the basic level (you can add more complexity) a cellular automata is a
collection of finite automata operating on the same rules and transitioning
simultaneously, but using each other's states as their inputs.

The Game of Life rules are a roughly the same but extends the automata to 2d
so that each has 8 neighbors, resulting in an input being an 8-tuple. Becoming
alive, staying alive, and dying change in the number of neighbors required for
each.

~~~
DonHopkins
Great explanation and examples! But to be pedantic, a cell only has one
property: its current state. The set of states, transition rules, etc are
properties of the rule itself.

The point you made about transitioning simultaneously is very important: "So
at the basic level (you can add more complexity) a cellular automata is a
collection of finite automata operating on the same rules and _transitioning
simultaneously_ , but using each other's states as their inputs."

That means you can't serially apply the rule to the cells "in place" \-- each
cell needs to know the value of its neighbors at the same point in time, so if
you serially scan top/bottom left/right over the cells, and change each of
their values according to the values of their adjacent cells in memory at the
time, the inputs to the rule will be incorrect, straddling values from the
previous time step (below and to the right) and the current time step (above
and to the left). So you have to double buffer the cells, and read ALL the
rule inputs of each cell from the previous time step buffer, then write them
into the next time step buffer.

If you implement in-place Life without double buffering, it will look and
behave kind of like Life, but strangely mutated, and none of the gliders or
other patterns will work properly, because the rule inputs are skewed in time.

The Moveable Feast Machine I described in another posting is not technically a
cellular automata, because it's asynchronous, and relaxes the requirement that
all cells transition simultaneously, and it only requires that no two
overlapping neighborhoods may be computed at the same time.

So with MFMs, double buffering is not necessary, and you don't have to pay for
synchronization (which is extremely expensive) if you don't need it (or you
can just pay for as much as you need, a la carte). The point of Moveable Feast
is robust computing on massively parallel unreliable hardware, which is
practically impossible with Cellular Automata's strict synchronization
requirements.

There are different ways of classifying Cellular Automata rules, and defining
one kind in terms of another kind.

For example, Life and Anneal (a "twisted majority rule") are both "Counting
Rules" because they can be reduced to simply counting the number of neighbors,
then using a look-up table or logic to determine the next state based purely
on the sum of the number of neighbors (which may or may not include the center
cell). Not all CA rules are counting rules, though.

[https://en.wikipedia.org/wiki/Life-
like_cellular_automaton](https://en.wikipedia.org/wiki/Life-
like_cellular_automaton)

You can enumerate all possible rules (for a given set of inputs or
"neighborhood") and refer to them by their rule number, an index into all
possible rules of that type (the value of the lookup table as a binary
number). That's what Wolfram means when he refers to "Rule 30", which is a
particularly interesting two-dimensional "elementary cellular automaton".
Golly has some formats for compactly enumerating and specifying rules.

[http://mathworld.wolfram.com/Rule30.html](http://mathworld.wolfram.com/Rule30.html)

[https://imgur.com/a/lKAbP](https://imgur.com/a/lKAbP)

[https://en.wikipedia.org/wiki/Elementary_cellular_automaton](https://en.wikipedia.org/wiki/Elementary_cellular_automaton)

[https://en.wikipedia.org/wiki/Golly_(program)](https://en.wikipedia.org/wiki/Golly_\(program\))

[https://github.com/gollygang/ruletablerepository/wiki/TheRul...](https://github.com/gollygang/ruletablerepository/wiki/TheRules)

Each rule is defined in terms of a certain "neighborhood" of inputs.

A "neighborhood" is the set of adjacent cells that the rule may depend on.
It's like a "kernel" from signal processing.

Classic 2D neighborhoods include the 9-neighbor (including center) 8-connected
Moore Neighborhood (NW N NE W C E SW S E), used by Life for example:

[https://en.wikipedia.org/wiki/Moore_neighborhood](https://en.wikipedia.org/wiki/Moore_neighborhood)

The 5-neighbor 4-connected von Neumann neighborhood (N W C E S), used by John
von Neumann's 29 state cellular automata rule for example:

[https://en.wikipedia.org/wiki/Von_Neumann_neighborhood](https://en.wikipedia.org/wiki/Von_Neumann_neighborhood)

The 4-neighbor rotationally symmetrical Margolus Neighborhood (C OPP CW CCW),
use by billiard ball and reversible rules for example:

[https://en.wikipedia.org/wiki/Block_cellular_automaton](https://en.wikipedia.org/wiki/Block_cellular_automaton)

Rules may also depend on additional inputs like the temporal phase
(alternating 0/1 over two steps for two-phase rules, repeating 00/01/10/11
over four steps for four phase rules, etc), the spatial phase (low bit(s) of
the x and y cell coordinates), and even corresponding cells from other rules
run in parallel or video input.

For example, you can define the Margolus neighborhood in terms of the Moore
neighborhood by using the temporal, horizontal and vertical phase to determine
which cell is "opposite", "clockwise" or "counter clockwise". You use the time
phase to alternate between two overlapping checkerboards of 2x2 cell blocks.
Within each checkerboard you use the horizontal and vertical phase to
determine whether to look left, right, up or down or diagonally to get the
clockwise, counter clockwise or opposite cell in the 2x2 block.

[https://github.com/SimHacker/CAM6/blob/master/javascript/CAM...](https://github.com/SimHacker/CAM6/blob/master/javascript/CAM6.js#L4334)

------
DonHopkins
If you like Wolfram's state transition diagrams in figure 2, you'll love
Andrew Wuensche and Mike Lesser published a gorgeous coffee table book
entitled "The Global Dynamics of Cellular Automata".

I wrote some stuff in an earlier discussion about how the state transition
diagrams in that book illustrate "Garden of Eden" configurations and "Basins
of Attraction", to which I'll link and repeat here:

[https://news.ycombinator.com/item?id=14468707](https://news.ycombinator.com/item?id=14468707)

There's a thing called a "Garden of Eden" configuration that has no
predecessors, which is impossible to get to from any other possible state.

For a rule like Life, there are many possible configurations that must have
been created by God or somebody with a bitmap editor (or somebody who thinks
he's God and uses Mathematica as a bitmap editor, like Stephen Wolfram ;),
because it would have been impossible for the Life rule to evolve into those
states. For example, with the "Life" rule, no possible configuration of cells
could ever evolve into all cells with the value "1".

[https://en.wikipedia.org/wiki/Garden_of_Eden_(cellular_autom...](https://en.wikipedia.org/wiki/Garden_of_Eden_\(cellular_automaton\))

For a rule that simply sets the cell value to zero, all configurations other
than pure zeros are garden of eden states, and they all lead directly into a
one step attractor of all zeros which always evolves back into itself, all
zeros again and again (the shortest possible attractor loop that leads
directly to itself).

There is a way of graphically visualizing that global rule state space, which
gives insight into the behavior of the rule and the texture and complexity of
its state space!

Andrew Wuensche and Mike Lesser published a gorgeous coffee table book
entitled "The Global Dynamics of Cellular Automata" that plots out the
possible "Garden of Eden" states and the "Basins of Attraction" they lead into
of many different one-dimensional cellular automata like rule 30.

[http://uncomp.uwe.ac.uk/wuensche/gdca.html](http://uncomp.uwe.ac.uk/wuensche/gdca.html)

The beautiful color plates begin on page 79 in the free pdf file:

[http://uncomp.uwe.ac.uk/wuensche/downloads/papers/global_dyn...](http://uncomp.uwe.ac.uk/wuensche/downloads/papers/global_dynamics_of_CA.pdf)

I've uploaded the money shots to imgur:

[http://imgur.com/gallery/s3dhz](http://imgur.com/gallery/s3dhz)

Those are not pictures of 1-d cellular automata rule cell states on a grid
themselves, but they are actually graphs of the abstract global state space,
showing merging and looping trajectories (but not branching since the rules
are deterministic -- time flows from the garden of eden leaf tips around the
perimeter into (then around) the basin of attractor loops in the center,
merging like springs (GOE) into tributaries into rivers into the ocean (BOA)).

The rest of the book is an atlas of all possible 1-d rules of a particular
rule numbering system (like rule 30, etc), and the last image is the legend.

He developed a technique of computing and plotting the topology network of all
possible states a CA can get into -- tips are "garden of eden" states that no
other states can lead to, and loops are "basins of attraction".

Here is the illustration of "rule 30" from page 144 (the legend explaining it
is the last photo in the above album). [I am presuming it's using the same
rule numbering system as Wolfram but I'm not sure -- EDIT: I visually checked
the "space time pattern from a singleton seed" thumbnail against the
illustration in the article, and yes it matches rule 30!]

[http://imgur.com/a/lKAbP](http://imgur.com/a/lKAbP)

"The Global Dynamics of Cellular Automata introduces a powerful new
perspective for the study of discrete dynamical systems. After first looking
at the unique trajectory of a system's future, an algoritm is presented that
directly computes the multiple merging trajectories of the systems past. A
given cellular automaton will "crystallize" state space into a set of basins
of attraction that typically have a topology of trees rooted on attractor
cycles. Portraits of these objects are made accessible through computer
generated graphics. The "Atlas" presents a complete class of such objects, and
is inteded , with the accompanying software, as an aid to navigation into the
vast reaches of rule behaviour space. The book will appeal to students and
researchers interested in cellular automata, complex systems, computational
theory, artificial life, neural networks, and aspects of genetics."

[https://en.wikipedia.org/wiki/Attractor](https://en.wikipedia.org/wiki/Attractor)

"Basins of attraction in cellular automata", by Andrew Wuensche:

[http://onlinelibrary.wiley.com/doi/10.1002/1099-0526(200007/...](http://onlinelibrary.wiley.com/doi/10.1002/1099-0526\(200007/08\)5:6%3C19::AID-
CPLX5%3E3.0.CO;2-J/full)

"To achieve the global perspective. I devised a general method for running CA
backwards in time to compute a state's predecessors with a direct reverse
algorithm. So the predecessors of predecessors, and so on, can be computed,
revealing the complete subtree including the "leaves," states without
predecessors, the so-called “garden-of-Eden" states.

Trajectories must lead to attractors in a finite CA, so a basin of attraction
is composed of merging trajectories, trees, rooted on the states making up the
attractor cycle with a period of one or more. State-space is organized by the
"physics" underlying the dynamic behavior into a number of these basins of
attraction, making up the basin of attraction field."

If you like the book, you'll love the code!

[http://www.ddlab.com/](http://www.ddlab.com/)

[http://www.ddlab.com/screensave3.png](http://www.ddlab.com/screensave3.png)

[http://uncomp.uwe.ac.uk/wuensche/2006_ddlab_slides1.pdf](http://uncomp.uwe.ac.uk/wuensche/2006_ddlab_slides1.pdf)

[http://uncomp.uwe.ac.uk/wuensche/meta.html](http://uncomp.uwe.ac.uk/wuensche/meta.html)

[http://uncomp.uwe.ac.uk/wuensche/boa_idea.html](http://uncomp.uwe.ac.uk/wuensche/boa_idea.html)

[http://uncomp.uwe.ac.uk/wuensche/downloads/papers/2008_dd_ov...](http://uncomp.uwe.ac.uk/wuensche/downloads/papers/2008_dd_overview_preprint.pdf)

------
hankenstein
The subjective similarity between the randomness generated by CA and the
distribution of prime numbers is uncanny. There's got to be some CA that
generates them.

~~~
marksellers
Prime number calculator in Game of Life:
[https://www.youtube.com/watch?v=68nEX5CEmZE](https://www.youtube.com/watch?v=68nEX5CEmZE)

------
robmay
Is there a use here for blockchains? Could you link block to block with a CA
function or would that be weaker than the current approach that bitcoin uses?

