letters[n_]:=CharacterRange["a","z"][[;;n]];
makeTextTable[data0_]:=Module[{data},
(* FIXME data=Table[ToString[#,TraditionalForm]&/@(data0[[i]]),{i,1,Length[data0]}];*)

Text@Grid[data0,Background->{None,{Lighter[Yellow,.9],{White,Lighter[Blend[{Blue,Green}],.8]}}},Dividers->{{Darker[Gray,.6],{Lighter[Gray,.5]},Darker[Gray,.6]},{Darker[Gray,.6],Darker[Gray,.6],{False},Darker[Gray,.6]}},ItemSize->Automatic]

];
CDFDeploy[ToFileName[{$UserDocumentsDirectory},"Combinatorics.cdf"],CreateDocument[{

Pane@Text[
Style["Combinatorics",Bold,Darker[Orange],30]],
Spacer[100],
Pane@Text[Style["Combinatorics is the branch of discrite mathematics that deals with counting. It seeks to answer the question how many ways are there to ... . Is it possible to ... . How many operation ... . How many words can we ... . How many numbers are there in a set that ... . Sometimes this trival question is hard to answer.", 16]
],
Spacer[100],
Pane@Text[
Style["1. Fundamental principle of counting: Muliplication Principle",Bold,Lighter[Darker[Orange]],23]],
Spacer[100],
Pane@Text[Style["Definition 1.1",Bold, 16]],
Pane@Text[Style["If there are (Subscript[n, 1]) ways for a first event and then \!\(TraditionalForm\`\(\*SubscriptBox[\(n\), \(2\)]\(\\ \)\)\) ways for the second event, there are (Subscript[n, 1])×(Subscript[n, 2]) possible ways for the sequence of the two events.", 16]],
Spacer[100],
Pane@Text[Style["By induction, the multiplication principle can be extended to a sequence of any finite # of events.", 16]],

(****CODE FOR MAKETEXTTABLE****)
(*makeTextTable[data0_]:=Module[{data},
(* FIXME data=Table[ToString[#,TraditionalForm]&/@(data0[[i]]),{i,1,Length[data0]}];*)

Text@Grid[data0,Background->{None,{Lighter[Yellow,.9],{White,Lighter[Blend[{Blue,Green}],.8]}}},Dividers->{{Darker[Gray,.6],{Lighter[Gray,.5]},Darker[Gray,.6]},{Darker[Gray,.6],Darker[Gray,.6],{False},Darker[Gray,.6]}},ItemSize->Automatic]

];*)

(******END OF CODE FOR MAKETEXT TABLE*********)
Pane@DynamicModule[{x,a,str,str2,str3,i},Manipulate[
Column[{
Text@Row[{Style["Example 1.1.",Bold,15]}],
Text@Row[{"The least part of your telephone number contains ",x,"-digits"}],
Text@Row[{"How many ",x,"-digit numbers are there?"}],
Text@Row[{""}],
a=10;
str=ToString[a]<>StringJoin[Table["×"<>ToString[i],{i,a-1,a-(x-1),-1}]];
str2=Flatten@ToExpression@StringSplit[str,"×"];
str3=Times@@@{str2};
Text@makeTextTable[{
{"Repetition allowed: ", 
Row[{"10"<>StringJoin[Table["×"<>ToString[10],(x-1)]]," = ",ToString[Power[10,x],TraditionalForm]}]},
{"No repetition: ",Row[{ToString[a]<>StringJoin[Table["×"<>ToString[i],{i,a-1,a-(x-1),-1}]]," = ",ToString[str3[[1]]]}]}
}]
}],
Button[" Again ",x=RandomInteger[{4,9}],ImageSize->80],
{{x,4,"# of digits"},4,9,1,Appearance -> "Labeled"}
],Initialization:>(SetOptions[EvaluationNotebook[],PrivateNotebookOptions->{"PluginToolbarEnabled"->False},DockedCells->Cell[BoxData[ToBoxes[Row[{Column[{Image[,ImageSize->125],"Prof. Madani\nSept 2015"},ItemSize->{20,Automatic}],PopupMenu[Dynamic[CurrentValue[EvaluationNotebook[],"Magnification"]],Range[0.5,3,0.5]]},Spacer[5]]]],"DockedCell"]];)],

Pane@DynamicModule[{y,a,str,str2,str3,str1,str21,str31,b,x,i},Manipulate[
Column[{
Text@Row[{Style["Example 1.2.",Bold,15]}],
Text@Row[{"Plate number: ",x," letters and ",y," digits?"}],
Text@Row[{""}],
a=10;
str=ToString[a]<>StringJoin[Table["×"<>ToString[i],{i,a-1,a-(x-1),-1}]];
str2=Flatten@ToExpression@StringSplit[str,"×"];
str3=Times@@@{str2};

b=26;
str1=ToString[b]<>StringJoin[Table["×"<>ToString[i],{i,b-1,b-(y-1),-1}]];
str21=Flatten@ToExpression@StringSplit[str1,"×"];
str31=Times@@@{str21};

Text@makeTextTable[{

{"Repetition allowed ",Row[{"26"<>StringJoin[Table["×"<>ToString[26],(x-1)]]<>"×10"<>StringJoin[Table["×"<>ToString[10],(y-1)]]," = ",ToString[Power[10,y]*Power[26,x],TraditionalForm]}]},
{"No repetition: ",Row[{ ToString[b]<>StringJoin[Table["×"<>ToString[i],{i,b-1,b-(x-1),-1}]]<>"×"<>
ToString[a]<>StringJoin[Table["×"<>ToString[i],{i,a-1,a-(y-1),-1}]]

,
" = ",ToString[str3[[1]]*str31[[1]] ]}]}

}]
}],
Button[" Again ",x=RandomInteger[{2,5}];y=RandomInteger[{2,5}],ImageSize->80],
{{x,3,"# of letters"},2,5,1,Appearance -> "Labeled"},
{{y,2,"# of digits"},2,5,1,Appearance -> "Labeled"}
,SaveDefinitions->True]],

Pane@DynamicModule[{x,y,z},Manipulate[
Column[{
Text@Row[{Style["Example 1.3.",Bold,15]}],
Text@Row[{"If a man has ",x," suits, ",y," shirts ",z," ties how many outfits can he put together?"}],
Text@Row[{""}],
Text@makeTextTable[{
{Row[{ToString[x]<>"×"<>ToString[y]<>"×"<>ToString[z]," = ",ToString[Times[x,y,z],TraditionalForm]}]}
}]
(*,
Text@Row[{ToString[x]<>"."<>ToString[y]<>"."<>ToString[z]," = ",ToString[Times[x,y,z],TraditionalForm]}]*)
}],
Button[" Again ",x=RandomInteger[{2,5}];y=RandomInteger[{2,5}];z=RandomInteger[{2,5}],ImageSize->80],
{{x,3,"# of suits"},2,10,1,Appearance -> "Labeled"},
{{y,2,"# of shirts"},2,10,1,Appearance -> "Labeled"},
{{z,5,"# of ties"},2,10,1,Appearance -> "Labeled"}
,SaveDefinitions->True]],

Pane@DynamicModule[{str,str2,str3,a,y,x,i},Manipulate[
Column[{
Text@Row[{Style["Example 1.4.",Bold,15]}],
Text@Row[{"How many ways are there to choose ",x," ofiars fom a club of ",y," people?"}],
Text@Row[{""}],

a=y;
str=ToString[a]<>StringJoin[Table["×"<>ToString[i],{i,a-1,a-(x-1),-1}]];
str2=Flatten@ToExpression@StringSplit[str,"×"];
str3=Times@@@{str2};

Text@makeTextTable[{{"Repetition allowed: ",Row[{ToString[y]<>StringJoin[Table["×"<>ToString[y],(x-1)]," = "<>ToString[Power[y,x]]]}]},
{"No repetition: ",Row[{ToString[a]<>StringJoin[Table["×"<>ToString[i],{i,a-1,a-(x-1),-1}]]," = ",ToString[str3[[1]]]}]}
}]
}],
Button[" Again ",x=RandomInteger[{2,6}];y=RandomInteger[{20,30}],ImageSize->80],
{{x,3,"# of letters"},2,6,1,Appearance -> "Labeled"},
{{y,25,"# of digits"},20,30,1,Appearance -> "Labeled"}
,SaveDefinitions->True]],
Spacer[100],
Pane@Text[Style["2. Selecting elements from a set",Bold,Lighter[Darker[Orange]], 23]],
Spacer[100],
Pane@Text[Style["Now we are interested in counting only a selection from set S. We can allow the selection to contain repetition or we can insist that id does not contains repetition. We can also be interested in the order of the selection. If given S = {x,y,z,w} and should select 3 elements, with repetition allowed and ordered counted. The selection will include xyx and xzz and yyy and zzz. Finally, all together we have four selection methods.", 16]],
Pane@Grid[{{"","order matters","order does not matter"},{"repetition allowed","k-Sample","k-Selection"},{"repetition not allowed","k-Permutation","k-Combination"}},Background->{None,None,{{1,2}->Lighter[Yellow,.7],{1,3}->Lighter[Yellow,.7],{2,1}->Lighter[Green,.9],{3,1}->Lighter[Green,.9]}},Frame->{None,None,{{1,2}->True,{1,3}->True,{2,1}->True,{2,3}->True,{3,1}->True,{3,2}->True,{3,3}->True}}],
Spacer[100],
Pane@Text[Style["Definition 2.1",Bold,16]],Pane@Text[Style["K-samples: Select k-things from a set S. Allow repetitions, but distinguish among lists in which the same elements appear in different order.",16]],
Spacer[100],
Pane@Text[Style["The list of k-sample selection contains (n^k) if |S| = n, and k-th size of elements or thing selected. ",16]],
Pane@DynamicModule[{x,y,letters},Manipulate[
letters[n_]:=CharacterRange["a","z"][[;;n]];
Column[{
Text@Row[{Style["Example 2.1.",Bold,15]}],
Text@Row[{"k-Samples for a set S=",letters[y]," when k = ",x, " is"}],
Text@Row[{""}],
Text@Map[Sort,Tuples[letters[y],x]]
}],
Button[" Again ",x=RandomInteger[{1,3}];y=RandomInteger[{3,4}],ImageSize->80],
{{x,2,"# k"},1,3,1,Appearance -> "Labeled"},
{{y,3,"|S|"},3,4,1,Appearance -> "Labeled"}
]],
Spacer[100],
Pane@Text[Style["Definition 2.2",
Bold,16]],
Pane@Text[Style["K-selections: selet k-things from a set S. Allow repetitions, but equate lists containing the same elements in any order.",16]],
Spacer[100],
Pane@DynamicModule[{x,y,letters},Manipulate[
letters[n_]:=CharacterRange["a","z"][[;;n]];
Column[{
Text@Row[{Style["Example 2.2.",Bold,15]}],
Text@Row[{"k-Selection for a set S=",letters[y]," when k = ",x, " is"}],
Text@Row[{""}],
Text@DeleteDuplicates[Map[Sort,Tuples[letters[y],x]]]
}],
Button[" Again ",x=RandomInteger[{1,3}];y=RandomInteger[{3,4}],ImageSize->80],
{{x,2,"# k"},1,3,1,Appearance -> "Labeled"},
{{y,3,"|S|"},3,4,1,Appearance -> "Labeled"}
]],
Spacer[100],
Pane@Text[Style["Definition 2.3",Bold,16]],
Pane@Text[Style["K-permutation: select k things from a set S. Do not allow repetitions, and distinguish list by the order in which elements are selected.",16]],
Spacer[100],
Pane@DynamicModule[{letters,x,y},Manipulate[
letters[n_]:=CharacterRange["a","z"][[;;n]];
Column[{
Text@Row[{Style["Example 2.3.",Bold,15]}],
Text@Row[{"k-Permutation for a set S=",letters[y]," when k = ",x, " is"}],
Text@Row[{""}],
Text@Permutations[letters[y],{x}]
}],
Button[" Again ",x=RandomInteger[{1,3}];y=RandomInteger[{3,4}],ImageSize->80],
{{x,2,"# k"},1,3,1,Appearance -> "Labeled"},
{{y,3,"|S|"},3,4,1,Appearance -> "Labeled"}
]],
Spacer[100],
Pane@Text[Style["Definition 2.4",Bold,16]],
Pane@Text[Style["K-combinations: select k-things from a set S. Do not allow repetitions, equate lists containing the same elements in any order.",16]],
Spacer[100],
Pane@DynamicModule[{letters,x,y},Manipulate[
letters[n_]:=CharacterRange["a","z"][[;;n]];
Column[{
Text@Row[{Style["Example 2.4.",Bold,15]}],
Text@Row[{"k-Combinations for a set S= ",letters[y]," when k = ",x, " is"}],
Text@Row[{""}],
Text@Subsets[letters[y],{x}]
}],
Button[" Again ",x=RandomInteger[{1,3}];y=RandomInteger[{3,4}],ImageSize->80],
{{x,2,"# k"},1,3,1,Appearance -> "Labeled"},
{{y,3,"|S|"},3,4,1,Appearance -> "Labeled"}
]],

Spacer[100],
Pane@Text[Style["3. Counting formulas",Bold,Lighter[Darker[Orange]], 23]],

Spacer[100],
Pane@Text[Style["1.  K-samples: apply the principle of multiplication. K position choose anytime any of the n elements.",16]],
Pane@Text[Style["               k times
\!\(TraditionalForm\`\*OverscriptBox[\(\(n×n×n×\\  ... \)\\ ×n\), \(⏞\)]\) = (n^k)",16]],
Spacer[100],
Pane@Text[Style["2. K-permutation: we use the notation P(n,k). Let |S| = n, then the Permutation of n things taken k at a time is n×(n-1)×(n-2)× ... ×(n-k+1)",16]],
Pane@Text[Style["P(n,k) = n×(n-1)×(n-2)× ... ×(n-k+1) = ((n!)/((n - k)!))",16]],
Pane@Text[Style["where: n! = n×(n-1)×(n-2)× ... ×3×2×1",16]],
Spacer[100],
Pane@Text[Style["3. K-combinations: denoted C(n,k) and reads \"combination of n things taken k at a time\". To count it we notice that to each k-combination there are many re-permutations. For each kcombinations there are k! = k×(k-1)×(k-2)× ... ×2×1 , hence",16]],
Pane@Text[Style["P(n,k) = C(n,k)×k!     ⟹    C(n,k) = ((n!)/((n - k)! k!))",16]],
Spacer[100],
Pane@Text[Style["4. K-selections: denoted by S'(n,k).",16]],
Spacer[100],
Pane@Text[Style["Theorem 3.1.",Bold,16]],
Pane@Text[Style["\!\(TraditionalForm\`\*SubscriptBox[\(∀\), \(n ⩾ 1\)]\(\(,\)\(\\ \)\(\*SubscriptBox[\(∀\), \(k ⩾ 1\)]\\ the\\ number\\ of\\ k - selections\\ from\\ a\\ set\\ with\\ n\\ elements\\ is\\ given\\ by\)\)\):",16]],
Pane@Text[Style["S'(n,k) = C(n+k-1,k)",16]],

Spacer[100],
Pane@Text[Style["Applications:",16]],
Spacer[100],
DynamicModule[{y,a,str,str3,str2,i,x},Manipulate[
(*y=RandomInteger[{1,4}];*)
Column[{
Text@Row[{Style["Example 3.1.",Bold,15]}],
name1={"MOTIVITY","COMPILER","AUTOTOMY","CODEBOOK"}[[x-1]];
Text@Row[{"How many ",x,"-letters words (not necessarily meaningful) can be formed from the word ",name1, " if letters:"}],
Text@Row[{""}],
a=8;
str=ToString[a]<>StringJoin[Table["×"<>ToString[i],{i,a-1,a-(x-1),-1}]];
str2=Flatten@ToExpression@StringSplit[str,"×"];
str3=Times@@@{str2};
Text@makeTextTable[{{"Can be repeated: ",Row[{"8"<>StringJoin[Table["×"<>ToString[8],(x-1)]]," = ",ToString[Power[8,x],TraditionalForm]}]},
{"Do not repeat: ",Row[{ToString[Style[(("8!")/(ToString[8-x]<>"!")),18],TraditionalForm]<>" = "<>ToString[a]<>StringJoin[Table["×"<>ToString[i],{i,a-1,a-(x-1),-1}]]," = ",ToString[str3[[1]]]}]}
}]
}],
Button[" Again ",x=RandomInteger[{2,5}],ImageSize->80],
{{x,3,"# of letters"},2,5,1,Appearance -> "Labeled"}

]],

DynamicModule[{x,y},Manipulate[
(*y=RandomInteger[{1,4}];*)
Column[{
Text@Row[{Style["Example 3.2.",Bold,15]}],
Text@Row[{"In how many ways can ",x," people be seated in a row of ",x, " chairs?"}],
Text@Row[{""}],
Text@Row[{x,"! = ",x!}]
}],
Button[" Again ",x=RandomInteger[{4,12}],ImageSize->80],
{{x,6,"# of people"},4,12,1,Appearance -> "Labeled"},
Initialization:>(y=RandomInteger[{1,4}];)
]],

DynamicModule[{x,y,c,f,s},Manipulate[

Column[{
Text@Row[{Style["Example 3.3.",Bold,15]}],
Text@Row[{"A committee of ",c," students is to be selected from a class consisting of ",x," freshman, ",y," sophomores."}],
Text@Row[{"a) In how many ways can ",f," freshman, ",s," sophomores be selected?"}],
Framed@OpenerView[{"See Answer", Column[{
Text@Row[{"multiplication principle ⇒ ",Column[{Row[{"C(",x,",",f,") to choose the ",f, " freshman"}],Row[{"C(",y,",",s,") to choose the ",s, " sophomores"}]}]}],
"",
Text@Row[{"⇒ ","C(",x,",",f,")×","C(",y,",",s,") = ",Style[ToString[x]<>"!"/ToString[f]<>"!"<>ToString[x-f]<>"!",18],"×",Style[ToString[y]<>"!"/ToString[s]<>"!"<>ToString[y-s]<>"!",18]," = (",((x!)/(f!(x-f)!)),")(",((y!)/(s!(y-s)!)),") = ",((x!)/(f!(x-f)!))*((y!)/(s!(y-s)!))}]
}]},Background->Lighter[Yellow,.9]],

Text@Row[{""}],
Text@Row[{"b) In how many ways can a committee of exactly one freshman be selected?"}],
Framed@OpenerView[{"See Answer",Text@Row[{"C(",x,",",1,")×","C(",y,",",c-1,") = "," (",x,")(",((y!)/((c-1)!(y-(c-1))!)),") = ",x*((y!)/((c-1)!(y-(c-1))!))}]},Background->Lighter[Yellow,.9]],
Text@Row[{""}],
Text@Row[{"c) In how many ways can a committee at most one freshman be selected ?"}],
Framed@OpenerView[{"See Answer",Text@Row[{"C(",x,",",1,")×","C(",y,",",c-1,") + C(",y,",",c,")"," = ",x*((y!)/((c-1)!(y-(c-1))!))+ ((y!)/((c)!(y-c)!))}]},Background->Lighter[Yellow,.9]],
Text@Row[{""}],
Text@Row[{"d) In how many ways can a committee aith at least one freshman be selected ?"}],
Framed@OpenerView[{"See Answer",Column[{
Text@Row[{"C(",x,",",1,")×","C(",y,",",c-1,") + C(",x,",",2,")×","C(",y,",",c-2,") + ... + C(",y,",",c,") = ",(((x+y)!)/((c)!(x+y-(c))!))- ((y!)/((c)!(y-c)!))}],
Text@Row[{"or"}],
Text@Row[{"C(",x+y,",",c,") - C(",y,",",c,")"," = ",(((x+y)!)/((c)!(x+y-(c))!))- ((y!)/((c)!(y-c)!))}]

}]},Background->Lighter[Yellow,.9]]

}],
Button[" Again ",x=RandomInteger[{15,20}];y=RandomInteger[{30,40}],ImageSize->80],
{{x,19,"# freshman"},15,20,1,Appearance -> "Labeled"},
{{y,34,"# sophomores"},30,40,1,Appearance -> "Labeled"} (*TO DO: add here checkbox "SHOW ANSWERS", because answers shoud not be visibile at the beginning *),

Initialization:>(c=RandomInteger[{6,10}];
f=RandomInteger[{2,4}];
s=c-f;)
]],
DynamicModule[{x,y,c,z,i},Manipulate[

Column[{
Text@Row[{Style["Example 3.4.",Bold,15]}],
Text@Row[{"A congressional committe of ",c," is to be choosen from a set of ",x," Democrats ",y, " Republicans ",z," Independents."}],
Text@Row[{"a) In how many ways can the committee be choosen"}],
Framed@OpenerView[{"See Answer",Text@Row[{"C(",x+y+z,",",c,") = ",(((x+y+z)!)/((c)!((x+y+z)-c)!))}]},Background->Lighter[Yellow,.9]],
Text@Row[{""}],
Text@Row[{"b) In how many ways can the committee be choosen if it can not include both Democrats and Republicans"}],
Framed@OpenerView[{"See Answer",Text@Row[{Column[{Row[{"C(",y+z,",",c,")"}],"no democ.",""}],Column[{" + ","",""}],Column[{Row[{"C(",x+z,",",c,")"}],"no repub.",""}] ,Column[{" - ","",""}],Column[{Row[{"C(",z,",",c,")"}],"all indep. so as\nnot to count twice"}]   ,Column[{" = ","",""}],Column[{(((y+z)!)/((c)!((y+z)-c)!))+(((x+z)!)/((c)!((x+z)-c)!))-(((z)!)/((c)!((z)-c)!)),"",""}]
}]},Background->Lighter[Yellow,.9]],
Text@Row[{""}],
Text@Row[{"c) In how many ways can the committee be choosen if it must include at least 1 Independent."}],
Framed@OpenerView[{"See Answer",Text@Row[{
StringJoin[Table[ToString[({{ToString[z]}, {i}}),TraditionalForm]<>ToString[({{ToString[x+y]}, {c-i}}),TraditionalForm]<>" + ",{i,1,c-1,1}],ToString[({{ToString[z]}, {c}}),TraditionalForm]]
}]},Background->Lighter[Yellow,.9]]
}],
Button[" Again ",x=RandomInteger[{2,10}];y=RandomInteger[{2,8}];z=RandomInteger[{2,9}],ImageSize->80],
{{x,5,"# Democrats"},2,10,1,Appearance -> "Labeled"},
{{y,3,"# Republicans"},2,8,1,Appearance -> "Labeled"},
{{z,4,"# Independents"},2,9,1,Appearance -> "Labeled"},

Initialization:>(c=RandomInteger[{3,6}];)
]],

Spacer[100],
Pane@Text[Style["4. Patterns",Bold,Lighter[Darker[Orange]],23]],
Spacer[100],
Pane@Text[Style["Sometimes we may have to extract some collections of objects that are not necessarily all distinct. Example: How many words can we form the set: M,I,S,S,I,S,S,I,P,P,I  or v,o,l,v,o etc.",16]],
Spacer[100],
Spacer[100],Pane@Text[Style["Theorem 4.1.",Bold,16]],Pane@Text[Style["Suppose there are objects, of which (Subscript[n, 1]) objects are of type 1, and (Subscript[n, 2]) of type 2, and ... , and (Subscript[n, r]) of type r. Then there are:

\!\(TraditionalForm\`\*FractionBox[\(n!\), \(\(\(\*SubscriptBox[\(n\), \(1\)]!\) \(\*SubscriptBox[\(n\), \(2\)]!\) \(\*SubscriptBox[\(n\), \(3\)]!\)\\  ... \)\\ \(\*SubscriptBox[\(n\), \(r\)]!\)\)]\) ",16]],
Spacer[100],
Pane@DynamicModule[{x},Manipulate[
(*x=RandomInteger[{1,4}];*)
Column[{
Text@Row[{Style["Example 4.1.",Bold,15]}],
name1={"MISSISSIPPI","VOLVO","COOKBOOK","COUSCOUS"}[[x]];
Text@Row[{"Number of words in ",name1, " is"}],
Text@Row[{""}],
Text@Which[x==1,ToString[Style[(("11!")/("4!4!2!")),20],TraditionalForm]<>" = "<>ToString[((11!)/(4!4!2!)),TraditionalForm],
x==2,ToString[Style[(("5!")/("2!2!")),20],TraditionalForm]<>" = "<>ToString[((5!)/(2!2!)),TraditionalForm],
x==3,ToString[Style[(("8!")/("4!2!")),20],TraditionalForm]<>" = "<>ToString[((8!)/(4!2!)),TraditionalForm],
x==4,ToString[Style[(("8!")/("2!2!2!2!")),20],TraditionalForm]<>" = "<>ToString[((8!)/(2!2!2!2!)),TraditionalForm]
]
}],
Button[" Again ",x=RandomInteger[{1,4}],ImageSize->80],(*,
{{x,2,"name"},1,4,1,Appearance -> "Labeled"}*) (*TO DO: check if it is well constructed when i commented this line*)
Initialization:>(x=RandomInteger[{1,4}];)
]
]


}],
"Method"->"Standalone"]