Basic Examples (2)
Basic Examples
(2)
Sample evolution of a symbolic system:
In[3]:=
Out[3]=
e[e[e][e]][e][e] |
e[e][e][e[e]][e[e][e]][e] |
e[e[e]][e][e[e]][e[e[e]][e]][e] |
e[e][e[e]][e[e]][e[e]][e[e][e[e]][e[e]]][e] |
e[e[e[e]]][e][e[e]][e[e]][e[e[e[e]]][e][e[e]]][e] |
e[e[e]][e[e]][e[e[e]]][e[e]][e[e]][e[e[e]][e[e]][e[e[e]]][e[e]]][e] |
———
Define the auxiliary function :
ToBrackets
In[9]:=
ToBrackets[rule_,init_,steps_]:=Module{e},StringSplit[StringReplace[ToString[#1],"e"->""],""]&/@[rule,init,steps];
In[10]:=
ToBrackets[e[x_][y_]x[e[y]][x],e[e[e][e]][e][e],5]//Column
Out[10]=
{[,[,],[,],],[,],[,]} |
{[,],[,],[,[,],],[,[,],[,],],[,]} |
{[,[,],],[,],[,[,],],[,[,[,],],[,],],[,]} |
{[,],[,[,],],[,[,],],[,[,],],[,[,],[,[,],],[,[,],],],[,]} |
{[,[,[,],],],[,],[,[,],],[,[,],],[,[,[,[,],],],[,],[,[,],],],[,]} |
{[,[,],],[,[,],],[,[,[,],],],[,[,],],[,[,],],[,[,[,],],[,[,],],[,[,[,],],],[,[,],],],[,]} |
Steps versus step lengths:
In[11]:=
ListLinePlotLength/@ToBrackets[e[x_][y_]x[e[y]][x],e[e[e][e]][e][e],37],FillingAxis,AspectRatio
1
4
Out[11]=
Plot the evolution of the symbolic system:
In[12]:=
Module{evolved=ToBrackets[e[x_][y_]x[e[y]][x],e[e[e][e]][e][e],5]},GraphicsFlattenTableBlack,EdgeForm[Thin],evolvedji/.{"]"White,"[",Rectangle[{i-1,1-j},{i,2-j}],evolvedji/.{"]","[",TextStyle[evolved〚j〛〚i〛,FontSize8],(2i-1),(3-2j),{j,Length[evolved]},{i,Length[evolved〚j〛]}
1
2
1
2
Out[12]=
In[13]:=
Module[{evolved=ToBrackets[e[x_][y_]x[e[y]][x],e[e[e][e]][e][e],37]},ArrayPlot[evolved/.{"]"0,"["1},PixelConstrained5,ColorRules{0LightGray,1Black},FrameFalse]]
Out[13]=