Cell[CellGroupData[{Cell[BoxData[ RowBox[{ RowBox[{"delannoymoves", "=", RowBox[{"{", RowBox[{ RowBox[{"{", RowBox[{"1", ",", "0"}], "}"}], ",", RowBox[{"{", RowBox[{"1", ",", "1"}], "}"}], ",", RowBox[{"{", RowBox[{"0", ",", "1"}], "}"}]}], "}"}]}], ";"}]], "Input", CellGroupingRules->{"GroupTogetherGrouping", 10000.}, InitializationCell->True, CellChangeTimes->{3.35696210375764*^9, 3.375124999665801*^9, 3.7607440563359213`*^9}, CellID->615223508], Cell[BoxData[ RowBox[{ RowBox[{"destep", "[", "ds_", "]"}], ":=", RowBox[{"Flatten", "[", RowBox[{ RowBox[{ RowBox[{ RowBox[{"Outer", "[", RowBox[{ RowBox[{ RowBox[{"Append", "[", RowBox[{"#1", ",", RowBox[{ RowBox[{"Last", "[", "#1", "]"}], "+", "#2"}]}], "]"}], "&"}], ",", RowBox[{"{", "#", "}"}], ",", "delannoymoves", ",", "1"}], "]"}], "&"}], "/@", "ds"}], ",", "2"}], "]"}]}]], "Input", CellGroupingRules->{"GroupTogetherGrouping", 10000.}, InitializationCell->True, CellChangeTimes->{3.760744056336042*^9}, CellID->755339034], Cell[BoxData[ RowBox[{ RowBox[{ RowBox[{"adel", "[", RowBox[{"{", RowBox[{"0", ",", "0"}], "}"}], "]"}], "=", "1"}], ";"}]], "Input", CellGroupingRules->{"GroupTogetherGrouping", 10000.}, InitializationCell->True, CellChangeTimes->{3.35696210375764*^9, 3.3751249764127493`*^9, 3.760744056336152*^9}, CellID->1269228863], Cell[BoxData[ RowBox[{ RowBox[{"adel", "[", RowBox[{"{", RowBox[{"a_", ",", "0"}], "}"}], "]"}], ":=", RowBox[{"adel", "[", RowBox[{"{", RowBox[{ RowBox[{"a", "-", "1"}], ",", "0"}], "}"}], "]"}]}]], "Input", CellGroupingRules->{"GroupTogetherGrouping", 10000.}, InitializationCell->True, CellChangeTimes->{3.7607440563362703`*^9}, CellID->1207307021], Cell[BoxData[ RowBox[{ RowBox[{"adel", "[", RowBox[{"{", RowBox[{"0", ",", "b_"}], "}"}], "]"}], ":=", RowBox[{"adel", "[", RowBox[{"{", RowBox[{"0", ",", RowBox[{"b", "-", "1"}]}], "}"}], "]"}]}]], "Input", CellGroupingRules->{"GroupTogetherGrouping", 10000.}, InitializationCell->True, CellChangeTimes->{3.7607440563363743`*^9}, CellID->1783605091], Cell[BoxData[ RowBox[{ RowBox[{"adel", "[", RowBox[{"{", RowBox[{"a_", ",", "b_"}], "}"}], "]"}], ":=", RowBox[{ RowBox[{"adel", "[", RowBox[{"{", RowBox[{ RowBox[{"a", "-", "1"}], ",", "b"}], "}"}], "]"}], "+", RowBox[{"adel", "[", RowBox[{"{", RowBox[{ RowBox[{"a", "-", "1"}], ",", RowBox[{"b", "-", "1"}]}], "}"}], "]"}], "+", RowBox[{"adel", "[", RowBox[{"{", RowBox[{"a", ",", RowBox[{"b", "-", "1"}]}], "}"}], "]"}]}]}]], "Input", CellGroupingRules->{"GroupTogetherGrouping", 10000.}, InitializationCell->True, CellChangeTimes->{3.760744056336473*^9}, CellID->326535964], Cell[BoxData[ RowBox[{"Manipulate", "[", RowBox[{ RowBox[{ RowBox[{"s", "=", RowBox[{"Min", "[", RowBox[{"s", ",", RowBox[{"3", "^", "k"}]}], "]"}]}], ";", RowBox[{"With", "[", RowBox[{ RowBox[{"{", RowBox[{"ds", "=", RowBox[{"Nest", "[", RowBox[{"destep", ",", RowBox[{"{", RowBox[{"{", RowBox[{"{", RowBox[{"0", ",", "0"}], "}"}], "}"}], "}"}], ",", "k"}], "]"}]}], "}"}], ",", RowBox[{"Graphics", "[", RowBox[{ RowBox[{"Flatten", "[", RowBox[{"{", RowBox[{ RowBox[{"RGBColor", "[", RowBox[{"1", ",", ".71", ",", "0"}], "]"}], ",", RowBox[{"Polygon", "[", RowBox[{"{", RowBox[{ RowBox[{"{", RowBox[{"0", ",", "0"}], "}"}], ",", RowBox[{"{", RowBox[{"0", ",", "k"}], "}"}], ",", RowBox[{"{", RowBox[{"k", ",", "k"}], "}"}], ",", RowBox[{"{", RowBox[{"k", ",", "0"}], "}"}]}], "}"}], "]"}], ",", RowBox[{"RGBColor", "[", RowBox[{".67", ",", ".75", ",", ".15"}], "]"}], ",", RowBox[{"Polygon", "[", RowBox[{"{", RowBox[{ RowBox[{"{", RowBox[{"0", ",", "0"}], "}"}], ",", RowBox[{"{", RowBox[{"0", ",", "k"}], "}"}], ",", RowBox[{"{", RowBox[{"k", ",", "0"}], "}"}]}], "}"}], "]"}], ",", RowBox[{"Darker", "@", "Magenta"}], ",", RowBox[{"Thickness", "[", ".01", "]"}], ",", RowBox[{"Line", "[", RowBox[{"ds", "[", RowBox[{"[", "s", "]"}], "]"}], "]"}], ",", RowBox[{"Table", "[", RowBox[{ RowBox[{"{", RowBox[{ RowBox[{"If", "[", RowBox[{ RowBox[{"FreeQ", "[", RowBox[{ RowBox[{"ds", "[", RowBox[{"[", "s", "]"}], "]"}], ",", RowBox[{"{", RowBox[{"q", ",", RowBox[{"k", "-", "q"}]}], "}"}]}], "]"}], ",", RowBox[{"RGBColor", "[", RowBox[{".11", ",", ".61", ",", ".78"}], "]"}], ",", RowBox[{"RGBColor", "[", RowBox[{".11", ",", ".91", ",", ".91"}], "]"}]}], "]"}], ",", RowBox[{"Disk", "[", RowBox[{ RowBox[{"{", RowBox[{"q", ",", RowBox[{"k", "-", "q"}]}], "}"}], ",", RowBox[{"1", "/", "3"}]}], "]"}], ",", "White", ",", RowBox[{"Style", "[", RowBox[{ RowBox[{"Text", "[", RowBox[{ RowBox[{"adel", "[", RowBox[{"{", RowBox[{"q", ",", RowBox[{"k", "-", "q"}]}], "}"}], "]"}], ",", RowBox[{"{", RowBox[{"q", ",", RowBox[{"k", "-", "q"}]}], "}"}]}], "]"}], ",", "\"\\""}], "]"}]}], "}"}], ",", RowBox[{"{", RowBox[{"q", ",", "0", ",", "k"}], "}"}]}], "]"}]}], "}"}], "]"}], ",", RowBox[{"PlotRange", "->", RowBox[{"(", RowBox[{"{", RowBox[{ RowBox[{"{", RowBox[{ RowBox[{ RowBox[{"-", "1"}], "/", "2"}], ",", RowBox[{"k", "+", RowBox[{"1", "/", "2"}]}]}], "}"}], ",", RowBox[{"{", RowBox[{ RowBox[{ RowBox[{"-", "1"}], "/", "2"}], ",", RowBox[{"k", "+", RowBox[{"1", "/", "2"}]}]}], "}"}]}], "}"}], ")"}]}], ",", RowBox[{"ImageSize", "->", "400"}]}], "]"}]}], "]"}]}], ",", RowBox[{"{", RowBox[{ RowBox[{"{", RowBox[{"k", ",", "6", ",", "\"\\""}], "}"}], ",", "1", ",", "8", ",", "1"}], "}"}], ",", RowBox[{"{", RowBox[{ RowBox[{"{", RowBox[{"s", ",", "1", ",", "\"\\""}], "}"}], ",", "1", ",", RowBox[{"3", "^", "k"}], ",", "1"}], "}"}], ",", " ", RowBox[{"SaveDefinitions", "->", "True"}]}], "]"}]], "Input", CellGroupingRules->{"GroupTogetherGrouping", 10000.}, CellChangeTimes->{ 3.35757176568782*^9, {3.36923182557301*^9, 3.36923183298958*^9}, 3.36937940170145*^9, 3.36938067565753*^9, {3.3709048062174873`*^9, 3.37090486206066*^9}, {3.370904911439968*^9, 3.3709049527896214`*^9}, {3.370905050520063*^9, 3.370905064109676*^9}, {3.370905139117625*^9, 3.3709051851882877`*^9}, {3.3709052571019697`*^9, 3.370905340097289*^9}, {3.370905400266094*^9, 3.3709054191982927`*^9}, {3.370906693272941*^9, 3.370906697473196*^9}, 3.3709068103867493`*^9, { 3.3710695573150883`*^9, 3.371069583248221*^9}, 3.371077599945698*^9, 3.371592579615781*^9, {3.371592631662272*^9, 3.371592637166875*^9}, {3.371983942422117*^9, 3.371983967630344*^9}, {3.372116851379757*^9, 3.3721168579192963`*^9}, {3.372907841771763*^9, 3.372907843684291*^9}, 3.372967399259552*^9, {3.373862712980719*^9, 3.3738627653028793`*^9}, {3.373862802213633*^9, 3.373862827318376*^9}, 3.375124693614171*^9, { 3.3862929133617535`*^9, 3.386292937285677*^9}, { 3.386293056644927*^9, 3.3862931885119123`*^9}, 3.760744056332486*^9}, CellID->1496021318], Cell[BoxData[ TagBox[ StyleBox[ DynamicModuleBox[{$CellContext`k$$ = 3, $CellContext`s$$ = 17, Typeset`show$$ = True, Typeset`bookmarkList$$ = {}, Typeset`bookmarkMode$$ = "Menu", Typeset`animator$$, Typeset`animvar$$ = 1, Typeset`name$$ = "\"untitled\"", Typeset`specs$$ = {{{ Hold[$CellContext`k$$], 3, "number of choices"}, 1, 8, 1}, {{ Hold[$CellContext`s$$], 17, "path"}, 1, Dynamic[3^$CellContext`k$$], 1}}, Typeset`size$$ = { 400., {198., 202.}}, Typeset`update$$ = 0, Typeset`initDone$$, Typeset`skipInitDone$$ = False, $CellContext`k$100289$$ = 0, $CellContext`s$100290$$ = 0}, DynamicBox[Manipulate`ManipulateBoxes[ 1, StandardForm, "Variables" :> {$CellContext`k$$ = 3, $CellContext`s$$ = 17}, "ControllerVariables" :> { Hold[$CellContext`k$$, $CellContext`k$100289$$, 0], Hold[$CellContext`s$$, $CellContext`s$100290$$, 0]}, "OtherVariables" :> { Typeset`show$$, Typeset`bookmarkList$$, Typeset`bookmarkMode$$, Typeset`animator$$, Typeset`animvar$$, Typeset`name$$, Typeset`specs$$, Typeset`size$$, Typeset`update$$, Typeset`initDone$$, Typeset`skipInitDone$$}, "Body" :> ($CellContext`s$$ = Min[$CellContext`s$$, 3^$CellContext`k$$]; With[{$CellContext`ds$ = Nest[$CellContext`destep, {{{0, 0}}}, $CellContext`k$$]}, Graphics[ Flatten[{ RGBColor[1, 0.71, 0], Polygon[{{0, 0}, { 0, $CellContext`k$$}, {$CellContext`k$$, \ $CellContext`k$$}, {$CellContext`k$$, 0}}], RGBColor[0.67, 0.75, 0.15], Polygon[{{0, 0}, { 0, $CellContext`k$$}, {$CellContext`k$$, 0}}], Darker[Magenta], Thickness[0.01], Line[ Part[$CellContext`ds$, $CellContext`s$$]], Table[{ If[ FreeQ[ Part[$CellContext`ds$, $CellContext`s$$], \ {$CellContext`q, $CellContext`k$$ - $CellContext`q}], RGBColor[0.11, 0.61, 0.78], RGBColor[0.11, 0.91, 0.91]], Disk[{$CellContext`q, $CellContext`k$$ - \ $CellContext`q}, 1/3], White, Style[ Text[ $CellContext`adel[{$CellContext`q, $CellContext`k$$ - \ $CellContext`q}], {$CellContext`q, $CellContext`k$$ - \ $CellContext`q}], "Menu"]}, {$CellContext`q, 0, $CellContext`k$$}]}], PlotRange -> {{(-1)/2, $CellContext`k$$ + 1/2}, {(-1)/ 2, $CellContext`k$$ + 1/2}}, ImageSize -> 400]]), "Specifications" :> {{{$CellContext`k$$, 3, "number of choices"}, 1, 8, 1}, {{$CellContext`s$$, 17, "path"}, 1, Dynamic[3^$CellContext`k$$], 1}}, "Options" :> {}, "DefaultOptions" :> {ControllerLinking -> True}], ImageSizeCache->{445., {257., 263.}}, SingleEvaluation->True], Deinitialization:>None, DynamicModuleValues:>{}, Initialization:>({$CellContext`destep[ Pattern[$CellContext`ds, Blank[]]] := Flatten[ Map[ Outer[Append[#, Last[#] + #2]& , {#}, $CellContext`delannoymoves, 1]& , $CellContext`ds], 2], $CellContext`delannoymoves = {{ 1, 0}, {1, 1}, {0, 1}}, $CellContext`adel[{0, 0}] = 1, $CellContext`adel[{ Pattern[$CellContext`a, Blank[]], 0}] := $CellContext`adel[{$CellContext`a - 1, 0}], $CellContext`adel[{0, Pattern[$CellContext`b, Blank[]]}] := $CellContext`adel[{ 0, $CellContext`b - 1}], $CellContext`adel[{ Pattern[$CellContext`a, Blank[]], Pattern[$CellContext`b, Blank[]]}] := $CellContext`adel[{$CellContext`a - 1, $CellContext`b}] + $CellContext`adel[{$CellContext`a - 1, $CellContext`b - 1}] + $CellContext`adel[{$CellContext`a, $CellContext`b - 1}], Attributes[PlotRange] = {ReadProtected}}; Typeset`initDone$$ = True), SynchronousInitialization->True, UnsavedVariables:>{Typeset`initDone$$}, UntrackedVariables:>{Typeset`size$$}], "Manipulate", Deployed->True, StripOnInput->False], Manipulate`InterpretManipulate[1]]], "Output", CellGroupingRules->{"GroupTogetherGrouping", 10000.}, CellChangeTimes->{3.7607440563327637`*^9}, CellID->117259370] }, {8}]]