WOLFRAM NOTEBOOK

Generalized 1D Case

In[]:=
Table[ArrayPlot[CenterArray[AggregationArrayData[{1}][If[FailureQ[#],#["Data"],#]&/@RandomAggregation[{Association[Thread[RandomSample[Rest[Tuples[{0,1},4]],6]->True]],{{-2},{-1},{1},{2}}},{{0}},50]],{50,50}],ImageSize->{100,100}],10]
Out[]=
,
,
,
,
,
,
,
,
,
Table[ArrayPlot[CenterArray[AggregationArrayData[{1}][If[FailureQ[#],#["Data"],#]&/@RandomAggregation[{Association[Thread[RandomSample[Rest[Tuples[{0,1},4]],6]->True]],{{-1},{1}}},{{0}},50]],{50,50}],ImageSize->{100,100}],10]
In[]:=
Association[Thread[RandomSample[Rest[Tuples[{0,1},4]],6]->True]]
Out[]=
{0,1,0,1}True,{0,1,1,1}True,{0,1,1,0}True,{1,1,1,0}True,{1,1,0,0}True,{1,0,1,1}True
In[]:=
ArrayPlot[CenterArray[AggregationArrayData[{1}][If[FailureQ[#],#["Data"],#]&/@RandomAggregation[{#,{{-1},{1}}},{{0}},50]],{50,50}],ImageSize->{100,100}]&/@Rest[Association/@Map[#->True&,Subsets[Tuples[{1,0},2]],{2}]]
Out[]=
,
,
,
,
,
,
,
,
,
,
,
,
,
,
In[]:=
ArrayPlot[CenterArray[AggregationArrayData[{1}][If[FailureQ[#],#["Data"],#]&/@RandomAggregation[{#,{{-1},{1}}},{{0},{1}},50]],{50,50}],ImageSize->{100,100}]&/@Rest[Association/@Map[#->True&,Subsets[Tuples[{1,0},2]],{2}]]
Out[]=
,
,
,
,
,
,
,
,
,
,
,
,
,
,
In[]:=
Association/@Map[#->True&,Subsets[Tuples[{1,0},2]],{2}]
Out[]=
{,{1,1}True,{1,0}True,{0,1}True,{0,0}True,{1,1}True,{1,0}True,{1,1}True,{0,1}True,{1,1}True,{0,0}True,{1,0}True,{0,1}True,{1,0}True,{0,0}True,{0,1}True,{0,0}True,{1,1}True,{1,0}True,{0,1}True,{1,1}True,{1,0}True,{0,0}True,{1,1}True,{0,1}True,{0,0}True,{1,0}True,{0,1}True,{0,0}True,{1,1}True,{1,0}True,{0,1}True,{0,0}True}
rulenum[n_,rr_]:=Tuples[{1,0},rr]
In[]:=
ParallelMap[ClickToCopy[ArrayPlot[CenterArray[AggregationArrayData[{1}][If[FailureQ[#],#["Data"],#]&/@RandomAggregation[{#,{{-1},{1},{2}}},{{0},{2}},50]],{50,50}],ImageSize->{100,100}],#]&,Rest[Association/@Map[#->True&,Subsets[Tuples[{1,0},3]],{2}]]]
Out[]=
In[]:=
Length[%426]
Out[]=
255
In[]:=
8!
Out[]=
40320
In[]:=
16!
Out[]=
20922789888000
In[]:=
ParallelMap[ClickToCopy[ArrayPlot[CenterArray[AggregationArrayData[{1}][If[FailureQ[#],#["Data"],#]&/@RandomAggregation[{#,{{-1},{1}}},{{0},{2}},50]],{50,50}],ImageSize->{100,100}],#]&,Rest[Association/@Map[#->True&,Subsets[Tuples[{1,0},2]],{2}]]]
Out[]=
,
,
,
,
,
,
,
,
,
,
,
,
,
,
In[]:=
Length[Association[Thread[#->True]]&/@Rest[Subsets[Tuples[{0,1},4],{2}]]]
Out[]=
119
In[]:=
ParallelMap[ClickToCopy[ArrayPlot[CenterArray[AggregationArrayData[{1}][If[FailureQ[#],#["Data"],#]&/@RandomAggregation[{#,{{-2},{-1},{1},{2}}},{{0},{2}},50]],{50,50}],ImageSize->{100,100}],#]&,RandomSample[Rest[Association/@Map[#->True&,Subsets[Tuples[{1,0},4]],{2}]],50]]

Examples

Wolfram Cloud

You are using a browser not supported by the Wolfram Cloud

Supported browsers include recent versions of Chrome, Edge, Firefox and Safari.


I understand and wish to continue anyway »

You are using a browser not supported by the Wolfram Cloud. Supported browsers include recent versions of Chrome, Edge, Firefox and Safari.