Function Repository Resource:

TagSystem

Source Notebook

Compute the evolution of a tag system

Contributed by: Stephen Wolfram

ResourceFunction["TagSystem"][{n,rule},init,t]

generates a list representing the evolution of the tag system with the specified rule, where n elements are removed from the beginning of the sequence starting from initial condition init for t steps.

Details and Options

The rules for a tag system are given as a list of elements of the form {i1rhs1,i2rhs2,} where in are integers and the rhsn are the replacing integers or an empty list.

Examples

Basic Examples (3) 

Five steps in the evolution of a tag system:

In[1]:=
ResourceFunction[
 "TagSystem"][{1, {{0} -> {1, 0}, {1} -> {0, 1}}}, {1}, 5]
Out[1]=

Plot the evolution of a tag system:

In[2]:=
ArrayPlot[
 ResourceFunction[
  "TagSystem"][{1, {{0} -> {1, 0}, {1} -> {0, 1}}}, {1}, 20], ColorRules -> {0 -> Gray, 1 -> Black}, Mesh -> False]
Out[2]=

Rules from A New Kind of Science, page 93:

In[3]:=
rules1 = {{{0} -> {1, 0}, {1} -> {1, 0}}, {{0} -> {0, 1}, {1} -> {1, 0}}, {{0} -> {0, 1}, {1} -> {0}}};
In[4]:=
ArrayPlot[#, ColorRules -> {0 -> Gray, 1 -> Black}, Mesh -> False] & /@ (ResourceFunction["TagSystem"][{1, #}, {1}, 20] & /@ rules1)
Out[4]=

Rules from A New Kind of Science, page 94:

In[5]:=
rules2 = {{{0, 0} -> {1, 1}, {1, 0} -> {}, {0, 1} -> {1, 0}, {1, 1} -> {0, 0, 0}}, {{0, 0} -> {}, {1, 0} -> {1}, {0, 1} -> {1, 1}, {1, 1} -> {1, 1, 0}}, {{0, 0} -> {0}, {1, 0} -> {1, 0, 1}, {0, 1} -> {0, 0, 0}, {1, 1} -> {0, 1, 1}}, {{0, 0} -> {0, 1}, {1, 0} -> {1, 0, 0}, {0, 1} -> {0}, {1, 1} -> {1, 0, 0}}, {{0, 0} -> {1, 0}, {1, 0} -> {1}, {0, 1} -> {0, 1, 0}, {1, 1} -> {0, 0, 1}}, {{0, 0} -> {0}, {1, 0} -> {0, 1, 0, 1}, {0, 1} -> {0, 0}, {1, 1} -> {1, 1, 1, 0}}};
In[6]:=
ArrayPlot[#, ColorRules -> {0 -> Gray, 1 -> Black}, Mesh -> False] & /@ (ResourceFunction["TagSystem"][{2, #}, {1, 1}, 110] & /@ rules2)
Out[6]=

Total lengths for rules from A New Kind of Science, page 94:

In[7]:=
ListLinePlot[
   Length /@ ResourceFunction["TagSystem"][{2, #}, {1, 1}, 1000], Filling -> Axis, AspectRatio -> 1/4] & /@ rules2
Out[7]=

Requirements

Wolfram Language 11.3 (March 2018) or above

Version History

  • 1.0.0 – 21 February 2019

Source Metadata

License Information