Cell[CellGroupData[{Cell[BoxData[ StyleBox[ RowBox[{ RowBox[{"triangle", "[", RowBox[{"t_", ",", "p_", ",", "v_"}], "]"}], ":=", RowBox[{"Block", "[", RowBox[{ RowBox[{"{", "pro", "}"}], ",", RowBox[{ RowBox[{ RowBox[{"pro", "[", RowBox[{"p2_", ",", "n2_", ",", "m2_", ",", "v2_"}], "]"}], ":=", RowBox[{"Block", "[", RowBox[{ RowBox[{"{", RowBox[{"t2", ",", "u"}], "}"}], ",", RowBox[{ RowBox[{"t2", "=", RowBox[{"IntegerPart", "[", FractionBox[ RowBox[{ "1", "+", "p2", "-", "m2", "+", "n2", "-", "v2"}], "p2"], "]"}]}], ";", RowBox[{"u", "=", RowBox[{"(", RowBox[{ UnderoverscriptBox["\[Sum]", RowBox[{"z", "=", "0"}], RowBox[{"t2", "-", "1"}]], RowBox[{"Binomial", "[", RowBox[{ RowBox[{"n2", "-", "v2", "-", RowBox[{"p2", "*", "z"}]}], ",", RowBox[{"m2", "-", "1"}]}], "]"}]}], ")"}]}], ";", RowBox[{ RowBox[{"FractionBox", "[", RowBox[{"u", ",", RowBox[{"Binomial", "[", RowBox[{"n2", ",", "m2"}], "]"}]}], "]"}], "//", "DisplayForm"}]}]}], "]"}]}], ";", RowBox[{"Table", "[", RowBox[{ RowBox[{"Table", "[", RowBox[{ RowBox[{"pro", "[", RowBox[{"p", ",", "n", ",", "m", ",", "v"}], "]"}], ",", RowBox[{"{", RowBox[{"m", ",", "1", ",", "n"}], "}"}]}], "]"}], ",", RowBox[{"{", RowBox[{"n", ",", "1", ",", "t"}], "}"}]}], "]"}]}]}], "]"}]}], FontSize->14]], "Input", CellGroupingRules->{"GroupTogetherGrouping", 10000.}, CellChangeTimes->{{3.35092666999086*^9, 3.35092667071099*^9}, { 3.35092672149832*^9, 3.35092694953367*^9}, {3.35092698298204*^9, 3.35092702667317*^9}, {3.35092712078971*^9, 3.35092716104868*^9}, { 3.35092724846803*^9, 3.35092726708198*^9}, {3.35092732678105*^9, 3.35092732721442*^9}, 3.35092738038621*^9, {3.35092748011684*^9, 3.35092749409689*^9}, {3.35092752916099*^9, 3.350927533107*^9}, 3.35092758945807*^9, {3.35092906050555*^9, 3.35092908667393*^9}, { 3.3509291746306*^9, 3.35092920394365*^9}, {3.35092937667745*^9, 3.35092939611456*^9}, {3.35092960021951*^9, 3.35092960357359*^9}, { 3.35092974814*^9, 3.35092975196184*^9}, {3.35093001574458*^9, 3.35093013369625*^9}, {3.35093028336249*^9, 3.35093028484376*^9}, { 3.35093034380298*^9, 3.35093035297765*^9}, 3.35093054095865*^9, { 3.35093102382172*^9, 3.35093103351868*^9}, {3.35093119196225*^9, 3.35093119520379*^9}, 3.35093172316084*^9, 3.35093176172175*^9, { 3.35098914939429*^9, 3.35098928619145*^9}, {3.35098936800097*^9, 3.35098945308198*^9}, {3.3509894867691*^9, 3.35098950570827*^9}, { 3.35098955306041*^9, 3.35098958312181*^9}, {3.35722558428125*^9, 3.35722559946875*^9}, {3.35824688923346*^9, 3.35824689715958*^9}, { 3.36434521626613*^9, 3.36434523473488*^9}, {3.36434528429738*^9, 3.36434531665675*^9}, {3.36434538053175*^9, 3.36434538060988*^9}, { 3.3647502423246*^9, 3.36475025644942*^9}, {3.36483557907852*^9, 3.36483565883649*^9}, {3.36483570894105*^9, 3.36483571429991*^9}, { 3.36559724757968*^9, 3.36559725126718*^9}, {3.36924279801563*^9, 3.36924280432813*^9}, {3.37054147034375*^9, 3.370541564484375*^9}, {3.374880766359375*^9, 3.374880771*^9}, { 3.3779800659189253`*^9, 3.3779800685595503`*^9}, { 3.3975128451331997`*^9, 3.3975128551172*^9}, 3.3976819169774*^9, { 3.3979430490355844`*^9, 3.3979430679741755`*^9}, 3.7607688418511047`*^9}, CellID->24470059], Cell[BoxData[ RowBox[{"Manipulate", "[", RowBox[{ RowBox[{ RowBox[{"If", "[", RowBox[{ RowBox[{"v", ">", "p"}], ",", RowBox[{"v", "=", "1"}]}], "]"}], ";", RowBox[{"Graphics", "[", RowBox[{ RowBox[{"Text", "@", RowBox[{"Style", "[", RowBox[{ RowBox[{"Column", "[", RowBox[{ RowBox[{"Map", "[", RowBox[{ RowBox[{ RowBox[{"Row", "[", RowBox[{"#", ",", RowBox[{"Spacer", "[", RowBox[{"N", "@", RowBox[{"Log", "[", RowBox[{"2", ",", "t"}], "]"}]}], "]"}]}], "]"}], "&"}], ",", RowBox[{"triangle", "[", RowBox[{"t", ",", "p", ",", "v"}], "]"}]}], "]"}], ",", "Center", ",", RowBox[{"Spacings", "->", RowBox[{"1", "/", "2"}]}]}], "]"}], ",", "18"}], "]"}]}], ",", RowBox[{"ImageSize", "->", RowBox[{"{", RowBox[{"450", ",", "400"}], "}"}]}]}], "]"}]}], ",", " ", RowBox[{"{", RowBox[{ RowBox[{"{", RowBox[{"t", ",", "3", ",", "\"\\""}], "}"}], ",", "2", ",", "12", ",", "1", ",", RowBox[{"Appearance", "->", "\"\\""}]}], "}"}], ",", " ", RowBox[{"{", RowBox[{ RowBox[{"{", RowBox[{"p", ",", "2", ",", "\"\\""}], "}"}], ",", "2", ",", "10", ",", "1", ",", RowBox[{"Appearance", "->", "\"\\""}]}], "}"}], ",", " ", RowBox[{"{", RowBox[{ RowBox[{"{", RowBox[{"v", ",", "1", ",", "\"\\""}], "}"}], ",", "1", ",", "p", ",", "1", ",", RowBox[{"Appearance", "->", "\"\\""}]}], "}"}], ",", " ", RowBox[{"SaveDefinitions", "->", "True"}], ",", RowBox[{"TrackedSymbols", "->", RowBox[{"{", RowBox[{"t", ",", "p", ",", "v"}], "}"}]}], ",", RowBox[{"AutorunSequencing", "->", RowBox[{"{", "1", "}"}]}]}], "]"}]], "Input", CellGroupingRules->{"GroupTogetherGrouping", 10000.}, CellChangeTimes->{ 3.35696210375764*^9, {3.3977286955532*^9, 3.3977287371502*^9}, { 3.3977287711991997`*^9, 3.3977288415452003`*^9}, 3.3977682553613997`*^9, {3.3977883512836*^9, 3.3977883546688004`*^9}, {3.397943091178637*^9, 3.3979431101641054`*^9}, {3.3979431528071866`*^9, 3.3979432626915236`*^9}, {3.397943310399585*^9, 3.3979433129927535`*^9}, {3.3979433701205792`*^9, 3.3979434263579793`*^9}, {3.397944225930398*^9, 3.3979442678557606`*^9}, {3.397944301296043*^9, 3.397944519796416*^9}, {3.3979445668291707`*^9, 3.3979445674854417`*^9}, {3.3981042931253633`*^9, 3.3981043052813797`*^9}, {3.3981043413431873`*^9, 3.3981043631083946`*^9}, {3.398104808506093*^9, 3.398104820349615*^9}, {3.3981048608175883`*^9, 3.398104887613949*^9}, {3.39810493495679*^9, 3.3981050189551773`*^9}, {3.398105069391709*^9, 3.3981050695635805`*^9}, 3.398105161858683*^9, { 3.3981053397146435`*^9, 3.3981054863680773`*^9}, { 3.3981055197893105`*^9, 3.398105628068482*^9}, { 3.39810599690515*^9, 3.3981060194984665`*^9}, 3.39810606512259*^9, 3.398106249607119*^9, 3.3981063696416793`*^9, { 3.398185893809227*^9, 3.3981858986997585`*^9}, 3.760768841841135*^9}, CellID->81600415], Cell[BoxData[ TagBox[ StyleBox[ DynamicModuleBox[{$CellContext`p$$ = 2, $CellContext`t$$ = 3, $CellContext`v$$ = 1, Typeset`show$$ = True, Typeset`bookmarkList$$ = {}, Typeset`bookmarkMode$$ = "Menu", Typeset`animator$$, Typeset`animvar$$ = 1, Typeset`name$$ = "\"untitled\"", Typeset`specs$$ = {{{ Hold[$CellContext`t$$], 3, "number of rows n"}, 2, 12, 1}, {{ Hold[$CellContext`p$$], 2, "number of players p"}, 2, 10, 1}, {{ Hold[$CellContext`v$$], 1, "player v"}, 1, Dynamic[$CellContext`p$$], 1}}, Typeset`size$$ = { 450., {198., 202.}}, Typeset`update$$ = 0, Typeset`initDone$$, Typeset`skipInitDone$$ = False, $CellContext`t$9890$$ = 0, $CellContext`p$9891$$ = 0, $CellContext`v$9892$$ = 0}, DynamicBox[Manipulate`ManipulateBoxes[ 1, StandardForm, "Variables" :> {$CellContext`p$$ = 2, $CellContext`t$$ = 3, $CellContext`v$$ = 1}, "ControllerVariables" :> { Hold[$CellContext`t$$, $CellContext`t$9890$$, 0], Hold[$CellContext`p$$, $CellContext`p$9891$$, 0], Hold[$CellContext`v$$, $CellContext`v$9892$$, 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" :> ( If[$CellContext`v$$ > $CellContext`p$$, $CellContext`v$$ = 1]; Graphics[ Text[ Style[ Column[ Map[Row[#, Spacer[ N[ Log[2, $CellContext`t$$]]]]& , $CellContext`triangle[$CellContext`t$$, \ $CellContext`p$$, $CellContext`v$$]], Center, Spacings -> 1/2], 18]], ImageSize -> {450, 400}]), "Specifications" :> {{{$CellContext`t$$, 3, "number of rows n"}, 2, 12, 1, Appearance -> "Labeled"}, {{$CellContext`p$$, 2, "number of players p"}, 2, 10, 1, Appearance -> "Labeled"}, {{$CellContext`v$$, 1, "player v"}, 1, Dynamic[$CellContext`p$$], 1, Appearance -> "Labeled"}}, "Options" :> { TrackedSymbols -> {$CellContext`t$$, $CellContext`p$$, \ $CellContext`v$$}, AutorunSequencing -> {1}}, "DefaultOptions" :> {ControllerLinking -> True}], ImageSizeCache->{495., {271., 277.}}, SingleEvaluation->True], Deinitialization:>None, DynamicModuleValues:>{}, Initialization:>({$CellContext`triangle[ Pattern[$CellContext`t, Blank[]], Pattern[$CellContext`p, Blank[]], Pattern[$CellContext`v, Blank[]]] := Block[{$CellContext`pro}, $CellContext`pro[ Pattern[$CellContext`p2, Blank[]], Pattern[$CellContext`n2, Blank[]], Pattern[$CellContext`m2, Blank[]], Pattern[$CellContext`v2, Blank[]]] := Block[{$CellContext`t2, $CellContext`u}, $CellContext`t2 = IntegerPart[( 1 + $CellContext`p2 - $CellContext`m2 + \ $CellContext`n2 - $CellContext`v2)/$CellContext`p2]; $CellContext`u = Sum[ Binomial[$CellContext`n2 - $CellContext`v2 - \ $CellContext`p2 $CellContext`z, $CellContext`m2 - 1], {$CellContext`z, 0, $CellContext`t2 - 1}]; DisplayForm[ FractionBox[$CellContext`u, Binomial[$CellContext`n2, $CellContext`m2]]]]; Table[ Table[ $CellContext`pro[$CellContext`p, $CellContext`n, \ $CellContext`m, $CellContext`v], {$CellContext`m, 1, $CellContext`n}], {$CellContext`n, 1, $CellContext`t}]]}; 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.7607688418413973`*^9}, CellID->11654389] }, {3}]]