# Wolfram Function Repository

Instant-use add-on functions for the Wolfram Language

Function Repository Resource:

Implementation of the Busy Boxes 3D reversible cellular automaton

Contributed by:
Nikolay Murzin

ResourceFunction["BusyBoxesAutomaton"][ runs the BusyBoxes cellular automaton rule starting from an initial 3D state | |

ResourceFunction["BusyBoxesAutomaton"][ runs for | |

ResourceFunction["BusyBoxesAutomaton"][ runs for | |

ResourceFunction["BusyBoxesAutomaton"][ runs with an initial integer | |

ResourceFunction["BusyBoxesAutomaton"][ take a single step of the automaton. | |

ResourceFunction["BusyBoxesAutomaton"][ return an explicit list of swap rules for a single step starting from a | |

ResourceFunction["BusyBoxesAutomaton"][ return a 3D visualization for a | |

ResourceFunction["BusyBoxesAutomaton"][ represents an operator form. |

BusyBoxes (BBX) is an implementation of the 3D reversible cellular automata developed by Ed Fredkin and Daniel B. Miller in their 2005 paper, Two State, Reversible, Universal Cellular Automata In Three Dimensions. A preprint is available here.

This function was inspired by the online implementation at busyboxes.org.

The rules of this Cellular Automata are as follows:
- Play takes place on a 3D Cartesian state of cells.
- Each cell in the state is either odd or even, depending on whether the sum of the three coordinates specifying that cell's location in the state is odd or even.
-Cells are either 1 or 0. 1 cells are shown as red if they are even, or blue if they are odd. 0 cells are not shown.
-There are six phases in the evolution of the CA, numbered 0 to 5. During even phases, only even cells are operated on. During odd phases, odd cells are operated on.
-During phase 0 and 3, the planar rule is applied to the XY plane. During phase 1 and 4, it is applied to the YZ plane. During phase 2 and 5, it is applied to the ZX plane.
-The planar rule is this: for each diagonally situated pair of cells on the plane, if a 1 exists at either of the pair's knight's move positions, the value of the two cells in that diagonal pair is swapped. However, this only happens if there is no conflicting swap for either cell.
-The knight's move positions for a diagonal pair of cells are the cells that can be reached from both cells in the pair by moving two in one axis and one in another. A picture helps:

-The X's are the knight's move positions for the pairs of cells represented by asterisks.

Initial state can be either an array of 0s and 1s or a list of explicit positions of 1s. If an array is given swap outside its boundary are not allowed.

Note that since only swaps are allowed, the number of 1's and 0's is fixed for any set of initial conditions. One may think of the BBX CA as a set of rules for moving 1's around on the state.

Initial phase for forward direction is 0.

Running BBX backward with no specified initial phase will automatically choose a phase to undo the same number of steps in forward direction.

Run BusyBoxesAutomaton starting from a random initial condition for a single step:

In[1]:= |

Out[1]= |

Run BusyBoxesAutomaton for 3 steps and visualize it:

In[2]:= |

Out[2]= |

Run BBX for 100 steps and 100 more in reverse:

In[3]:= |

Out[3]= |

Gliders:

In[4]:= |

In[5]:= |

Out[5]= |

In[6]:= |

In[7]:= |

Out[7]= |

Start tracking circular motion:

In[8]:= |

Show the circular motion:

In[9]:= |

Out[9]= |

Compute box traces for all sizes up-to 100:

In[10]:= |

Out[10]= |

Plot circularity dependency on the number of boxes measured as standard deviation of average radius for each step:

In[11]:= |

Out[11]= |

Which proves Miller and Fredkin hypothesis wrong of circularity monotonically decreasing to zero. They've only computed this curve up-to 20 boxes, but the minimum is at 43.

- BUSY BOXES
- [nlin/0501022] Two-state, Reversible, Universal Cellular Automata in Three Dimensions
- [1206.2060] Circular Motion of Strings in Cellular Automata, and Other Surprises

Wolfram Language 13.0 (December 2021) or above

- 1.1.0 – 18 August 2023
- 1.0.0 – 07 August 2023

This work is licensed under a Creative Commons Attribution 4.0 International License