In[]:=
MultiwayGrowthList[{"""A","""B"},{""},10,10000]
In[]:=
RandomMWRule[sig_,k_Integer]:=With[{ab=ToUpperCase[FromLetterNumber[Range[k]]]},Map[StringJoin[RandomChoice[ab,#]]&,sig,{2}]]
In[]:=
RandomMWRule[{24},2]
Out[]=
{BBABBA}
In[]:=
RandomMWRule[{24,51,35},2]
Out[]=
{ABBABA,BABAAA,ABAAAAAA}
In[]:=
ParallelMapMonitored[#Length/@MultiwayGrowthList[#,{"ABAA"},50,10000]&,Table[RandomMWRule[{24,51,35},2],100]]
Out[]=
In[]:=
FindLinearRecurrence[{1,2,3,6,10,15,23,32,44,58,74,93,116,140,168,199,232,268,307,348,392,439,488,540,595,652,712,775,840,908,979,1052,1128,1207,1288,1372,1459,1548,1640,1735,1832,1932,2035,2140,2248,2359,2472,2588,2707,2828,2952}]
In[]:=
FindSequenceFunction[{1,2,3,6,10,15,23,32,44,58,74,93,116,140,168,199,232,268,307,348,392,439,488,540,595,652,712,775,840,908,979,1052,1128,1207,1288,1372,1459,1548,1640,1735,1832,1932,2035,2140,2248,2359,2472,2588,2707,2828,2952},n]
Out[]=
$Aborted
In[]:=
Differences[{1,2,3,6,10,15,23,32,44,58,74,93,116,140,168,199,232,268,307,348,392,439,488,540,595,652,712,775,840,908,979,1052,1128,1207,1288,1372,1459,1548,1640,1735,1832,1932,2035,2140,2248,2359,2472,2588,2707,2828,2952},2]
Out[]=
{0,2,1,1,3,1,3,2,2,3,4,1,4,3,2,3,3,2,3,3,2,3,3,2,3,3,2,3,3,2,3,3,2,3,3,2,3,3,2,3,3,2,3,3,2,3,3,2,3}
In[]:=
ListLinePlot[%]
Out[]=
In[]:=
MWSequenceTest[list_]:=Catch[Do[If[Length[Union[Differences[list,n]]]<10,Throw["Differences"->n]],{n,0,4}];With[{r=FindLinearRecurrence[Drop[list,4]]},If[Head[r]===List,Throw["Recurrence"->r]]];With[{r=FindTransientRepeat[list,5]},If[Length[r[[1]]]<Length[list]/10,Throw["Repeat"r]];"Interesting"]]
In[]:=
MWSequenceTest[None]:=None
ParallelMapMonitored[#Length/@MultiwayGrowthList[#,{"ABAA"},50,10000]&,Table[RandomMWRule[{24,51,35},2],100]]
In[]:=
MWSequenceTest/@Last/@%231
Out[]=
In[]:=
Counts[%]
Out[]=
None35,(Differences0)56,(Differences2)3,(Differences1)6
ParallelMap
In[]:=
Length/@MultiwayGrowthList[{"ABA""BBAA","BAA""AAB"},{"BABBAAB"},300,10000]
Out[]=
In[]:=
Differences[%]
Out[]=
In[]:=
ListLinePlot[%]
Out[]=
Trials
Trials
Bigger cases
Bigger cases
NOTE: REMOVE THE Catenate !!!