(************** Content-type: application/mathematica ************** CreatedBy='Mathematica 5.0' Mathematica-Compatible Notebook This notebook can be used with any Mathematica-compatible application, such as Mathematica, MathReader or Publicon. The data for the notebook starts with the line containing stars above. To get the notebook into a Mathematica-compatible application, do one of the following: * Save the data starting with the line of stars above into a file with a name ending in .nb, then open the file inside the application; * Copy the data starting with the line of stars above to the clipboard, then use the Paste menu command inside the application. Data for notebooks contains only printable 7-bit ASCII and can be sent directly in email or through ftp in text mode. Newlines can be CR, LF or CRLF (Unix, Macintosh or MS-DOS style). NOTE: If you modify the data for this notebook not in a Mathematica- compatible application, you must delete the line below containing the word CacheID, otherwise Mathematica-compatible applications may try to use invalid cache data. For more information on notebooks and Mathematica-compatible applications, contact Wolfram Research: web: http://www.wolfram.com email: info@wolfram.com phone: +1-217-398-0700 (U.S.) Notebook reader applications are available free of charge from Wolfram Research. *******************************************************************) (*CacheID: 232*) (*NotebookFileLineBreakTest NotebookFileLineBreakTest*) (*NotebookOptionsPosition[ 1651013, 43464]*) (*NotebookOutlinePosition[ 1721487, 45560]*) (* CellTagsIndexPosition[ 1717941, 45434]*) (*WindowFrame->Normal*) Notebook[{ Cell[CellGroupData[{ Cell[" La politique, en un tour de 421", "Title", TextAlignment->Center, CellTags->"c:1"], Cell["Pierre Albar\[EGrave]de", "Subtitle", TextAlignment->Center, TextJustification->0], Cell[TextData[{ "A r\[EAcute]s. Valvert, 12 rue de la Fourane, F-13090 Aix en Provence, ", ButtonBox["http://pierre.albarede.free.fr", ButtonData:>{ URL[ "http://pierre.albarede.free.fr"], None}, ButtonStyle->"Hyperlink"] }], "Text", TextAlignment->Center, TextJustification->0], Cell["\<\ On r\[EAcute]alise une politique r\[EAcute]trospective, produisant \ par r\[EAcute]currence \[AGrave] rebours la plus utile strat\[EAcute]gie dans \ un tour de 421, probl\[EGrave]me de contr\[OHat]le optimal stochastique, \ comparable \[AGrave] la vie en milieu al\[EAcute]atoire et \ comp\[EAcute]titif. Pour r\[EAcute]duire le co\[UHat]t politique, on propose \ des politiques prospectives, s'inspirant d'un stratag\[EGrave]me de cliquet \ pour un but unique et d\[EAcute]pendant de trois param\[EGrave]tres : s\ \[EAcute]rendipit\[EAcute], horizon et dynamisme. Les strat\[EAcute]gies \ ainsi produites sont jug\[EAcute]es exactement, par r\[EAcute]currence \ \[AGrave] rebours, pour un \[EAcute]chantillon de fonctions \ d'utilit\[EAcute]. Une fonction d'utilit\[EAcute] qui rend la \ s\[EAcute]rendipit\[EAcute] utile est dite floue. On propose des lois \ empiriques d'utilit\[EAcute] strat\[EAcute]gique. \[LeftGuillemet] La \ politique \[RightGuillemet] appara\[IHat]t enfin comme une \ m\[EAcute]ta-politique, fond\[EAcute]e sur une utilit\[EAcute] \ \[LeftGuillemet] lib\[EAcute]r\[EAcute]e \[RightGuillemet] du co\[UHat]t \ politique.\ \>", "Text", TextAlignment->Left, TextJustification->0], Cell["\<\ Mots-cl\[EAcute]s : utilit\[EAcute], r\[EAcute]trospection, \ prospection, cliquet, s\[EAcute]rendipit\[EAcute], dynamisme, horizon.\ \>", \ "Text", TextAlignment->Left, TextJustification->0], Cell[CellGroupData[{ Cell["Introduction", "Section", CellTags->"c:2"], Cell[CellGroupData[{ Cell["\[LeftGuillemet] Lisez-moi \[RightGuillemet]", "Subsection", CellTags->"c:3"], Cell[TextData[{ "Pour la th\[EAcute]orie, les r\[EAcute]f\[EAcute]rences bibliographiques, \ la r\[EGrave]gle du jeu\[Ellipsis] c. f. article compagnon ", StyleBox["Serendipity in 421, a stochastic game of life", FontSlant->"Italic"], ", ", ButtonBox["http://pierre.albarede.free.fr", ButtonData:>{ URL[ "http://pierre.albarede.free.fr"], None}, ButtonStyle->"Hyperlink"], "." }], "Text"], Cell[TextData[{ "Conventions de \[LeftGuillemet] sens large \[RightGuillemet] : ", Cell[BoxData[ \(TraditionalForm\`0\)]], " est n\[EAcute]gatif et positif, sup\[EAcute]rieur est ", Cell[BoxData[ \(TraditionalForm\` \[GreaterEqual] \)]], ", fonction croissante\[Ellipsis], le pr\[EAcute]sent appartient au pass\ \[EAcute] et au futur\[Ellipsis]" }], "Text"], Cell["\<\ \[LeftGuillemet] \[WarningSign] \[RightGuillemet] introduit une \ proposition de modification, \[LeftGuillemet] \[Wolf] \[RightGuillemet] \ introduit une remarque (soul\[EGrave]ve un li\[EGrave]vre).\ \>", "Text"], Cell[TextData[{ "Apr\[EGrave]s l'initialisation, chaque partie ", StyleBox["num\[EAcute]rot\[EAcute]e", FontSlant->"Italic"], " peut \[EHat]tre \[EAcute]valu\[EAcute]es ind\[EAcute]pendamment. Il est \ conseiller alors d'aller jusqu'au bout (pour ne pas laisser d'affectation ind\ \[EAcute]sirable)." }], "Text"], Cell[TextData[{ "Des fichiers de probabilit\[EAcute]s et un fichier d'utilit\[EAcute] strat\ \[EAcute]gique sont normalement joints \[AGrave] ce cahier. Sinon, les \ premiers seront r\[EAcute]g\[EAcute]n\[EAcute]r\[EAcute]s automatiquement et \ le second peut \[EHat]tre r\[EAcute]g\[EAcute]n\[EAcute]r\[EAcute] en ex\ \[EAcute]cutant la section ", CounterBox["Section", "section1"], ".", CounterBox["Subsection", "section1"], ".", CounterBox["Subsubsection", "section1"], " et la section ", CounterBox["Section", "section2"], ".", CounterBox["Subsection", "section2"], ".", CounterBox["Subsubsection", "section2"], "." }], "Text"], Cell[CellGroupData[{ Cell[BoxData[{ \(<< AuthorTools`\), "\n", \(SetDirectory@\(NotebookFolder@InputNotebook[]\)\)}], "Input", InitializationCell->True], Cell[BoxData[ \("/Users/alba/Documents/ma cre\:0301ation/421/calcul"\)], "Output"] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[ \(FileNames[{"\", "\<*Utility*\>"}]\)], "Input"], Cell[BoxData[ \({"probability1_2_3.txt", "probability2_2_2.txt", "probability2_3_3.txt", "probability2_3_4.txt", "probability2_4_3.txt", "probability3_6_3.txt", "strategyUtility.txt"}\)], "Output"] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[{ \(Utilities`Notation`AutoLoadNotationPalette = False\), "\[IndentingNewLine]", \(<< Utilities`Notation`\)}], "Input", InitializationCell->True], Cell[BoxData[ \(False\)], "Output"] }, Open ]], Cell["On pr\[EAcute]sentera souvent les arguments en groupes, comme", "Text"], Cell[BoxData[ \(\(action_[conditions__]\)[object__]\)], "Input", Evaluatable->False], Cell[TextData[{ "Exemple : ", Cell[BoxData[ \(TraditionalForm\`myPower[n_]\)]], " est la puissance n-i\[EGrave]me." }], "Text"], Cell[CellGroupData[{ Cell[BoxData[ \(Block[{myPower}, \[IndentingNewLine]myPower[n_]@x_ := Power[x, n]; \[IndentingNewLine]myPower[n_]@ x_\[IndentingNewLine]]\)], "Input"], Cell[BoxData[ \(x_\^n_\)], "Output"] }, Open ]] }, Open ]], Cell[CellGroupData[{ Cell["Jouer contre la providence", "Subsection", CellTags->"c:4"], Cell[TextData[{ "\[CapitalAGrave] l'int\[EAcute]rieur du jeu de 421, on traite seulement un \ tour, sous-jeu opposant un joueur \[AGrave] la providence, probl\[EGrave]me \ de contr\[OHat]le en fait. Une combinaison de d\[EAcute]s mis de c\[OHat]t\ \[EAcute] en particulier constitue un ", StyleBox["\[EAcute]tat", FontSlant->"Italic"], ", une combinaison de d\[EAcute]s qui viennent d'\[EHat]tre lanc\[EAcute]s \ constitue un ", StyleBox["\[EAcute]v\[EAcute]nement", FontSlant->"Italic"], ". Le nombre de lancers sert de date discr\[EGrave]te (initialement z\ \[EAcute]ro). Apr\[EGrave]s chaque \[EAcute]v\[EAcute]nement, un \ \[EAcute]tat est choisi (d'apr\[EGrave]s les r\[EGrave]gles du jeu). " }], "Text"], Cell[TextData[{ "D\[EAcute]f. : un ", StyleBox["destin", FontSlant->"Italic"], " est une suite \[EAcute]tat-\[EAcute]v\[EAcute]nement-\[EAcute]tat\ \[Ellipsis], pr\[EAcute]cisant la probabilit\[EAcute] de chaque \[EAcute]v\ \[EAcute]nement; un ", StyleBox["arbre du destin", FontSlant->"Italic"], " d\[EAcute]termine un ", "ensemble de destins possibles, en pr\[EAcute]cisant la probabilit\[EAcute] \ des \[EAcute]v\[EAcute]nements", "." }], "Text"], Cell[TextData[{ "Tout destin est clos par une certaine ", StyleBox["utilit\[EAcute]", FontSlant->"Italic"], ", un nombre, qui (d'apr\[EGrave]s les r\[EGrave]gles du jeu) ne \ d\[EAcute]pend que de la date et de l'\[EAcute]tat finaux, mais non du pass\ \[EAcute] strict." }], "Text"], Cell[TextData[{ "D\[EAcute]f. : une ", StyleBox["strat\[EAcute]gie", FontSlant->"Italic"], " d\[EAcute]termine un ensemble de destins choisis, en pr\[EAcute]cisant la \ probabilit\[EAcute] des \[EAcute]tats ; une ", StyleBox["politique", FontSlant->"Italic"], " est un programme produisant une strat\[EAcute]gie." }], "Text"], Cell["\<\ Il existe une certaine sym\[EAcute]trie entre un arbre du destin vu \ par un joueur, et une strat\[EAcute]gie vue par la providence. \ \>", "Text"], Cell["\<\ Des politiques distinctes peuvent produire une m\[EHat]me strat\ \[EAcute]gie.\ \>", "Text"], Cell[TextData[{ "Une strat\[EAcute]gie dit souvent plus que ce qui est n\[EAcute]cessaire \ pour jouer. Ainsi, d\[EGrave]s apr\[EGrave]s le premier \ \[EAcute]v\[EAcute]nement, tous les choix d'\[EAcute]tat conditionn\[EAcute]s \ par les \[EAcute]v\[EAcute]nements qui ne se sont pas produits deviennent \ inutiles. Une politique ", StyleBox["dynamique", FontSlant->"Italic"], " d\[EAcute]termine seulement le prochain \[EAcute]tat, tenant compte du \ pass\[EAcute]." }], "Text"], Cell[TextData[{ StyleBox["Th\[EAcute]or\[EGrave]me de von Neumann-Morgenstern", FontSlant->"Italic"], " : \n- l'utilit\[EAcute] exprime exactement la pr\[EAcute]f\[EAcute]rence, \ c'est-\[AGrave]-dire, l'\[EAcute]tat choisi est d'utilit\[EAcute] maximale,\n\ - l'utilit\[EAcute] d'un \[EAcute]tat courant est la moyenne des utilit\ \[EAcute]s des \[EAcute]v\[EAcute]nements suivants, pond\[EAcute]r\[EAcute]e \ par leur probabilit\[EAcute]." }], "Text"], Cell[TextData[{ "Quand plusieurs \[EAcute]tats sont de m\[EHat]me utilit\[EAcute] maximale, \ on a un probl\[EGrave]me de ", StyleBox["choix indiff\[EAcute]rent", FontSlant->"Italic"], ", classiquement", " r\[EAcute]solu par", StyleBox[" \[EAcute]quiprobabilit\[EAcute]", FontSlant->"Italic"], ". Alors, avec le th\[EAcute]or\[EGrave]me pr\[EAcute]c\[EAcute]dent, il \ existe une unique plus utile strat\[EAcute]gie, calculable avec une ", StyleBox["politique r\[EAcute]trospectrive", FontSlant->"Italic"], ", bas\[EAcute]e sur la \[LeftGuillemet] r\[EAcute]currence \[AGrave] \ rebours \[RightGuillemet]. \[Wolf] La r\[EAcute]currence n'est pas un \ programme (mais un raisonnement), la r\[EAcute]currence \[AGrave] rebours \ interviendra ici de plusieurs mani\[EGrave]res qu'il faudra bien distinguer." }], "Text"], Cell["\<\ Les d\[EAcute]s \[EAcute]tant ind\[EAcute]pendants et non \ \[LeftGuillemet] pip\[EAcute]s \[RightGuillemet], les probabilit\[EAcute]s, \ donc les utilit\[EAcute]s qui en d\[EAcute]coulent, sont invariantes par \ permutation globale des faces.\ \>", "Text"], Cell[TextData[{ "Il y a ", Cell[BoxData[ \(TraditionalForm\`d\)]], " d\[EAcute]s \[AGrave] ", Cell[BoxData[ \(TraditionalForm\`f\)]], " faces, qu'un premier joueur lance au plus ", Cell[BoxData[ \(TraditionalForm\`j\)]], " fois. Normalement," }], "Text"], Cell[BoxData[ \({d = 3, f = 6, j = 3}\)], "Input", Evaluatable->False], Cell["mais des cas r\[EAcute]duits, tel", "Text"], Cell[BoxData[ \({d = 2, f = 3, j = 3}\)], "Input", Evaluatable->False], Cell[TextData[{ "serviront \[AGrave] la mise au point ou appara\[IHat]tront un sous-probl\ \[EGrave]me ", StyleBox["auto-similaire", FontSlant->"Italic"], " du cas normal. En effet, un tour commenc\[EAcute], en tant que probl\ \[EGrave]me de contr\[OHat]le, est identique \[AGrave] un tour non-commenc\ \[EAcute], les param\[EGrave]tres ", Cell[BoxData[ \(TraditionalForm\`d, \ j\)]], " \[EAcute]tant r\[EAcute]duits respectivement du nombre de d\[EAcute]s mis \ de c\[OHat]t\[EAcute] et du nombre de lancers pass\[EAcute]s. Ainsi, ", Cell[BoxData[ \(TraditionalForm\`d, \ j\)]], " sont des param\[EGrave]tres dynamiques, au contraire de ", Cell[BoxData[ \(TraditionalForm\`f\)]], ". \[WarningSign] Modifier l'ordre logique, suivant ", Cell[BoxData[ \(TraditionalForm\`d, f, j \[Rule] f, j, d\)]], "." }], "Text"] }, Open ]] }, Open ]], Cell[CellGroupData[{ Cell["Prologue", "Section", CellTags->"c:5"], Cell[CellGroupData[{ Cell["Formats", "Subsection", CellTags->"c:6"], Cell[BoxData[{ \(\(noSymbol = If[NumberQ@#, #, Switch[#, False, False, True, True, _, "\"]] &;\)\), "\n", \(\(noRational = Switch[#, _Rational, If[Abs@# \[GreaterEqual] 0.001, PaddedForm[1. #, {4, 3}], ScientificForm[1. #, 1]], _, #] &;\)\)}], "Input", InitializationCell->True], Cell[CellGroupData[{ Cell[BoxData[ \({noSymbol[4/9], noSymbol@_}\)], "Input"], Cell[BoxData[ \({4\/9, "?"}\)], "Output"] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[ \({noRational[4/9], noRational@1, noRational@_, noRational[\(-1\)/23], noRational[1/3123]}\)], "Input"], Cell[BoxData[ RowBox[{"{", RowBox[{ TagBox[ InterpretationBox["\<\" 0.444\"\>", 0.44444444444444442, AutoDelete->True], (PaddedForm[ #, {4, 3}]&)], ",", "1", ",", "_", ",", TagBox[ InterpretationBox["\<\"-0.043\"\>", -0.043478260869565216, AutoDelete->True], (PaddedForm[ #, {4, 3}]&)], ",", TagBox[ InterpretationBox[\("3."\[Times]10\^"-4"\), 0.00032020493115593977, AutoDelete->True], (ScientificForm[ #, 1]&)]}], "}"}]], "Output"] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[ \(noRational@noSymbol[4/9]\)], "Input"], Cell[BoxData[ TagBox[ InterpretationBox["\<\" 0.444\"\>", 0.44444444444444442, AutoDelete->True], (PaddedForm[ #, {4, 3}]&)]], "Output"] }, Open ]], Cell[TextData[{ "Ici, ", StyleBox["noRational", "Output"], " est compris comme un symbole." }], "Text"], Cell[CellGroupData[{ Cell[BoxData[ \(noSymbol@noRational[4/9]\)], "Input"], Cell[BoxData[ \("?"\)], "Output"] }, Open ]], Cell[BoxData[{ \(\(approximationBox = DisplayForm@ RowBox[{#, "\<\[TildeEqual]\>", noRational@#}] &;\)\), "\[IndentingNewLine]", \(\(smallBox = DisplayForm[ GridBox[{{#}}, ColumnWidths \[Rule] 20, ColumnAlignments \[Rule] Left]] &;\)\)}], "Input", InitializationCell->True], Cell[CellGroupData[{ Cell[BoxData[ \(approximationBox[4/9]\)], "Input"], Cell[BoxData[ TagBox[ RowBox[{\(4\/9\), "\[TildeEqual]", TagBox[ InterpretationBox["\<\" 0.444\"\>", 0.44444444444444442, AutoDelete->True], (PaddedForm[ #, {4, 3}]&)]}], DisplayForm]], "Output"] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[ \(smallBox@Expand[\((1 + _)\)^15]\)], "Input"], Cell[BoxData[ TagBox[GridBox[{ {\(1 + 15\ _ + 105\ _\^2 + 455\ _\^3 + 1365\ _\^4 + 3003\ _\^5 + 5005\ _\^6 + 6435\ _\^7 + 6435\ _\^8 + 5005\ _\^9 + 3003\ _\^10 + 1365\ _\^11 + 455\ _\^12 + 105\ _\^13 + 15\ _\^14 + _\^15\)} }, ColumnWidths->20, ColumnAlignments->{Left}], DisplayForm]], "Output"] }, Open ]] }, Open ]], Cell[CellGroupData[{ Cell["Co\[UHat]t de calcul", "Subsection", CellTags->"c:7"], Cell["co\[UHat]t = (dur\[EAcute]e, taille).", "Text"], Cell["\<\ \[Wolf] Le temps et l'espace du calcul sont assez artificiellement \ distingu\[EAcute]s du temps et de l'espace \[LeftGuillemet] r\[EAcute]els \ \[RightGuillemet] appartenant \[AGrave] l'objet du calcul.\ \>", "Text"], Cell[CellGroupData[{ Cell["Dur\[EAcute]e", "Outline2"], Cell[BoxData[ \(timeString := Apply[StringJoin, \(ToString /@ {#[\([1]\)], "\", #[\([2]\)], \ "\", #[\([3]\)], "\"} &\)@Take[Date[], \(-3\)]]\)], "Input", InitializationCell->True], Cell[CellGroupData[{ Cell[BoxData[ \(timeString\)], "Input"], Cell[BoxData[ \("13h:51min:15s"\)], "Output"] }, Open ]], Cell["\<\ Comparer les dur\[EAcute]es, avec une sensibilit\[EAcute] accrue, \ effet de zoom. \[WarningSign] En option, assurer l'\[EAcute]galit\[EAcute] \ des expressions.\ \>", "Text"], Cell[BoxData[{ \(\(Clear@zoomTiming;\)\), "\[IndentingNewLine]", \(\(zoomTiming[expression__, trialNumber_Integer] := Block[{zoomTiming1}, \[IndentingNewLine]zoomTiming1@expression1_ := First@\(Timing@ Do[expression1, {trialNumber}]\); \ \[IndentingNewLine]Attributes@ zoomTiming1 = {HoldAll}; \[IndentingNewLine]zoomTiming1 /@ Unevaluated@{expression}];\)\), "\[IndentingNewLine]", \(\(Attributes@zoomTiming = {HoldAll};\)\)}], "Input"], Cell[CellGroupData[{ Cell[BoxData[ \(zoomTiming[Expand[\((1 + _)\)^15], 500]\)], "Input"], Cell[BoxData[ \({0.09999999999999964`\ Second}\)], "Output"] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[ \(zoomTiming[Expand[\((1 + _)\)^15], Expand[\((1 + _)\)^30], 500]\)], "Input"], Cell[BoxData[ \({0.09999999999999964`\ Second, 0.16999999999999993`\ Second}\)], "Output"] }, Open ]], Cell["Variante fonctionnelle, propos\[EAcute]e par R\[EAcute]mi \ Barr\[EGrave]re :", "Text"], Cell[BoxData[{ \(\(Clear@zoomTiming;\)\), "\[IndentingNewLine]", \(\(Attributes@zoomTiming = {HoldAll};\)\), "\[IndentingNewLine]", \(\(zoomTiming[expression_, trialNumber_Integer] := First@\(Timing@ Do[expression, {trialNumber}]\);\)\), "\[IndentingNewLine]", \(zoomTiming[expression__, trialNumber_] := {ReleaseHold[ Hold /@ \((Hold@expression)\) /. Hold@x_ \[RuleDelayed] zoomTiming[x, trialNumber]]}\)}], "Input", InitializationCell->True], Cell[CellGroupData[{ Cell[BoxData[ \(zoomTiming[Expand[\((1 + _)\)^15], 500]\)], "Input"], Cell[BoxData[ \(0.07000000000000028`\ Second\)], "Output"] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[ \(zoomTiming[Expand[\((1 + _)\)^15], Expand[\((1 + _)\)^30], 500]\)], "Input"], Cell[BoxData[ \({0.09999999999999964`\ Second, 0.16999999999999993`\ Second}\)], "Output"] }, Open ]] }, Open ]], Cell[CellGroupData[{ Cell["Taille", "Outline2"], Cell[CellGroupData[{ Cell[BoxData[ \(MemoryConstrained[3^5, 1]\)], "Input"], Cell[BoxData[ \(243\)], "Output"] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[{ \(MemoryConstrained[2^2 + 1, 23]\), "\n", \(MemoryConstrained[2^2 + 1, 24]\)}], "Input"], Cell[BoxData[ \($Aborted\)], "Output"], Cell[BoxData[ \(5\)], "Output"] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[{ \(MemoryConstrained[Expand[\((1 + x_)\)^15], 767]\), "\n", \(MemoryConstrained[Expand[\((1 + x_)\)^15], 768]\)}], "Input"], Cell[BoxData[ \($Aborted\)], "Output"], Cell[BoxData[ \(1 + 15\ x_ + 105\ x_\^2 + 455\ x_\^3 + 1365\ x_\^4 + 3003\ x_\^5 + 5005\ x_\^6 + 6435\ x_\^7 + 6435\ x_\^8 + 5005\ x_\^9 + 3003\ x_\^10 + 1365\ x_\^11 + 455\ x_\^12 + 105\ x_\^13 + 15\ x_\^14 + x_\^15\)], "Output"] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[ \(ByteCount@%\)], "Input"], Cell[BoxData[ \(1704\)], "Output"] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[ \(With[{memoryInUse1 = MemoryInUse[]}, Expand[\((1 + x_)\)^15]; MemoryInUse[] - memoryInUse1]\)], "Input"], Cell[BoxData[ \(800\)], "Output"] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[ \(Block[{x}, Expand[\((1 + x)\)^15] /. x \[Rule] \(-1\)]\)], "Input"], Cell[BoxData[ \(0\)], "Output"] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[{ \(MemoryConstrained[ Block[{x}, Expand[\((1 + x)\)^15] /. x \[Rule] \(-1\)], 1687]\), "\n", \(MemoryConstrained[ Block[{x}, Expand[\((1 + x)\)^15] /. x \[Rule] \(-1\)], 1688]\)}], "Input"], Cell[BoxData[ \($Aborted\)], "Output"], Cell[BoxData[ \(0\)], "Output"] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[ \(With[{memoryInUse1 = MemoryInUse[]}, Block[{x}, Expand[\((1 + x)\)^15] /. x \[Rule] \(-1\)]; MemoryInUse[] - memoryInUse1]\)], "Input"], Cell[BoxData[ \(44\)], "Output"] }, Open ]] }, Open ]] }, Open ]], Cell[CellGroupData[{ Cell["Listes", "Subsection", CellTags->"c:8"], Cell[CellGroupData[{ Cell["Moyenne et \[EAcute]cart-type", "Subsubsection", CellTags->"c:9"], Cell[BoxData[ \(<< DiscreteMath`Combinatorica`\)], "Input", InitializationCell->True], Cell[CellGroupData[{ Cell[BoxData[ \(Mean@{x_, y_, z_}\)], "Input"], Cell[BoxData[ \(1\/3\ \((x_ + y_ + z_)\)\)], "Output"] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[ \(Mean@{}\)], "Input"], Cell[BoxData[ \(Mean[{}]\)], "Output"] }, Open ]], Cell[BoxData[ \(\(myMean = Plus @@ #/Length@# &;\)\)], "Input", InitializationCell->True], Cell[CellGroupData[{ Cell[BoxData[ \(myMean@{x_, y_, z_}\)], "Input"], Cell[BoxData[ \(1\/3\ \((x_ + y_ + z_)\)\)], "Output"] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[ \(myMean@{}\)], "Input"], Cell[BoxData[ \(Power::"infy" \(\(:\)\(\ \)\) "Infinite expression \!\(1\/0\) encountered."\)], "Message"], Cell[BoxData[ RowBox[{\(\[Infinity]::"indet"\), \(\(:\)\(\ \)\), "\<\"Indeterminate \ expression \\!\\(0\\\\ \\*InterpretationBox[\\\"ComplexInfinity\\\", \ DirectedInfinity[]]\\) encountered.\"\>"}]], "Message"], Cell[BoxData[ \(Indeterminate\)], "Output"] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[ \(With[{list1 = Table[Random[], {100}]}, \[IndentingNewLine]{myMean@list1 \[Equal] Mean@list1, \[IndentingNewLine]zoomTiming[myMean@list1, Mean@list1, myDispersionReport@list1, 1000]}]\)], "Input"], Cell[BoxData[ \({True, {0.10999999999999943`\ Second, 0.14000000000000057`\ Second, 0.6700000000000017`\ Second}}\)], "Output"] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[ \(StandardDeviationMLE[{x_, y_, z_}]\)], "Input"], Cell[BoxData[ \(\@\(\((x_ + 1\/3\ \((\(-x_\) - y_ - z_)\))\)\^2 + \((y_ + 1\/3\ \ \((\(-x_\) - y_ - z_)\))\)\^2 + \((1\/3\ \((\(-x_\) - y_ - z_)\) + z_)\)\^2\)\ \/\@3\)], "Output"] }, Open ]], Cell[BoxData[ \(\(myDispersionReport = {myMean@#, StandardDeviationMLE@#} &;\)\)], "Input", InitializationCell->True], Cell[CellGroupData[{ Cell[BoxData[ \(myDispersionReport@Table[Random[], {100}]\)], "Input"], Cell[BoxData[ \({0.4947069540876893`, 0.2940650352205703`}\)], "Output"] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[{ \(Sqrt@Integrate[\((x - 1/2)\)^2, {x, 0, 1}]\), "\[IndentingNewLine]", \(1. %\)}], "Input"], Cell[BoxData[ \(1\/\(2\ \@3\)\)], "Output"], Cell[BoxData[ \(0.2886751345948129`\)], "Output"] }, Open ]] }, Open ]], Cell[CellGroupData[{ Cell["Accumuler", "Subsubsection", CellTags->"c:10"], Cell["Accumule de gauche \[AGrave] droite.", "Text"], Cell[CellGroupData[{ Cell[BoxData[ \(FoldList[Hold, 0, {1, 2}]\)], "Input"], Cell[BoxData[ \({0, Hold[0, 1], Hold[Hold[0, 1], 2]}\)], "Output"] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[ \(FoldList[Append[#1, \ #2] &, {0}, {1, 2, 3, 4}]\)], "Input"], Cell[BoxData[ \({{0}, {0, 1}, {0, 1, 2}, {0, 1, 2, 3}, {0, 1, 2, 3, 4}}\)], "Output"] }, Open ]], Cell[BoxData[ \(Clear@reverseFoldList; reverseFoldList[function1_, list1_List, x_] := Reverse@FoldList[function1 @@ Reverse@{##} &, x, Reverse@list1]\)], "Input", InitializationCell->True], Cell["Accumule de droite \[AGrave] gauche.", "Text"], Cell[CellGroupData[{ Cell[BoxData[ \(reverseFoldList[Hold, {2, 1}, 0]\)], "Input"], Cell[BoxData[ \({Hold[2, Hold[1, 0]], Hold[1, 0], 0}\)], "Output"] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[ \(reverseFoldList[Append[#2, \ #1] &, {4, 3, 2, 1}, {0}]\)], "Input"], Cell[BoxData[ \({{0, 1, 2, 3, 4}, {0, 1, 2, 3}, {0, 1, 2}, {0, 1}, {0}}\)], "Output"] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[ \(With[{list1 = {1, 2, 3, 4}}, \[IndentingNewLine]\(Take[list1, #] &\) /@ Range[0, Length@list1]\[IndentingNewLine]]\)], "Input"], Cell[BoxData[ \({{}, {1}, {1, 2}, {1, 2, 3}, {1, 2, 3, 4}}\)], "Output"] }, Open ]], Cell[BoxData[ \(Clear@history; history@list1_List := \(Take[list1, #] &\) /@ Range[0, Length@list1]\)], "Input"], Cell[CellGroupData[{ Cell[BoxData[ \(history@{1, 2, 3, 4}\)], "Input"], Cell[BoxData[ \({{}, {1}, {1, 2}, {1, 2, 3}, {1, 2, 3, 4}}\)], "Output"] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[ \(zoomTiming[history@{1, 2, 3, 4}, 10000]\)], "Input"], Cell[BoxData[ \(0.6899999999999977`\ Second\)], "Output"] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[ \(FoldList[Append[#1, \ #2] &, {}, {1, 2, 3, 4}]\)], "Input"], Cell[BoxData[ \({{}, {1}, {1, 2}, {1, 2, 3}, {1, 2, 3, 4}}\)], "Output"] }, Open ]], Cell[BoxData[ \(Clear@history; history@list1_List := FoldList[Append[#1, \ #2] &, {}, list1]\)], "Input",\ InitializationCell->True], Cell[CellGroupData[{ Cell[BoxData[ \(history@{1, 2, 3, 4}\)], "Input"], Cell[BoxData[ \({{}, {1}, {1, 2}, {1, 2, 3}, {1, 2, 3, 4}}\)], "Output"] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[ \(zoomTiming[history@{1, 2, 3, 4}, 10000]\)], "Input"], Cell[BoxData[ \(0.4099999999999966`\ Second\)], "Output"] }, Open ]] }, Open ]], Cell[CellGroupData[{ Cell["Constance", "Subsubsection", CellTags->"c:11"], Cell[CellGroupData[{ Cell["Version fonctionnelle", "Outline2"], Cell[BoxData[{ \(\(Clear@constantQ;\)\), "\[IndentingNewLine]", \(\(constantQ@{} = True;\)\), "\[IndentingNewLine]", \(constantQ@list1_List := With[{first1 = First@list1}, Apply[And, \(# \[Equal] first1 &\) /@ list1]]\)}], "Input"], Cell[CellGroupData[{ Cell[BoxData[{ \(constantQ /@ {{}, {1}, {1, 1}, {1, 1, 1}, {1, 1, 1, 1}, Table[\(-1\), {10}]}\), "\[IndentingNewLine]", \(constantQ /@ {{1, 2}, {1, 1, 1, 1, 2}, {1, 1, 1, 2, 2, 2}}\), "\[IndentingNewLine]", \(constantQ@{x_, y_, x_, z_, x_, 1}\)}], "Input"], Cell[BoxData[ \({True, True, True, True, True, True}\)], "Output"], Cell[BoxData[ \({False, False, False}\)], "Output"], Cell[BoxData[ \(y_ == x_ && z_ == x_ && 1 == x_\)], "Output"] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[ \(zoomTiming[constantQ@Table[1, {1000}], 20]\)], "Input"], Cell[BoxData[ \(0.10999999999999943`\ Second\)], "Output"] }, Open ]] }, Open ]], Cell[CellGroupData[{ Cell["Version r\[EAcute]cursive", "Outline2"], Cell[BoxData[{ \(\(Clear@constantQ;\)\), "\[IndentingNewLine]", \(\(constantQ@{___} = True;\)\), "\[IndentingNewLine]", \(constantQ@{x1_, x2_, x3___} := x1 \[Equal] x2 && constantQ@{x2, x3}\)}], "Input"], Cell[CellGroupData[{ Cell[BoxData[{ \(constantQ /@ {{}, {1}, {1, 1}, {1, 1, 1}, {1, 1, 1, 1}, Table[\(-1\), {10}]}\), "\[IndentingNewLine]", \(constantQ /@ {{1, 2}, {1, 1, 1, 1, 2}, {1, 1, 1, 2, 2, 2}}\), "\[IndentingNewLine]", \(constantQ@{x_, y_, x_, z_, x_, 1}\)}], "Input"], Cell[BoxData[ \({True, True, True, True, True, True}\)], "Output"], Cell[BoxData[ \({False, False, False}\)], "Output"], Cell[BoxData[ \(x_ == y_ && y_ == x_ && x_ == z_ && z_ == x_ && x_ == 1\)], "Output"] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[ \(Block[{$RecursionLimit = 1010}, zoomTiming[constantQ@Table[1, {1000}], 20]]\)], "Input"], Cell[BoxData[ \(2.25`\ Second\)], "Output"] }, Open ]] }, Open ]], Cell[CellGroupData[{ Cell["Version transformationnelle", "Outline2"], Cell[BoxData[{ \(\(Clear@constantQ;\)\), "\[IndentingNewLine]", \(constantQ@list1_List := Block[{x, y}, Length[list1 //. {x_, x_, y___} \[Rule] {x, y}] \[LessEqual] 1]\)}], "Input"], Cell[CellGroupData[{ Cell[BoxData[{ \(constantQ /@ {{}, {1}, {1, 1}, {1, 1, 1}, {1, 1, 1, 1}, Table[\(-1\), {10}]}\), "\n", \(constantQ /@ {{1, 2}, {1, 1, 1, 1, 2}, {1, 1, 1, 2, 2, 2}}\), "\n", \(constantQ@{x_, y_, x_, z_, x_, 1}\)}], "Input"], Cell[BoxData[ \({True, True, True, True, True, True}\)], "Output"], Cell[BoxData[ \({False, False, False}\)], "Output"], Cell[BoxData[ \(False\)], "Output"] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[ \(zoomTiming[constantQ@Table[1, {1000}], 20]\)], "Input"], Cell[BoxData[ \(1.8500000000000014`\ Second\)], "Output"] }, Open ]], Cell[BoxData[{ \(\(Clear@constantQ;\)\), "\[IndentingNewLine]", \(constantQ[{}] = True; constantQ@list1_List := Switch[DeleteCases[list1, First@list1], {}, True, _, False]\)}], "Input",\ InitializationCell->True], Cell[CellGroupData[{ Cell[BoxData[{ \(constantQ /@ {{}, {1}, {1, 1}, {1, 1, 1}, {1, 1, 1, 1}, Table[\(-1\), {10}]}\), "\n", \(constantQ /@ {{1, 2}, {1, 1, 1, 1, 2}, {1, 1, 1, 2, 2, 2}}\), "\n", \(constantQ@{x_, y_, x_, z_, x_, 1}\)}], "Input"], Cell[BoxData[ \({True, True, True, True, True, True}\)], "Output"], Cell[BoxData[ \({False, False, False}\)], "Output"], Cell[BoxData[ \(True\)], "Output"] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[ \(constantQ@{x, y, x, z, x, 1}\)], "Input"], Cell[BoxData[ \(False\)], "Output"] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[ \(DeleteCases[{x_}, y_]\)], "Input"], Cell[BoxData[ \({}\)], "Output"] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[ \(zoomTiming[constantQ@Table[1, {1000}], 20]\)], "Input"], Cell[BoxData[ \(0.030000000000001137`\ Second\)], "Output"] }, Open ]] }, Open ]] }, Open ]], Cell[CellGroupData[{ Cell["Remplir un tableau", "Subsubsection", CellTags->"c:12"], Cell[BoxData[ \(\(list1 = {{{1, 1}, a11}, {{1, 2}, a12}, {{1, 3}, a13}, {{2, 2}, a22}, {{2, 3}, a23}};\)\)], "Input"], Cell[CellGroupData[{ Cell[BoxData[ \(Clear@ function1; \(\((function1[#[\([1, 1]\)], #[\([1, \(-1\)]\)]] = Last@#)\) &\) /@ list1; \(?function1\)\)], "Input"], Cell["Global`function1", "Print", CellTags->"Info3311261950-7612531"], Cell[BoxData[ InterpretationBox[GridBox[{ {GridBox[{ {\(function1[1, 1] = a11\)}, {" "}, {\(function1[1, 2] = a12\)}, {" "}, {\(function1[1, 3] = a13\)}, {" "}, {\(function1[2, 2] = a22\)}, {" "}, {\(function1[2, 3] = a23\)} }, GridBaseline->{Baseline, {1, 1}}, ColumnWidths->0.999, ColumnAlignments->{Left}]} }, GridBaseline->{Baseline, {1, 1}}, ColumnAlignments->{Left}], Definition[ "function1"], Editable->False]], "Print", CellTags->"Info3311261950-7612531"] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[ \(list2 = Union[First /@ \((First /@ list1)\)]\)], "Input"], Cell[BoxData[ \({1, 2}\)], "Output"] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[ \(list3 = Union[Last /@ \((First /@ list1)\)]\)], "Input"], Cell[BoxData[ \({1, 2, 3}\)], "Output"] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[ \(Outer[function1, list2, list3, 1, 1] /. \((function1@__ \[Rule] "\")\)\)], "Input"], Cell[BoxData[ \({{a11, a12, a13}, {"case vide", a22, a23}}\)], "Output"] }, Open ]], Cell[BoxData[ \(Clear@function1; {list1, list2, list3} =. ;\)], "Input"], Cell[TextData[{ "\[Wolf] Ici le style proc\[EAcute]dural (", StyleBox["function1", "Output"], " est une variable non constante \[DoubleLeftRightArrow] ", StyleBox["Module", "Output"], " ne peut pas \[EHat]tre remplac\[EAcute] par ", StyleBox["With", "Output"], ") est pr\[EAcute]f\[EAcute]r\[EAcute] au style fonctionnel." }], "Text"], Cell[BoxData[ \(Clear@fill; fill@list1_List := Module[{function1}, \[IndentingNewLine]\(\((function1[#[\([1, 1]\)], #[\([1, \(-1\)]\)]] = Last@#)\) &\) /@ list1; \[IndentingNewLine]With[{\[IndentingNewLine]list2 = Union[First /@ \((First /@ list1)\)], \[IndentingNewLine]list3 = Union[Last /@ \((First /@ list1)\)]\[IndentingNewLine]}, \ \[IndentingNewLine]{Outer[function1, list2, list3, 1, 1] /. \((function1@__ \[Rule] "\<\>")\), \ \[IndentingNewLine]list2, list3}\[IndentingNewLine]]\[IndentingNewLine]]\)], "Input", InitializationCell->True], Cell[CellGroupData[{ Cell[BoxData[ \(\(TableForm[First@#, TableHeadings \[Rule] Rest@#] &\)@\(fill@{{{1, 1}, a11}, {{1, 2}, a12}, {{1, 3}, a13}, {{2, 2}, a22}, {{2, 3}, a23}}\)\)], "Input"], Cell[BoxData[ TagBox[GridBox[{ {"\<\"\"\>", "1", "2", "3"}, {"1", "a11", "a12", "a13"}, {"2", "\<\"\"\>", "a22", "a23"} }, RowSpacings->1, ColumnSpacings->3, RowAlignments->Baseline, ColumnAlignments->{Left}], Function[ BoxForm`e$, TableForm[ BoxForm`e$, TableHeadings -> {{1, 2}, {1, 2, 3}}]]]], "Output"] }, Open ]] }, Open ]], Cell[CellGroupData[{ Cell["D\[EAcute]couper une liste", "Subsubsection", FontWeight->"Bold", CellTags->"c:13"], Cell[TextData[{ "D\[EAcute]couper une liste en sous-listes d'\[EAcute]l\[EAcute]ments cons\ \[EAcute]cutifs. \[WarningSign] Pr\[EAcute]conditionnement : \[EAcute]l\ \[EAcute]ments de ", StyleBox["shape", "Output"], " entiers ", Cell[BoxData[ \(TraditionalForm\`\(\(>\)\(0\)\)\)]], "." }], "Text"], Cell[BoxData[{ \(\(Clear@slice;\)\), "\[IndentingNewLine]", \(\(slice[{}]@{} = {};\)\), "\[IndentingNewLine]", \(slice[shape_List]@list1_List /; Length@list1 \[Equal] Plus @@ shape := Prepend[slice[Rest@shape]@Drop[list1, First@shape], Take[list1, First@shape]\[IndentingNewLine]]\)}], "Input", InitializationCell->True], Cell[CellGroupData[{ Cell[BoxData[ \(slice[{8, 2}]@{1, 2, 3, 4, 5, 6, 7, 8, 9, 10}\)], "Input"], Cell[BoxData[ \({{1, 2, 3, 4, 5, 6, 7, 8}, {9, 10}}\)], "Output"] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[ \(Partition[Range@10, 5]\)], "Input"], Cell[BoxData[ \({{1, 2, 3, 4, 5}, {6, 7, 8, 9, 10}}\)], "Output"] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[ \(slice[{5, 5}]@\(Range@10\)\)], "Input"], Cell[BoxData[ \({{1, 2, 3, 4, 5}, {6, 7, 8, 9, 10}}\)], "Output"] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[ \(slice[{3, 2, 5}]@\(Range@10\)\)], "Input"], Cell[BoxData[ \({{1, 2, 3}, {4, 5}, {6, 7, 8, 9, 10}}\)], "Output"] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[ \(slice[{3, 2, 0, 5}]@\(Range@10\)\)], "Input"], Cell[BoxData[ \({{1, 2, 3}, {4, 5}, {}, {6, 7, 8, 9, 10}}\)], "Output"] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[ \(slice[{1}]@{}\)], "Input"], Cell[BoxData[ \(\(slice[{1}]\)[{}]\)], "Output"] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[ \(slice[{}]@{}\)], "Input"], Cell[BoxData[ \({}\)], "Output"] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[ \(slice[{3, 3, 5}]@\(Range@10\)\)], "Input"], Cell[BoxData[ \(\(slice[{3, 3, 5}]\)[{1, 2, 3, 4, 5, 6, 7, 8, 9, 10}]\)], "Output"] }, Open ]] }, Open ]], Cell[CellGroupData[{ Cell["Tableau d\[EAcute]coup\[EAcute] superficiellement", "Subsubsection", CellTags->"c:14"], Cell[BoxData[ \(\(scanPrint = Scan[Print, #] &;\)\)], "Input", InitializationCell->True], Cell[CellGroupData[{ Cell[BoxData[ \(scanPrint@\(Range@3\)\)], "Input"], Cell[BoxData[ \(1\)], "Print"], Cell[BoxData[ \(2\)], "Print"], Cell[BoxData[ \(3\)], "Print"] }, Open ]], Cell[BoxData[{ \(\(\(Clear@tableFormSlice;\)\(\[IndentingNewLine]\) \)\), "\n", \(\(\(\(tableFormSlice[shape_]\)[list1_, options1___] := \(TableForm[#, options1] &\) /@ slice[shape]@list1;\)\(\n\) \)\), "\[IndentingNewLine]", \(\(tableFormSlice[shape_]\)[list1_, options1___, TableHeadings \[Rule] headings_, options2___] := \[IndentingNewLine]MapThread[ TableForm[#1, options1, TableHeadings \[Rule] Prepend[Rest@headings, #2], options2] &, {slice[shape]@list1, slice[shape]@\(First@headings\)}]\)}], "Input", InitializationCell->True], Cell[CellGroupData[{ Cell[BoxData[ \(\(tableFormSlice[{1, 2}]\)[{{1, 2}, {3, 4}, {5}}]\)], "Input"], Cell[BoxData[ RowBox[{"{", RowBox[{ TagBox[GridBox[{ {"1", "2"} }, RowSpacings->1, ColumnSpacings->3, RowAlignments->Baseline, ColumnAlignments->{Left}], Function[ BoxForm`e$, TableForm[ BoxForm`e$]]], ",", InterpretationBox[GridBox[{ {"3", "4"}, {"5", "\<\"\"\>"} }, RowSpacings->1, ColumnSpacings->3, RowAlignments->Baseline, ColumnAlignments->{Left}], TableForm[ {{3, 4}, {5}}]]}], "}"}]], "Output"] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[ \(scanPrint@\(tableFormSlice[{1, 2}]\)[{{1, 2}, {3, 4}, {5, 6}}]\)], "Input"], Cell[BoxData[ TagBox[GridBox[{ {"1", "2"} }, RowSpacings->1, ColumnSpacings->3, RowAlignments->Baseline, ColumnAlignments->{Left}], Function[ BoxForm`e$, TableForm[ BoxForm`e$]]]], "Print"], Cell[BoxData[ TagBox[GridBox[{ {"3", "4"}, {"5", "6"} }, RowSpacings->1, ColumnSpacings->3, RowAlignments->Baseline, ColumnAlignments->{Left}], Function[ BoxForm`e$, TableForm[ BoxForm`e$]]]], "Print"] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[ \(TableForm[{{1, 2}, {3, 4}, {5, 6}}, TableHeadings \[Rule] {{l1, l2, l3}, {c1, c2}}]\)], "Input"], Cell[BoxData[ TagBox[GridBox[{ {"\<\"\"\>", "c1", "c2"}, {"l1", "1", "2"}, {"l2", "3", "4"}, {"l3", "5", "6"} }, RowSpacings->1, ColumnSpacings->3, RowAlignments->Baseline, ColumnAlignments->{Left}], Function[ BoxForm`e$, TableForm[ BoxForm`e$, TableHeadings -> {{l1, l2, l3}, {c1, c2}}]]]], "Output"] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[ \(scanPrint@\(tableFormSlice[{1, 2}]\)[{{1, 2}, {3, 4}, {5, 6}}, TableHeadings \[Rule] {{l1, l2, l3}, {c1, c2}}]\)], "Input"], Cell[BoxData[ TagBox[GridBox[{ {"\<\"\"\>", "c1", "c2"}, {"l1", "1", "2"} }, RowSpacings->1, ColumnSpacings->3, RowAlignments->Baseline, ColumnAlignments->{Left}], Function[ BoxForm`e$, TableForm[ BoxForm`e$, TableHeadings -> {{l1}, {c1, c2}}]]]], "Print"], Cell[BoxData[ TagBox[GridBox[{ {"\<\"\"\>", "c1", "c2"}, {"l2", "3", "4"}, {"l3", "5", "6"} }, RowSpacings->1, ColumnSpacings->3, RowAlignments->Baseline, ColumnAlignments->{Left}], Function[ BoxForm`e$, TableForm[ BoxForm`e$, TableHeadings -> {{l2, l3}, {c1, c2}}]]]], "Print"] }, Open ]] }, Open ]], Cell[CellGroupData[{ Cell["Fonction d\[EAcute]termin\[EAcute]e par un graphe", "Subsubsection", CellTags->"c:15"], Cell[CellGroupData[{ Cell[BoxData[ \(\(?Graph\)\)], "Input"], Cell[BoxData[ RowBox[{"\<\"Graph[e, v, opts] represents a graph object where e is the \ list of edges annotated with graphics options, v is a list of vertices \ annotated with graphics options, and opts is a set of global graphics \ options.\"\>", " ", ButtonBox[ StyleBox["More\[Ellipsis]", "SR"], ButtonData:>"DiscreteMath`Combinatorica`", Active->True, ButtonStyle->"AddOnsLink"]}]], "Print", CellTags->"Info3307886277-6344574"] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[ \(\(?Permute\)\)], "Input"], Cell[BoxData[ RowBox[{"\<\"Permute[l, p] permutes list l according to permutation \ p.\"\>", " ", ButtonBox[ StyleBox["More\[Ellipsis]", "SR"], ButtonData:>"DiscreteMath`Combinatorica`", Active->True, ButtonStyle->"AddOnsLink"]}]], "Print", CellTags->"Info3307886277-4806660"] }, Open ]], Cell["\<\ Format redondant, mais souple, permettant de d\[EAcute]crire une \ fonction, non n\[EAcute]cessairement une application.\ \>", "Text"], Cell[CellGroupData[{ Cell[BoxData[ \(graph1 = {{1, 4}, {2, 5}, {3, 6}, {4, 1}, {5, 3}, {6, 2}}\)], "Input"], Cell[BoxData[ \({{1, 4}, {2, 5}, {3, 6}, {4, 1}, {5, 3}, {6, 2}}\)], "Output"] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[ \(\(\((Rule @@ #)\) &\) /@ graph1\)], "Input"], Cell[BoxData[ \({1 \[Rule] 4, 2 \[Rule] 5, 3 \[Rule] 6, 4 \[Rule] 1, 5 \[Rule] 3, 6 \[Rule] 2}\)], "Output"] }, Open ]], Cell[BoxData[ \(\(graph1 =. ;\)\)], "Input"], Cell[BoxData[{ \(\(Clear@transform;\)\), "\[IndentingNewLine]", \(transform[graph1_List]@list1_List := Sort[list1 /. \((\(\((Rule @@ #)\) &\) /@ graph1)\)]\)}], "Input", InitializationCell->True], Cell[BoxData[{ \(\(Clear@transform;\)\), "\[IndentingNewLine]", \(transform[graph1_List]@list1_List := list1 /. \((\(\((Rule @@ #)\) &\) /@ graph1)\)\)}], "Input", InitializationCell->True], Cell[CellGroupData[{ Cell[BoxData[ \(transform[{{1, 4}, {2, 5}, {3, 6}, {4, 1}, {5, 3}, {6, 2}}]@{5, 4, 4, 6, 6}\)], "Input"], Cell[BoxData[ \({3, 1, 1, 2, 2}\)], "Output"] }, Open ]], Cell["Inversion :", "Text"], Cell[CellGroupData[{ Cell[BoxData[ \(transform[ Reverse /@ {{1, 4}, {2, 5}, {3, 6}, {4, 1}, {5, 3}, {6, 2}}]@\(transform[{{1, 4}, {2, 5}, {3, 6}, {4, 1}, {5, 3}, {6, 2}}]@{5, 4, 4, 6, 6}\)\)], "Input"], Cell[BoxData[ \({5, 4, 4, 6, 6}\)], "Output"] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[ \(transform[{{5, 4}, {4, 4}}]@{5, 4, 4, 6, 6}\)], "Input"], Cell[BoxData[ \({4, 4, 4, 6, 6}\)], "Output"] }, Open ]] }, Open ]], Cell[CellGroupData[{ Cell["Lieux du maximum d'une fonction num\[EAcute]rique", "Subsubsection", CellTags->"c:16"], Cell[BoxData[ \(list1 = {{2, 4}, {3, 1}, {1, 4}, {3, 3}}; function1 = Plus @@ # &;\)], "Input"], Cell[CellGroupData[{ Cell[BoxData[ \(antigraph = \({function1@#, #} &\) /@ list1\)], "Input"], Cell[BoxData[ \({{6, {2, 4}}, {4, {3, 1}}, {5, {1, 4}}, {6, {3, 3}}}\)], "Output"] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[ \(max1 = Max[First /@ antigraph]\)], "Input"], Cell[BoxData[ \(6\)], "Output"] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[ \(Cases[antigraph, {max1, ___}]\)], "Input"], Cell[BoxData[ \({{6, {2, 4}}, {6, {3, 3}}}\)], "Output"] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[ \({max1, Last /@ Cases[antigraph, {max1, ___}]}\)], "Input"], Cell[BoxData[ \({6, {{2, 4}, {3, 3}}}\)], "Output"] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[{ \(antigraph =. ; max1 =. ;\), "\[IndentingNewLine]", \(With[{antigraph = \({function1@#, #} &\) /@ list1}, \[IndentingNewLine]With[{max1 = Max[First /@ antigraph]}, \[IndentingNewLine]{max1, Last /@ Cases[ antigraph, {max1, \ ___}]}\[IndentingNewLine]]\[IndentingNewLine]]\)}], "Input"], Cell[BoxData[ \({6, {{2, 4}, {3, 3}}}\)], "Output"] }, Open ]], Cell[BoxData[ \(list1 =. ; function1 =. ; antigraph =. ;\)], "Input"], Cell[BoxData[ \(\(argMax = Composition[Last, maxAndArgMax];\)\)], "Input"], Cell[BoxData[{ \(\(Clear@maxAndArgMax;\)\), "\[IndentingNewLine]", \(maxAndArgMax[function1_, list1_List] := With[{antigraph = \({function1@#, #} &\) /@ list1}, \[IndentingNewLine]With[{max1 = Max[First /@ antigraph]}, \[IndentingNewLine]{max1, Last /@ Cases[ antigraph, {max1, ___}]}\[IndentingNewLine]]\ \[IndentingNewLine]]\)}], "Input", InitializationCell->True], Cell[CellGroupData[{ Cell[BoxData[ \(maxAndArgMax[Plus @@ # &, {{2, 4}, {3, 1}, {1, 4}, {3, 3}}]\)], "Input"], Cell[BoxData[ \({6, {{2, 4}, {3, 3}}}\)], "Output"] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[ \(maxAndArgMax[Last, {{2, 4}, {3, 1}, {1, 4}, {3, 2}}]\)], "Input"], Cell[BoxData[ \({4, {{2, 4}, {1, 4}}}\)], "Output"] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[ \(maxAndArgMax[First, {{2, 4}, {3, 1}, {1, 4}, {3, 2}}]\)], "Input"], Cell[BoxData[ \({3, {{3, 1}, {3, 2}}}\)], "Output"] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[ \(maxAndArgMax[Last, {{2, 4}, {3, 1}, {1, 4}, {3, 2}}]\)], "Input"], Cell[BoxData[ \({4, {{2, 4}, {1, 4}}}\)], "Output"] }, Open ]], Cell["\<\ Maximiser seulement sur une sous-liste, d\[EAcute]termin\[EAcute]e \ par la position de ses \[EAcute]l\[EAcute]ments.\ \>", "Text"], Cell[BoxData[{ \(\(list1 = {_, _, {2, 4}, {3, 1}, {1, 4}, _, {3, 2}};\)\), "\[IndentingNewLine]", \(\(position1 = {{3}, {4}, {5}, {7}};\)\)}], "Input"], Cell[CellGroupData[{ Cell[BoxData[{ \(\(function1 =. ;\)\), "\[IndentingNewLine]", \(antigraph = Extract[MapIndexed[{#1, #2} &, list1], position1, MapAt[{function1@#, #} &, #, 1] &]\)}], "Input"], Cell[BoxData[ \({{{function1[{2, 4}], {2, 4}}, {3}}, {{function1[{3, 1}], {3, 1}}, {4}}, {{function1[{1, 4}], {1, 4}}, {5}}, {{function1[{3, 2}], {3, 2}}, {7}}}\)], "Output"] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[ \(max1 = Max[\(#[\([1, 1]\)] &\) /@ antigraph]\)], "Input"], Cell[BoxData[ \(Max[function1[{1, 4}], function1[{2, 4}], function1[{3, 1}], function1[{3, 2}]]\)], "Output"] }, Open ]], Cell[BoxData[ \(\(function1 = First;\)\)], "Input"], Cell[CellGroupData[{ Cell[BoxData[ \(Cases[antigraph, {{max1, ___}, ___}]\)], "Input"], Cell[BoxData[ \({{{3, {3, 1}}, {4}}, {{3, {3, 2}}, {7}}}\)], "Output"] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[ \({\(MapAt[Last, #, 1] &\) /@ Cases[antigraph, {{max1, ___}, ___}], max1}\)], "Input"], Cell[BoxData[ \({{{{3, 1}, {4}}, {{3, 2}, {7}}}, 3}\)], "Output"] }, Open ]], Cell[BoxData[ \(antigraph =. ; max1 =. ;\)], "Input"], Cell[CellGroupData[{ Cell[BoxData[ \(With[{antigraph = Extract[MapIndexed[{#1, #2} &, list1], position1, MapAt[{function1@#, #} &, #, 1] &]}, \[IndentingNewLine]With[{max1 = Max[\(#[\([1, 1]\)] &\) /@ antigraph]}, \[IndentingNewLine]{max1, \(MapAt[Last, #, 1] &\) /@ Cases[antigraph, {{max1, ___}, ___}]}\[IndentingNewLine]]]\)], \ "Input"], Cell[BoxData[ \({3, {{{3, 1}, {4}}, {{3, 2}, {7}}}}\)], "Output"] }, Open ]], Cell[BoxData[ \(function1 =. ; list1 =. ; position1 =. ;\)], "Input"], Cell[BoxData[ \(\(argPositionMax = Composition[Last, maxAndArgPositionMax];\)\)], "Input"], Cell[BoxData[{ \(\(Clear@maxAndArgPositionMax;\)\), "\[IndentingNewLine]", \(maxAndArgPositionMax[function1_, list1_List, position1_] := With[{antigraph = Extract[MapIndexed[{#1, #2} &, list1], position1, MapAt[{function1@#, #} &, #, 1] &]}, \[IndentingNewLine]With[{max1 = Max[\(#[\([1, 1]\)] &\) /@ antigraph]}, \[IndentingNewLine]{max1, \(MapAt[Last, #, 1] &\) /@ Cases[antigraph, {{max1, ___}, ___}]}\[IndentingNewLine]]]\), "\ \[IndentingNewLine]", \(maxAndArgPositionMax[function1_, list1_List] := maxAndArgPositionMax[function1, list1, \({#} &\) /@ Range@\(Length@list1\)]\)}], "Input", InitializationCell->True], Cell[CellGroupData[{ Cell[BoxData[ \(maxAndArgPositionMax[ First, {_, _, {2, 4}, {3, 1}, {1, 4}, _, {3, 2}}, {{3}, {4}, {5}, {7}}]\)], "Input"], Cell[BoxData[ \({3, {{{3, 1}, {4}}, {{3, 2}, {7}}}}\)], "Output"] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[ \(maxAndArgPositionMax[#^2 &, {\(-1\), 3, 0, 2, 7, \(-4\)}]\)], "Input"], Cell[BoxData[ \({49, {{7, {5}}}}\)], "Output"] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[ \(maxAndArgPositionMax[#^2 &, {\(-1\), 3, 0, 2, 7, \(-4\)}, {{1}, {2}, {3}, {4}}]\)], "Input"], Cell[BoxData[ \({9, {{3, {2}}}}\)], "Output"] }, Open ]] }, Open ]], Cell[CellGroupData[{ Cell["Quotient d'une liste par une fonction", "Subsubsection", CellTags->"c:17"], Cell[BoxData[{ \(\(list1 = {{3, 4, 1}, {2, 2, 2}, {2, 6, 3}, {2, 4, 4}};\)\), "\[IndentingNewLine]", \(\(function1 = #[\([2]\)] &;\)\)}], "Input"], Cell[CellGroupData[{ Cell[BoxData[ \(antigraph = \({function1@#, #} &\) /@ list1\)], "Input"], Cell[BoxData[ \({{4, {3, 4, 1}}, {2, {2, 2, 2}}, {6, {2, 6, 3}}, {4, {2, 4, 4}}}\)], "Output"] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[ \(Split[Sort@antigraph, First@#1 \[Equal] First@#2 &]\)], "Input"], Cell[BoxData[ \({{{2, {2, 2, 2}}}, {{4, {2, 4, 4}}, {4, {3, 4, 1}}}, {{6, {2, 6, 3}}}}\)], "Output"] }, Open ]], Cell["Mettre en commun l'isovaleur.", "Text"], Cell[CellGroupData[{ Cell[BoxData[ \(\({#[\([1, 1]\)], Last /@ #} &\) /@ Split[Sort@antigraph, First@#1 \[Equal] First@#2 &]\)], "Input"], Cell[BoxData[ \({{2, {{2, 2, 2}}}, {4, {{2, 4, 4}, {3, 4, 1}}}, {6, {{2, 6, 3}}}}\)], "Output"] }, Open ]], Cell[BoxData[ \(antigraph =. ; list1 =. ; function1 =. ;\)], "Input"], Cell["\<\ Quotient d'une liste par une fonction, chaque classe pr\[EAcute]c\ \[EAcute]d\[EAcute]e par son isovaleur. Autrement dit : graphe de l'injection \ canonique ou carte de niveau.\ \>", "Text"], Cell[BoxData[ \(Clear@listQuotient; listQuotient[list1_List, function1_, withValues \[Rule] True] := With[{antigraph = \({function1@#, #} &\) /@ list1}, \({#[\([1, 1]\)], Last /@ #} &\) /@ Split[Sort[antigraph, OrderedQ[{First@#1, First@#2}] &], First@#1 \[Equal] First@#2 &]\[IndentingNewLine]]\)], "Input", InitializationCell->True], Cell[CellGroupData[{ Cell[BoxData[ \(listQuotient[{{3, 4, 1}, {2, 2, 2}, {2, 6, 3}, {2, 4, 4}}, Part[#, 2] &, withValues \[Rule] True]\)], "Input"], Cell[BoxData[ \({{2, {{2, 2, 2}}}, {4, {{3, 4, 1}, {2, 4, 4}}}, {6, {{2, 6, 3}}}}\)], "Output"] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[ \(listQuotient[{1, \(-1\), 2, \(-2\)}, #^2 &, withValues \[Rule] True]\)], "Input"], Cell[BoxData[ \({{1, {1, \(-1\)}}, {4, {2, \(-2\)}}}\)], "Output"] }, Open ]], Cell["Avec r\[EAcute]p\[EAcute]tition :", "Text"], Cell[CellGroupData[{ Cell[BoxData[ \(listQuotient[{1, \(-1\), 2, \(-2\), 2}, #^2 &, withValues \[Rule] True]\)], "Input"], Cell[BoxData[ \({{1, {1, \(-1\)}}, {4, {2, \(-2\), 2}}}\)], "Output"] }, Open ]], Cell[TextData[{ StyleBox["Union", "Output"], " est un cas particulier." }], "Text"], Cell[CellGroupData[{ Cell[BoxData[ \(With[{list1 = {1, 2, 7, 6, 5, 3, 5, 4, 3, 2, 1, 4, 5}}, First /@ listQuotient[list1, Identity, withValues \[Rule] True] \[Equal] Union@list1]\)], "Input"], Cell[BoxData[ \(True\)], "Output"] }, Open ]], Cell["Sans isovaleur :", "Text"], Cell[BoxData[{ \(listQuotient[list1_List, function1_] := Split[Sort[list1, OrderedQ[{function1@#1, function1@#2}] &], function1@#1 \[Equal] function1@#2 &]\), "\[IndentingNewLine]", \(listQuotient[list1_List, function1_, withValues \[Rule] False] := listQuotient[list1, function1]\)}], "Input", InitializationCell->True], Cell[CellGroupData[{ Cell[BoxData[ \(listQuotient[{1, 2, 7, 6, 5, 3, 5, 4, 3, 2, 1, 4, 5}, Identity]\)], "Input"], Cell[BoxData[ \({{1, 1}, {2, 2}, {3, 3}, {4, 4}, {5, 5, 5}, {6}, {7}}\)], "Output"] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[ \(listQuotient[{{3, 5, 1}, {2, 2, 2}, {2, 6, 3}, {3, 4, 4}}, First, withValues \[Rule] False]\)], "Input"], Cell[BoxData[ \({{{2, 2, 2}, {2, 6, 3}}, {{3, 5, 1}, {3, 4, 4}}}\)], "Output"] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[ \(listQuotient[{{3, 5, 1}, {2, 2, 2}, {2, 6, 3}, {3, 4, 4}}, First]\)], "Input"], Cell[BoxData[ \({{{2, 2, 2}, {2, 6, 3}}, {{3, 5, 1}, {3, 4, 4}}}\)], "Output"] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[ \(Last /@ listQuotient[{{3, 5, 1}, {2, 2, 2}, {2, 6, 3}, {3, 4, 4}}, First, withValues \[Rule] True]\)], "Input"], Cell[BoxData[ \({{{2, 2, 2}, {2, 6, 3}}, {{3, 5, 1}, {3, 4, 4}}}\)], "Output"] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[ \(% \[Equal] %% \[Equal] %%%\)], "Input"], Cell[BoxData[ \(True\)], "Output"] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[ \(zoomTiming[ listQuotient[{{3, 5, 1}, {2, 2, 2}, {2, 6, 3}, {3, 4, 4}}, First], Last /@ listQuotient[{{3, 5, 1}, {2, 2, 2}, {2, 6, 3}, {3, 4, 4}}, First, withValues \[Rule] True], 1000]\)], "Input"], Cell[BoxData[ \({0.14000000000000057`\ Second, 0.28000000000000114`\ Second}\)], "Output"] }, Open ]] }, Open ]] }, Open ]], Cell[CellGroupData[{ Cell["Alg\[EGrave]bre combinatoire", "Subsection", CellTags->"c:18"], Cell[TextData[{ "Une ", StyleBox["combinaison", FontSlant->"Italic"], " est une liste dont l'ordre ne compte pas, comme un ensemble \ d\[EAcute]fini en extension, mais avec possibilit\[EAcute] de r\[EAcute]p\ \[EAcute]tition. On \[EAcute]crira une combinaison sous la forme canonique \ d'une liste ordonn\[EAcute]e, de mani\[EGrave]re \[AGrave] pouvoir \ \[EAcute]valuer l'identit\[EAcute] entre combinaisons avec ", StyleBox["Equal", "Output"], ", sans tri pr\[EAcute]alable. On va g\[EAcute]n\[EAcute]raliser aux \ combinaisons l'alg\[EGrave]bre de Boole des ensembles d\[EAcute]finis en \ extension." }], "Text"], Cell[CellGroupData[{ Cell["Ensemble des combinaisons", "Subsubsection", CellTags->"c:19"], Cell[BoxData[ \(\({d = 3, f = 4};\)\)], "Input"], Cell[BoxData[ \(Clear@branchCombination; branchCombination[combination_] := \(Append[combination, #] &\) /@ Range[Last@combination, f]\)], "Input"], Cell[CellGroupData[{ Cell[BoxData[ \(branchCombination@{1, 2}\)], "Input"], Cell[BoxData[ \({{1, 2, 2}, {1, 2, 3}, {1, 2, 4}}\)], "Output"] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[ \(branchCombination /@ %\)], "Input"], Cell[BoxData[ \({{{1, 2, 2, 2}, {1, 2, 2, 3}, {1, 2, 2, 4}}, {{1, 2, 3, 3}, {1, 2, 3, 4}}, {{1, 2, 4, 4}}}\)], "Output"] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[ \(NestList[Flatten[branchCombination /@ #, 1] &, {{1, 2}}, 2]\)], "Input"], Cell[BoxData[ \({{{1, 2}}, {{1, 2, 2}, {1, 2, 3}, {1, 2, 4}}, {{1, 2, 2, 2}, {1, 2, 2, 3}, {1, 2, 2, 4}, {1, 2, 3, 3}, {1, 2, 3, 4}, {1, 2, 4, 4}}}\)], "Output"] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[ \(Nest[Flatten[branchCombination /@ #, 1] &, {{3}}, d - 1]\)], "Input"], Cell[BoxData[ \({{3, 3, 3}, {3, 3, 4}, {3, 4, 4}}\)], "Output"] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[ \(Flatten[\(With[{f1 = #}, Nest[Flatten[branchCombination /@ #, 1] &, {{f1}}, d - 1]] &\) /@ Range@f, 1]\)], "Input"], Cell[BoxData[ \({{1, 1, 1}, {1, 1, 2}, {1, 1, 3}, {1, 1, 4}, {1, 2, 2}, {1, 2, 3}, {1, 2, 4}, {1, 3, 3}, {1, 3, 4}, {1, 4, 4}, {2, 2, 2}, {2, 2, 3}, {2, 2, 4}, {2, 3, 3}, {2, 3, 4}, {2, 4, 4}, {3, 3, 3}, {3, 3, 4}, {3, 4, 4}, {4, 4, 4}}\)], "Output"] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[ \(Union[Sort /@ Distribute[Table[Range@f, {d}], List]]\)], "Input"], Cell[BoxData[ \({{1, 1, 1}, {1, 1, 2}, {1, 1, 3}, {1, 1, 4}, {1, 2, 2}, {1, 2, 3}, {1, 2, 4}, {1, 3, 3}, {1, 3, 4}, {1, 4, 4}, {2, 2, 2}, {2, 2, 3}, {2, 2, 4}, {2, 3, 3}, {2, 3, 4}, {2, 4, 4}, {3, 3, 3}, {3, 3, 4}, {3, 4, 4}, {4, 4, 4}}\)], "Output"] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[ \(% \[Equal] %%\)], "Input"], Cell[BoxData[ \(True\)], "Output"] }, Open ]], Cell[BoxData[ \(\({d = 3, f = 6};\)\)], "Input"], Cell[CellGroupData[{ Cell[BoxData[ \(zoomTiming[ Flatten[\(With[{f1 = #}, Nest[Flatten[branchCombination /@ #, 1] &, {{f1}}, d - 1]] &\) /@ Range@f, 1], \[IndentingNewLine]Union[ Sort /@ Distribute[Table[Range@f, {d}], List]], \[IndentingNewLine]1000]\)], "Input"], Cell[BoxData[ \({1.9699999999999989`\ Second, 1.6900000000000013`\ Second}\)], "Output"] }, Open ]], Cell[BoxData[ \({d =. , f =. }; Clear@branchCombination;\)], "Input"], Cell[BoxData[ \(Clear@allCombinations; allCombinations[d_Integer, f_Integer] := Union[Sort /@ Distribute[Table[Range@f, {d}], List]]\)], "Input", InitializationCell->True], Cell[CellGroupData[{ Cell[BoxData[ \(allCombinations[1, 0]\)], "Input"], Cell[BoxData[ \({}\)], "Output"] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[ \(allCombinations[0, 0]\)], "Input"], Cell[BoxData[ \({{}}\)], "Output"] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[ \(\(Print /@ \((\(allCombinations[#, 3] &\) /@ Range@3)\);\)\)], "Input"], Cell[BoxData[ \({{1}, {2}, {3}}\)], "Print"], Cell[BoxData[ \({{1, 1}, {1, 2}, {1, 3}, {2, 2}, {2, 3}, {3, 3}}\)], "Print"], Cell[BoxData[ \({{1, 1, 1}, {1, 1, 2}, {1, 1, 3}, {1, 2, 2}, {1, 2, 3}, {1, 3, 3}, {2, 2, 2}, {2, 2, 3}, {2, 3, 3}, {3, 3, 3}}\)], "Print"] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[ \(allCombinations[3, 6]\)], "Input"], Cell[BoxData[ \({{1, 1, 1}, {1, 1, 2}, {1, 1, 3}, {1, 1, 4}, {1, 1, 5}, {1, 1, 6}, {1, 2, 2}, {1, 2, 3}, {1, 2, 4}, {1, 2, 5}, {1, 2, 6}, {1, 3, 3}, {1, 3, 4}, {1, 3, 5}, {1, 3, 6}, {1, 4, 4}, {1, 4, 5}, {1, 4, 6}, {1, 5, 5}, {1, 5, 6}, {1, 6, 6}, {2, 2, 2}, {2, 2, 3}, {2, 2, 4}, {2, 2, 5}, {2, 2, 6}, {2, 3, 3}, {2, 3, 4}, {2, 3, 5}, {2, 3, 6}, {2, 4, 4}, {2, 4, 5}, {2, 4, 6}, {2, 5, 5}, {2, 5, 6}, {2, 6, 6}, {3, 3, 3}, {3, 3, 4}, {3, 3, 5}, {3, 3, 6}, {3, 4, 4}, {3, 4, 5}, {3, 4, 6}, {3, 5, 5}, {3, 5, 6}, {3, 6, 6}, {4, 4, 4}, {4, 4, 5}, {4, 4, 6}, {4, 5, 5}, {4, 5, 6}, {4, 6, 6}, {5, 5, 5}, {5, 5, 6}, {5, 6, 6}, {6, 6, 6}}\)], "Output"] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[ \(Length@%\)], "Input"], Cell[BoxData[ \(56\)], "Output"] }, Open ]], Cell[TextData[{ "D\[EAcute]nombrement. \[WarningSign] G\[EAcute]n\[EAcute]raliser en \ fonction de ", Cell[BoxData[ \(TraditionalForm\`d, f\)]], "." }], "Text"], Cell[CellGroupData[{ Cell[BoxData[ \(6\ 5\ 4\ /\(3!\) + 6\ 5 + 6\)], "Input"], Cell[BoxData[ \(56\)], "Output"] }, Open ]] }, Open ]], Cell[CellGroupData[{ Cell["Notation eul\[EAcute]rienne (en nombre d'occupation)", "Subsubsection", CellTags->"c:20"], Cell[TextData[{ "Un syst\[EGrave]me de d\[EAcute]s est d\[EAcute]crit, en notation ", StyleBox["lagrangienne", FontSlant->"Italic"], ", par une ", StyleBox["combinaison", FontSlant->"Italic"], " de faces ou, en notation ", StyleBox["eul\[EAcute]rienne", FontSlant->"Italic"], ", par un ", StyleBox["vecteur", FontSlant->"Italic"], " de nombres d'occupation (nombre de d\[EAcute]s par face)." }], "Text"], Cell[TextData[{ "\[WarningSign] Changer les noms, ", Cell[BoxData[ \(TraditionalForm\`Euler \[Rule] Vector\)]], ", supprimer Lagrange." }], "Text"], Cell[BoxData[{ \(\(Clear@lagrangeToEuler;\)\), "\[IndentingNewLine]", \(lagrangeToEuler@{} = {}; lagrangeToEuler@combination_List := \(Count[combination, #] &\) /@ Range@\(Last@combination\)\)}], "Input", InitializationCell->True], Cell[CellGroupData[{ Cell[BoxData[ \(lagrangeToEuler@{2, 3, 3, 5, 5, 5}\)], "Input"], Cell[BoxData[ \({0, 1, 2, 0, 3}\)], "Output"] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[ \(lagrangeToEuler@{1, 2, 4}\)], "Input"], Cell[BoxData[ \({1, 1, 0, 1}\)], "Output"] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[ \(lagrangeToEuler@{}\)], "Input"], Cell[BoxData[ \({}\)], "Output"] }, Open ]], Cell[BoxData[ \(Clear@eulerToLagrange; eulerToLagrange@vector_List := Flatten[MapIndexed[Table[First@#2, {#1}] &, vector], 1]\)], "Input", InitializationCell->True], Cell["\<\ V\[EAcute]rifier que la compos\[EAcute]e des deux applications est \ l'identit\[EAcute], donc ce sont des bijections r\[EAcute]ciproques.\ \>", \ "Text"], Cell[CellGroupData[{ Cell[BoxData[ \(eulerToLagrange@\(lagrangeToEuler@{2, 2, 3, 4}\)\)], "Input"], Cell[BoxData[ \({2, 2, 3, 4}\)], "Output"] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[ \(lagrangeToEuler@\(eulerToLagrange@{2, 2, 3, 4}\)\)], "Input"], Cell[BoxData[ \({2, 2, 3, 4}\)], "Output"] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[ \(Apply[ And, \(eulerToLagrange@\(lagrangeToEuler@#\) \[Equal] # &\) /@ allCombinations[4, 6]]\)], "Input"], Cell[BoxData[ \(True\)], "Output"] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[ \(Apply[ And, \(eulerToLagrange@\(lagrangeToEuler@#\) \[Equal] # &\) /@ allCombinations[6, 2]]\)], "Input"], Cell[BoxData[ \(True\)], "Output"] }, Open ]] }, Open ]], Cell[CellGroupData[{ Cell["Appartenance", "Subsubsection", CellTags->"c:21"], Cell[CellGroupData[{ Cell[BoxData[ \({4 \[Element] Integers, 4 \[Element] {1, 2, 3, 4}}\)], "Input"], Cell[BoxData[ \({True, 4 \[Element] {1, 2, 3, 4}}\)], "Output"] }, Open ]], Cell[BoxData[ \(myElement[x_, list1_List] := Not[Cases[list1, x] \[Equal] {}]\)], "Input", InitializationCell->True], Cell[CellGroupData[{ Cell[BoxData[ \(0~myElement~{1}\)], "Input"], Cell[BoxData[ \(False\)], "Output"] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[ \(0~myElement~{0}\)], "Input"], Cell[BoxData[ \(True\)], "Output"] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[ \(4~myElement~{1, 4, 3, 7, 3, 4}\)], "Input"], Cell[BoxData[ \(True\)], "Output"] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[ \(zoomTiming[Not[Cases[{1, 4, 3, 7, 3, 4}, 7] \[Equal] {}], Switch[Cases[{1, 4, 3, 7, 3, 4}, 7], {}, False, _, True], 100000]\)], "Input"], Cell[BoxData[ \({1.4499999999999993`\ Second, 1.8500000000000014`\ Second}\)], "Output"] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[ \(zoomTiming[Not[Cases[{1, 4, 3, 7, 3, 4}, \(-1\)] \[Equal] {}], Switch[Cases[{1, 4, 3, 7, 3, 4}, \(-1\)], {}, False, _, True], 100000]\)], "Input"], Cell[BoxData[ \({1.2800000000000011`\ Second, 1.1899999999999977`\ Second}\)], "Output"] }, Open ]] }, Open ]], Cell[CellGroupData[{ Cell["Diff\[EAcute]rence", "Subsubsection", CellTags->"c:22"], Cell[BoxData[ RowBox[{"Notation", "[", RowBox[{ TagBox[\(combinationComplement[x_, y_]\), NotationBoxTag, TagStyle->"NotationTemplateStyle"], " ", "\[DoubleLongLeftRightArrow]", " ", TagBox[\(x_\[Backslash]\ y_\), NotationBoxTag, TagStyle->"NotationTemplateStyle"]}], "]"}]], "Input", InitializationCell->True], Cell[BoxData[{ \(\(Clear@combinationComplement;\)\), "\[IndentingNewLine]", \(combinationComplement[combination1_List, combination2_List] := Switch[combination1, \[IndentingNewLine]{}, {}, \[IndentingNewLine]_, With[{f1 = First@combination1}, \[IndentingNewLine]If[ f1~myElement~ combination2, \[IndentingNewLine]combinationComplement[ Rest@combination1, Drop[combination2, First@Position[combination2, f1, 1, 1]]], \[IndentingNewLine]Prepend[ combinationComplement[Rest@combination1, combination2], f1]\[IndentingNewLine]]\[IndentingNewLine]]\[IndentingNewLine]]\ \)}], "Input"], Cell[CellGroupData[{ Cell[BoxData[ \({1, 1, 2, 3}\[Backslash]{1, 2, 4}\)], "Input"], Cell[BoxData[ \({1, 3}\)], "Output"] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[ \(zoomTiming[{1, 1, 2, 3}\[Backslash]{1, 2, 4}, 3000]\)], "Input"], Cell[BoxData[ \(1.1000000000000014`\ Second\)], "Output"] }, Open ]], Cell[BoxData[{ \(\(Clear@combinationComplement;\)\), "\[IndentingNewLine]", \(combinationComplement[combination1_List, combination2_List] := Block[{x, y, z, x1, z1}, First[{combination1, combination2} //. {{x___, y_, z___}, {x1___, y_, z1___}} \[Rule] \ {{x, z}, {x1, z1}}]]\)}], "Input"], Cell[CellGroupData[{ Cell[BoxData[ \({1, 1, 2, 3}\[Backslash]{1, 2, 4}\)], "Input"], Cell[BoxData[ \({1, 3}\)], "Output"] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[ \(zoomTiming[{1, 1, 2, 3}\[Backslash]{1, 2, 4}, 3000]\)], "Input"], Cell[BoxData[ \(0.6299999999999955`\ Second\)], "Output"] }, Open ]], Cell[BoxData[ \(combination1 = {1, 1, 2, 3}; combination2 = {1, 2, 2, 4};\)], "Input"], Cell["Probl\[EGrave]me : ils n'ont pas forc\[EAcute]ment la m\[EHat]me \ longueur.", "Text"], Cell[CellGroupData[{ Cell[BoxData[ \(lagrangeToEuler /@ {combination1, combination2}\)], "Input"], Cell[BoxData[ \({{2, 1, 1}, {1, 2, 0, 1}}\)], "Output"] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[ \(\({#, Max[Length /@ #]} &\)@\((lagrangeToEuler /@ {combination1, combination2})\)\)], "Input"], Cell[BoxData[ \({{{2, 1, 1}, {1, 2, 0, 1}}, 4}\)], "Output"] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[ \(\(\(PadRight @@ ## &\) /@ Distribute[{#, Max[Length /@ #]}, List] &\)@\((lagrangeToEuler /@ {combination1, combination2})\)\)], "Input"], Cell[BoxData[ \({{2, 1, 1, 0}, {1, 2, 0, 1}}\)], "Output"] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[ \(eulerToLagrange@ MapThread[ Max[0, #1 - #2] &, \(\(PadRight @@ ## &\) /@ Distribute[{#, Max[Length /@ #]}, List] &\)@\((lagrangeToEuler /@ {combination1, combination2})\)]\)], "Input"], Cell[BoxData[ \({1, 3}\)], "Output"] }, Open ]], Cell[BoxData[ \(combination1 =. ; combination2 =. ;\)], "Input"], Cell[BoxData[{\(Clear@combinationComplement;\), "\[IndentingNewLine]", RowBox[{\(combinationComplement[combination1_List, combination2_List]\), ":=", RowBox[{"eulerToLagrange", "@", RowBox[{"MapThread", "[", RowBox[{ StyleBox[\(Max[0, #1 - #2] &\), FontColor->RGBColor[1, 0, 0]], ",", \(\(\(PadRight @@ ## &\) /@ Distribute[{#, Max[Length /@ #]}, List] &\)@\((lagrangeToEuler /@ {combination1, combination2})\)\)}], "]"}]}]}]}], "Input"], Cell[CellGroupData[{ Cell[BoxData[ \({1, 1, 2, 3}\[Backslash]{1, 2, 4}\)], "Input"], Cell[BoxData[ \({1, 3}\)], "Output"] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[ \(zoomTiming[{1, 1, 2, 3}\[Backslash]{1, 2, 4}, 3000]\)], "Input"], Cell[BoxData[ \(1.3299999999999983`\ Second\)], "Output"] }, Open ]], Cell["Sans les traductions :", "Text"], Cell[CellGroupData[{ Cell[BoxData[ \(zoomTiming[ MapThread[ Max[0, #1 - #2] &, \(\(PadRight @@ ## &\) /@ Distribute[{#, Max[Length /@ #]}, List] &\)@{{2, 1, 1}, {1, 1, 0, 1}}], 3000]\)], "Input"], Cell[BoxData[ \(0.5099999999999909`\ Second\)], "Output"] }, Open ]], Cell[BoxData[ \(combination1 = {1, 1, 2, 3}; combination2 = {1, 2, 2, 4};\)], "Input"], Cell[CellGroupData[{ Cell[BoxData[ \(DeleteCases[combination1, 1, 1, 1]\)], "Input"], Cell[BoxData[ \({1, 2, 3}\)], "Output"] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[ \(\({First@#, 1, Length@#} &\) /@ Split@combination2\)], "Input"], Cell[BoxData[ \({{1, 1, 1}, {2, 1, 2}, {4, 1, 1}}\)], "Output"] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[ \(FoldList[ With[{combination = #1}, Apply[function1[combination, ##] &, #2]] &, combination1, \({First@#, 1, Length@#} &\) /@ Split@combination2]\)], "Input"], Cell[BoxData[ \({{1, 1, 2, 3}, function1[{1, 1, 2, 3}, 1, 1, 1], function1[function1[{1, 1, 2, 3}, 1, 1, 1], 2, 1, 2], function1[function1[function1[{1, 1, 2, 3}, 1, 1, 1], 2, 1, 2], 4, 1, 1]}\)], "Output"] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[ \(Fold[ With[{combination = #1}, Apply[DeleteCases[combination, ##] &, #2]] &, combination1, \({First@#, 1, Length@#} &\) /@ Split@combination2]\)], "Input"], Cell[BoxData[ \({1, 3}\)], "Output"] }, Open ]], Cell[BoxData[ \(combination1 =. ; combination2 =. ;\)], "Input"], Cell[TextData[{ "\[WarningSign] \[Lambda]-calcul, \[EAcute]liminer ", StyleBox["combination", "Output"], "." }], "Text"], Cell[BoxData[{ \(\(Clear@combinationComplement;\)\), "\[IndentingNewLine]", \(combinationComplement[combination1_List, combination2_List] := Fold[With[{combination = #1}, Apply[DeleteCases[combination, ##] &, #2]] &, combination1, \({First@#, 1, Length@#} &\) /@ Split@combination2]\)}], "Input", InitializationCell->True], Cell[CellGroupData[{ Cell[BoxData[ \({1, 1, 2, 3}\[Backslash]{1, 2, 4}\)], "Input"], Cell[BoxData[ \({1, 3}\)], "Output"] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[ \(zoomTiming[{1, 1, 2, 3}\[Backslash]{1, 2, 4}, 3000]\)], "Input"], Cell[BoxData[ \(0.5700000000000074`\ Second\)], "Output"] }, Open ]], Cell["Notation bloque la notation infixe.", "Text"], Cell[CellGroupData[{ Cell[BoxData[ \({1, 2}~combinationComplement~{1}\)], "Input"], Cell[BoxData[ \(combinationComplement[{1, 2}, {1}]\)], "Output"] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[ \(combinationComplement[{1, 2}, {1}]\)], "Input"], Cell[BoxData[ \({2}\)], "Output"] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[ \({1}\[Backslash]{1, 2}\)], "Input"], Cell[BoxData[ \({}\)], "Output"] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[ \({1, 1, 5}\[Backslash]{1, 1, 3, 8}\)], "Input"], Cell[BoxData[ \({5}\)], "Output"] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[ \({1, 1, 2}\[Backslash]{1, 2, 5}\)], "Input"], Cell[BoxData[ \({1}\)], "Output"] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[ \({}\[Backslash]{}\)], "Input"], Cell[BoxData[ \({}\)], "Output"] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[ \({1}\[Backslash]{}\)], "Input"], Cell[BoxData[ \({1}\)], "Output"] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[ \({}\[Backslash]{1}\)], "Input"], Cell[BoxData[ \({}\)], "Output"] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[ \({1, 1, 2, 3}\[Backslash]{1, 1, 2, 3, 4}\)], "Input"], Cell[BoxData[ \({}\)], "Output"] }, Open ]], Cell[TextData[{ "\[Wolf] ", StyleBox["Complement", "Output"], " ne convient pas ici." }], "Text"], Cell[CellGroupData[{ Cell[BoxData[{ \(combinationComplement[{1, 1, 2, 3}, {1, 2}]\), "\[IndentingNewLine]", \(Complement[{1, 1, 2, 3}, {1, 2}]\)}], "Input"], Cell[BoxData[ \({1, 3}\)], "Output"], Cell[BoxData[ \({3}\)], "Output"] }, Open ]] }, Open ]], Cell[CellGroupData[{ Cell["Intersection", "Subsubsection", CellTags->"c:23"], Cell[BoxData[ \(combination1 = {2, 3, 3, 3, 4, 6, 7, 7, 7}; combination2 = {1, 3, 3, 7, 7, 7, 7, 8};\)], "Input"], Cell["D\[EAcute]coule de la diff\[EAcute]rence.", "Text"], Cell[CellGroupData[{ Cell[BoxData[ \(combination1\[Backslash]\((combination1\[Backslash] combination2)\)\)], "Input"], Cell[BoxData[ \({3, 3, 7, 7, 7}\)], "Output"] }, Open ]], Cell["Par Euler :", "Text"], Cell[CellGroupData[{ Cell[BoxData[ RowBox[{"eulerToLagrange", "@", RowBox[{"MapThread", "[", RowBox[{ StyleBox["Min", FontColor->RGBColor[1, 0, 0]], ",", \(\(\(PadRight @@ ## &\) /@ Distribute[{#, Max[Length /@ #]}, List] &\)@\((lagrangeToEuler /@ {combination1, combination2})\)\)}], "]"}]}]], "Input"], Cell[BoxData[ \({3, 3, 7, 7, 7}\)], "Output"] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[ \(zoomTiming[\[IndentingNewLine]combination1\[Backslash]\((combination1\ \[Backslash]combination2)\), eulerToLagrange@ MapThread[ Min, \(\(PadRight @@ ## &\) /@ Distribute[{#, Max[Length /@ #]}, List] &\)@\((lagrangeToEuler /@ {combination1, combination2})\)], 1000]\)], "Input"], Cell[BoxData[ \({0.5100000000000051`\ Second, 0.5699999999999932`\ Second}\)], "Output"] }, Open ]], Cell[BoxData[ \(combination1 =. ; combination2 =. ;\)], "Input"], Cell[BoxData[ \(Clear@combinationIntersection; combinationIntersection[combination1_, combination2_] := combination1\[Backslash]\((combination1\[Backslash] combination2)\)\)], "Input", InitializationCell->True], Cell[CellGroupData[{ Cell[BoxData[ \({2, 3, 3, 3, 4, 6, 7, 7, 7}~ combinationIntersection~{1, 3, 3, 7, 7, 7, 7, 8}\)], "Input"], Cell[BoxData[ \({3, 3, 7, 7, 7}\)], "Output"] }, Open ]], Cell["Non.", "Text"], Cell[CellGroupData[{ Cell[BoxData[ \({2, 3, 4, 6, 7, 7, 7}~Intersection~{1, 3, 3, 7, 7, 7, 7, 8}\)], "Input"], Cell[BoxData[ \({3, 7}\)], "Output"] }, Open ]], Cell["Non plus.", "Text"], Cell[CellGroupData[{ Cell[BoxData[ \(Cases[{2, 3, 3, 3, 4, 6, 7, 7, 7}, Alternatives @@ {1, 3, 3, 7, 7, 7, 7, 8}]\)], "Input"], Cell[BoxData[ \({3, 3, 3, 7, 7, 7}\)], "Output"] }, Open ]] }, Open ]], Cell[CellGroupData[{ Cell["Inclusion", "Subsubsection", CellTags->"c:24"], Cell[BoxData[ \(combination1 = {2, 2, 3, 4}; combination2 = {2, 2, 2, 4, 5};\)], "Input"], Cell["\[CapitalAGrave] partir de l'intersection :", "Text"], Cell[CellGroupData[{ Cell[BoxData[ \(\((combination1~combinationIntersection~combination2)\) \[Equal] combination1\)], "Input"], Cell[BoxData[ \(False\)], "Output"] }, Open ]], Cell["Euler.", "Text"], Cell[CellGroupData[{ Cell[BoxData[ RowBox[{"MapThread", "[", RowBox[{ StyleBox["LessEqual", FontColor->RGBColor[1, 0, 0]], ",", \(\(\(PadRight @@ ## &\) /@ Distribute[{#, Max[Length /@ #]}, List] &\)@\((lagrangeToEuler /@ {combination1, combination2})\)\)}], "]"}]], "Input"], Cell[BoxData[ \({True, True, False, True, True}\)], "Output"] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[ RowBox[{"And", "@@", RowBox[{"MapThread", "[", RowBox[{ StyleBox["LessEqual", FontColor->RGBColor[1, 0, 0]], ",", \(\(\(PadRight @@ ## &\) /@ Distribute[{#, Max[Length /@ #]}, List] &\)@\((lagrangeToEuler /@ {combination1, combination2})\)\)}], "]"}]}]], "Input"], Cell[BoxData[ \(False\)], "Output"] }, Open ]], Cell["Euler malin.", "Text"], Cell[CellGroupData[{ Cell[BoxData[ \(\(With[{f1 = #}, Apply[LessEqual, \(Count[#, f1] &\) /@ {combination1, combination2}]\[IndentingNewLine]] &\) /@ combination1\)], "Input"], Cell[BoxData[ \({True, True, False, True}\)], "Output"] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[ \(Apply[ And, \[IndentingNewLine]\(With[{f1 = #}, Apply[LessEqual, \(Count[#, f1] &\) /@ {combination1, combination2}]] &\) /@ combination1]\)], "Input"], Cell[BoxData[ \(False\)], "Output"] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[ RowBox[{"zoomTiming", "[", "\[IndentingNewLine]", RowBox[{\(\((combination1~combinationIntersection~ combination2)\) \[Equal] combination1\), ",", "\[IndentingNewLine]", RowBox[{"And", "@@", RowBox[{"MapThread", "[", RowBox[{ StyleBox["LessEqual", FontColor->RGBColor[1, 0, 0]], ",", \(\(\(PadRight @@ ## &\) /@ Distribute[{#, Max[Length /@ #]}, List] &\)@\((lagrangeToEuler /@ {combination1, combination2})\)\)}], "]"}]}], ",", "\[IndentingNewLine]", \(Apply[ And, \[IndentingNewLine]\(With[{f1 = #}, Apply[LessEqual, \(Count[#, f1] &\) /@ {combination1, combination2}]]\[IndentingNewLine] &\) /@ combination1]\), ",", "\[IndentingNewLine]", "1000"}], "]"}]], "Input"], Cell[BoxData[ \({0.28000000000000114`\ Second, 0.3299999999999983`\ Second, 0.21999999999999886`\ Second}\)], "Output"] }, Open ]], Cell[BoxData[ \(\({combination1, combination2} =. ;\)\)], "Input"], Cell[BoxData[ \(Clear@subcombinationQ; subcombinationQ[combination1_, combination2_] := \[IndentingNewLine]Apply[ And, \[IndentingNewLine]\(With[{f1 = #}, Apply[LessEqual, \(Count[#, f1] &\) /@ {combination1, combination2}]]\[IndentingNewLine] &\) /@ combination1]\)], "Input", InitializationCell->True], Cell[CellGroupData[{ Cell[BoxData[ \(subcombinationQ[{2, 2, 3, 4}, {2, 2, 2, 4}]\)], "Input"], Cell[BoxData[ \(False\)], "Output"] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[ \(subcombinationQ[{1, 2, 3, 7}, {1, 1, 2, 3, 3, 7}]\)], "Input"], Cell[BoxData[ \(True\)], "Output"] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[ \(subcombinationQ[{1, 3, 7}, {1, 1, 2, 3, 3, 7}]\)], "Input"], Cell[BoxData[ \(True\)], "Output"] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[ \(subcombinationQ[{1, 1, 1}, {1, 1, 2, 3, 3}]\)], "Input"], Cell[BoxData[ \(False\)], "Output"] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[ \(Apply[ And, \(subcombinationQ[#, Range@6] &\) /@ Subsets@\(Range@6\)]\)], "Input"], Cell[BoxData[ \(True\)], "Output"] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[ \(Apply[ And, \(Not@subcombinationQ[Append[#, 7], Range@6] &\) /@ Subsets@\(Range@6\)]\)], "Input"], Cell[BoxData[ \(True\)], "Output"] }, Open ]] }, Open ]] }, Open ]], Cell[CellGroupData[{ Cell["Permutation de faces", "Subsection", CellTags->"c:25"], Cell[CellGroupData[{ Cell["\<\ Repr\[EAcute]sentant d'une combinaison modulo une permutation de \ faces\ \>", "Subsubsection", CellTags->"c:26"], Cell["\<\ Deux combinaisons sont \[EAcute]quivalentes modulo une permutation \ de faces si et seulement si elles ont la m\[EHat]me combinaison de nombres \ d'occupation.\ \>", "Text"], Cell[CellGroupData[{ Cell[BoxData[ \(Reverse@\(Sort@ Select[{2, 1, 5, 0, 6, 1, 0}, # \[NotEqual] 0 &]\)\)], "Input"], Cell[BoxData[ \({6, 5, 2, 1, 1}\)], "Output"] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[ \(Reverse@\(Sort@DeleteCases[{2, 1, 5, 0, 6, 1, 0}, 0]\)\)], "Input"], Cell[BoxData[ \({6, 5, 2, 1, 1}\)], "Output"] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[ \(zoomTiming[ Reverse@\(Sort@Select[{2, 1, 5, 0, 6, 1, 0}, # \[NotEqual] 0 &]\), Reverse@\(Sort@DeleteCases[{2, 1, 5, 0, 6, 1, 0}, 0]\), 3000]\)], "Input"], Cell[BoxData[ \({0.120000000000001`\ Second, 0.05999999999999872`\ Second}\)], "Output"] }, Open ]], Cell[BoxData[ \(Clear@eulerRepresentative; eulerRepresentative@vector_List := Reverse@\(Sort@DeleteCases[vector, 0]\)\)], "Input", InitializationCell->True], Cell["\[WarningSign] Diagramme commutatif.", "Text"], Cell["Diagonale : ", "Text"], Cell[BoxData[ \(Clear@lagrangeToEulerRepresentative; lagrangeToEulerRepresentative@combination_List := Reverse@Sort[Length /@ Split@combination]\)], "Input", InitializationCell->True], Cell[BoxData[ \(\(combination = {3, 5, 5};\)\)], "Input"], Cell[CellGroupData[{ Cell[BoxData[ \(eulerRepresentative@\(lagrangeToEuler@combination\)\)], "Input"], Cell[BoxData[ \({2, 1}\)], "Output"] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[ \(lagrangeToEulerRepresentative@combination\)], "Input"], Cell[BoxData[ \({2, 1}\)], "Output"] }, Open ]], Cell["\<\ V\[EAcute]rification : on trouve pareil mais moins vite en passant \ par les c\[OHat]t\[EAcute]s.\ \>", "Text"], Cell[CellGroupData[{ Cell[BoxData[ \(Apply[ And, \(lagrangeToEulerRepresentative@# \[Equal] eulerRepresentative@\(lagrangeToEuler@#\) &\) /@ allCombinations[3, 6]]\)], "Input"], Cell[BoxData[ \(True\)], "Output"] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[ \(zoomTiming[eulerRepresentative@\(lagrangeToEuler@combination\), lagrangeToEulerRepresentative@combination, 10000]\)], "Input"], Cell[BoxData[ \({1.2800000000000011`\ Second, 0.3200000000000003`\ Second}\)], "Output"] }, Open ]], Cell[BoxData[ \(\(combination =. ;\)\)], "Input"], Cell["\<\ Repr\[EAcute]sentant lagrangien, minimisant la somme des faces, via \ la diagonale :\ \>", "Text"], Cell[BoxData[ \(\(lagrangeRepresentative = Composition[eulerToLagrange, lagrangeToEulerRepresentative];\)\)], "Input", InitializationCell->True], Cell[CellGroupData[{ Cell[BoxData[ \(lagrangeRepresentative@{3, 5, 5}\)], "Input"], Cell[BoxData[ \({1, 1, 2}\)], "Output"] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[ \(lagrangeRepresentative@{2, 2, 2, 4, 4, 6}\)], "Input"], Cell[BoxData[ \({1, 1, 1, 2, 2, 3}\)], "Output"] }, Open ]] }, Open ]], Cell[CellGroupData[{ Cell["Permutation repr\[EAcute]sentante", "Subsubsection", CellTags->"c:27"], Cell[BoxData[ \(\(combination = {4, 4, 5, 6, 6};\)\)], "Input"], Cell["{face, nombre d'occupation non nul}", "Text"], Cell[CellGroupData[{ Cell[BoxData[ \(\({Length@#, First@#} &\) /@ Split@combination\)], "Input"], Cell[BoxData[ \({{2, 4}, {1, 5}, {2, 6}}\)], "Output"] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[ \(\(MapAt[function1, #, 1] &\) /@ \((\({Length@#, First@#} &\) /@ Split@combination)\)\)], "Input"], Cell[BoxData[ \({{function1[2], 4}, {function1[1], 5}, {function1[2], 6}}\)], "Output"] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[ \(lagrangeToEulerRepresentative@combination\)], "Input"], Cell[BoxData[ \({2, 2, 1}\)], "Output"] }, Open ]], Cell["{face de d\[EAcute]part, faces d'arriv\[EAcute]e possibles}", "Text"], Cell[CellGroupData[{ Cell[BoxData[ \(graph1 = \(MapAt[ Flatten@Position[ lagrangeToEulerRepresentative@combination, #] &, #, 1] &\) /@ \((\({Length@#, First@#} &\) /@ Split@combination)\)\)], "Input"], Cell[BoxData[ \({{{1, 2}, 4}, {{3}, 5}, {{1, 2}, 6}}\)], "Output"] }, Open ]], Cell["\<\ Les choix de classe pour chaque face ne sont pas \ ind\[EAcute]pendants.\ \>", "Text"], Cell[CellGroupData[{ Cell[BoxData[ \(listQuotient[graph1, First]\)], "Input"], Cell[BoxData[ \({{{{3}, 5}}, {{{1, 2}, 4}, {{1, 2}, 6}}}\)], "Output"] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[ \(\(MapIndexed[function1, #] &\) /@ listQuotient[graph1, First]\)], "Input"], Cell[BoxData[ \({{function1[{{3}, 5}, {1}]}, {function1[{{1, 2}, 4}, {1}], function1[{{1, 2}, 6}, {2}]}}\)], "Output"] }, Open ]], Cell["\<\ {{face de d\[EAcute]part, face d'arriv\[EAcute]e}\[Ellipsis]}\ \>", \ "Text"], Cell[CellGroupData[{ Cell[BoxData[ \(graph2 = Flatten[\(MapIndexed[{Last@#1, Extract[ First@#1, #2]} &, #] &\) \ /@ \[IndentingNewLine]listQuotient[graph1, First], 1]\)], "Input"], Cell[BoxData[ \({{5, 3}, {4, 1}, {6, 2}}\)], "Output"] }, Open ]], Cell["\<\ Prolonger la permutation, des faces ne figurant pas dans la \ combinaison vers les faces ne figurant pas dans son repr\[EAcute]sentant. \ \ \>", "Text"], Cell[CellGroupData[{ Cell[BoxData[ \(f = Last@combination\)], "Input"], Cell[BoxData[ \(6\)], "Output"] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[ \(\(Range@f\[Backslash]# &\) /@ {\(First@# &\) /@ graph2, \(Last@# &\) /@ graph2}\)], "Input"], Cell[BoxData[ \({{1, 2, 3}, {4, 5, 6}}\)], "Output"] }, Open ]], Cell["\<\ N'importe quelle bijection des premi\[EGrave]res vers les secondes \ convient, choisir la seule croissante.\ \>", "Text"], Cell[CellGroupData[{ Cell[BoxData[ \(graph3 = Transpose[\(Range@f\[Backslash]# &\) /@ {\(First@# &\) /@ graph2, \(Last@# &\) /@ graph2}]\)], "Input"], Cell[BoxData[ \({{1, 4}, {2, 5}, {3, 6}}\)], "Output"] }, Open ]], Cell[TextData[{ "Trier rejoint le format de ", StyleBox["Permutations", "Output"], "." }], "Text"], Cell[CellGroupData[{ Cell[BoxData[ \(Sort@Join[graph2, graph3]\)], "Input"], Cell[BoxData[ \({{1, 4}, {2, 5}, {3, 6}, {4, 1}, {5, 3}, {6, 2}}\)], "Output"] }, Open ]], Cell[BoxData[ \(\({f, combination, graph1, graph2, graph3} =. ;\)\)], "Input"], Cell["\<\ Permutation transformant une combinaison en son \ repr\[EAcute]sentant.\ \>", "Text"], Cell[BoxData[{\(Clear@ representingPermutationGraph;\), "\[IndentingNewLine]", \ \(representingPermutationGraph@{} = {};\), "\[IndentingNewLine]", RowBox[{\(representingPermutationGraph@combination_List\), ":=", RowBox[{"With", "[", RowBox[{\({eulerRepresentative = lagrangeToEulerRepresentative@combination}\), ",", RowBox[{"With", "[", RowBox[{\({graph1 = \(MapAt[ Flatten@Position[eulerRepresentative, #] &, #, 1] &\) /@ \((\({Length@#, First@#} &\) /@ Split@combination)\)}\), ",", "\[IndentingNewLine]", RowBox[{"With", "[", RowBox[{\({graph2 = Flatten[\(MapIndexed[{Last@#1, Extract[ First@#1, #2]} &, #] &\) \ /@ \[IndentingNewLine]listQuotient[graph1, First], 1]}\), ",", "\[IndentingNewLine]", RowBox[{"With", "[", RowBox[{ RowBox[{"{", RowBox[{"graph3", "=", RowBox[{"Transpose", "[", RowBox[{ RowBox[{ RowBox[{ RowBox[{"Range", "@", StyleBox[\(Last@combination\), FontColor->RGBColor[1, 0, 0]]}], "\[Backslash]", "#"}], "&"}], "/@", \({\(First@# &\) /@ graph2, \(Last@# &\) /@ graph2}\)}], "]"}]}], "}"}], ",", "\[IndentingNewLine]", \( (*\(Sort\)\(@\)*) \), \(Join[ graph2, graph3]\)}], "\[IndentingNewLine]", "]"}]}], "]"}]}], "]"}]}], "]"}]}]}], "Input", InitializationCell->True], Cell[CellGroupData[{ Cell[BoxData[ \(representingPermutationGraph@{1, 2, 3}\)], "Input"], Cell[BoxData[ \({{1, 1}, {2, 2}, {3, 3}}\)], "Output"] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[ \(representingPermutationGraph@{4, 4, 5, 6, 6}\)], "Input"], Cell[BoxData[ \({{5, 3}, {4, 1}, {6, 2}, {1, 4}, {2, 5}, {3, 6}}\)], "Output"] }, Open ]], Cell["V\[EAcute]rification : retrouver le repr\[EAcute]sentant.", "Text"], Cell[CellGroupData[{ Cell[BoxData[ \(transform[representingPermutationGraph@{4, 4, 5, 6, 6}]@{4, 4, 5, 6, 6}\)], "Input"], Cell[BoxData[ \({1, 1, 3, 2, 2}\)], "Output"] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[ \(Sort@\(transform[representingPermutationGraph@{4, 4, 5, 6, 6}]@{4, 4, 5, 6, 6}\) \[Equal] lagrangeRepresentative@{4, 4, 5, 6, 6}\)], "Input"], Cell[BoxData[ \(True\)], "Output"] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[ \(Apply[ And, \(Sort@\(transform[representingPermutationGraph@#]@#\) \[Equal] lagrangeRepresentative@# &\) /@ allCombinations[3, 6]]\)], "Input"], Cell[BoxData[ \(True\)], "Output"] }, Open ]] }, Open ]], Cell[CellGroupData[{ Cell["Ensemble des repr\[EAcute]sentants", "Subsubsection", CellTags->"c:28"], Cell["\<\ Construire l'ensemble des repr\[EAcute]sentants comme un arbre, en \ trois \[EAcute]tapes principales.\ \>", "Text"], Cell[CellGroupData[{ Cell["Ramifier une feuille", "Outline2"], Cell[BoxData[{ \(\(Clear@branchEulerRepresentative;\)\), "\n", \(branchEulerRepresentative[d_, f_]@eulerRepresentative1_List := With[{\[IndentingNewLine]nextOccupationNumber = Switch[eulerRepresentative1, \[IndentingNewLine]{}, d, \[IndentingNewLine]_, Min[d - Plus @@ eulerRepresentative1, Last@eulerRepresentative1]]}, \[IndentingNewLine]If[\ \[IndentingNewLine]nextOccupationNumber \[GreaterEqual] 1 && Length@eulerRepresentative1 < f, \(Append[eulerRepresentative1, #] &\) /@ Reverse@Range[1, nextOccupationNumber], \ \[IndentingNewLine]{eulerRepresentative1}\[IndentingNewLine]]\n]\)}], "Input"], Cell[CellGroupData[{ Cell[BoxData[ \({d = 8, f = 5}; branchEulerRepresentative[d, f]@{}\)], "Input"], Cell[BoxData[ \({{8}, {7}, {6}, {5}, {4}, {3}, {2}, {1}}\)], "Output"] }, Open ]], Cell[TextData[{ "D\[EAcute]f. : ", StyleBox["mort", FontSlant->"Italic"], " : sans ramification ; contraire : ", StyleBox["vif", FontSlant->"Italic"], ". " }], "Text"], Cell["Mort.", "Text"], Cell[CellGroupData[{ Cell[BoxData[ \(branchEulerRepresentative[d, f]@{d}\)], "Input"], Cell[BoxData[ \({{8}}\)], "Output"] }, Open ]], Cell["Vif.", "Text"], Cell[CellGroupData[{ Cell[BoxData[{ \(Table[1, {Min[d, f] - 1}]\), "\[IndentingNewLine]", \(branchEulerRepresentative[d, f]@%\)}], "Input"], Cell[BoxData[ \({1, 1, 1, 1}\)], "Output"], Cell[BoxData[ \({{1, 1, 1, 1, 1}}\)], "Output"] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[{ \(Table[1, {Min[d, f]}]\), "\[IndentingNewLine]", \(branchEulerRepresentative[d, f]@%\)}], "Input"], Cell[BoxData[ \({1, 1, 1, 1, 1}\)], "Output"], Cell[BoxData[ \({{1, 1, 1, 1, 1}}\)], "Output"] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[ \(branchEulerRepresentative[d, f]@{d - 1}\)], "Input"], Cell[BoxData[ \({{7, 1}}\)], "Output"] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[ \(branchEulerRepresentative[d, f]@{d - 2}\)], "Input"], Cell[BoxData[ \({{6, 2}, {6, 1}}\)], "Output"] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[ \(branchEulerRepresentative[d, f]@{2}\)], "Input"], Cell[BoxData[ \({{2, 2}, {2, 1}}\)], "Output"] }, Open ]], Cell["R\[EAcute]valuer jusqu'\[AGrave] ce que rien de ne change.", "Text"], Cell[CellGroupData[{ Cell[BoxData[ \(First[branchEulerRepresentative[d, f] /@ %]\)], "Input"], Cell[BoxData[ \({{2, 2, 2, 2}}\)], "Output"] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[ \(FixedPoint[First[branchEulerRepresentative[d, f]@#] &, {2}]\)], "Input"], Cell[BoxData[ \({2, 2, 2, 2}\)], "Output"] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[ \(branchEulerRepresentative[d, f]@{d - 1, 1}\)], "Input"], Cell[BoxData[ \({{7, 1}}\)], "Output"] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[ \(branchEulerRepresentative[0, f]@{}\)], "Input"], Cell[BoxData[ \({{}}\)], "Output"] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[ \(branchEulerRepresentative[1, 0]@{}\)], "Input"], Cell[BoxData[ \({{}}\)], "Output"] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[ \(branchEulerRepresentative[0, 0]@{}\)], "Input"], Cell[BoxData[ \({{}}\)], "Output"] }, Open ]], Cell[BoxData[ \(\({d =. , f =. };\)\)], "Input"] }, Open ]], Cell[CellGroupData[{ Cell["Cr\[EAcute]er un niveau en ramifiant toutes les feuilles d'un niveau", \ "Outline2"], Cell[BoxData[ \(\({d = 8, f = 5};\)\)], "Input"], Cell[CellGroupData[{ Cell[BoxData[ \({{d}, {d - 2}, Table[1, {Min[f, d]}]}\)], "Input"], Cell[BoxData[ \({{8}, {6}, {1, 1, 1, 1, 1}}\)], "Output"] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[ \(branchEulerRepresentative[d, f] /@ %\)], "Input"], Cell[BoxData[ \({{{8}}, {{6, 2}, {6, 1}}, {{1, 1, 1, 1, 1}}}\)], "Output"] }, Open ]], Cell[BoxData[ \(Clear@branchEulerRepresentativeList; branchEulerRepresentativeList[d_, f_]@eulerRepresentativeList_ := Flatten[branchEulerRepresentative[d, f] /@ eulerRepresentativeList, 1]\)], "Input"], Cell[CellGroupData[{ Cell[BoxData[ \(branchEulerRepresentativeList[d, f]@{{d}, {d - 1}, {d - 1, 1}, Table[1, {Min[f, d]}]}\)], "Input"], Cell[BoxData[ \({{8}, {7, 1}, {7, 1}, {1, 1, 1, 1, 1}}\)], "Output"] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[ \(branchEulerRepresentativeList[d, f]@{{}}\)], "Input"], Cell[BoxData[ \({{8}, {7}, {6}, {5}, {4}, {3}, {2}, {1}}\)], "Output"] }, Open ]], Cell[BoxData[ \(\({d =. , f =. };\)\)], "Input"] }, Open ]], Cell[CellGroupData[{ Cell["R\[EAcute]currence sur le niveau", "Outline2"], Cell[TextData[{ "Il y a au plus ", Cell[BoxData[ \(TraditionalForm\`Min[d, f]\)]], " faces distinctes dans une combinaison. Un point fixe est donc atteint en \ it\[EAcute]rant ", Cell[BoxData[ \(TraditionalForm\`Min[d, f]\)]], " fois." }], "Text"], Cell[BoxData[ \(\({d = 8, f = 5};\)\)], "Input"], Cell[CellGroupData[{ Cell[BoxData[ \(Nest[branchEulerRepresentativeList[d, f], {{}}, Min[d, f]]\)], "Input"], Cell[BoxData[ \({{8}, {7, 1}, {6, 2}, {6, 1, 1}, {5, 3}, {5, 2, 1}, {5, 1, 1, 1}, {4, 4}, {4, 3, 1}, {4, 2, 2}, {4, 2, 1, 1}, {4, 1, 1, 1, 1}, {3, 3, 2}, {3, 3, 1, 1}, {3, 2, 2, 1}, {3, 2, 1, 1, 1}, {3, 1, 1, 1, 1}, {2, 2, 2, 2}, {2, 2, 2, 1, 1}, {2, 2, 1, 1, 1}, {2, 1, 1, 1, 1}, {1, 1, 1, 1, 1}}\)], "Output"] }, Open ]], Cell["De plus, il faut s'assurer qu'on a plac\[EAcute] tous les \ d\[EAcute]s.", "Text"], Cell[CellGroupData[{ Cell[BoxData[ \(Select[Nest[branchEulerRepresentativeList[d, f], {{}}, Min[d, f]], Plus @@ # \[Equal] d &]\)], "Input"], Cell[BoxData[ \({{8}, {7, 1}, {6, 2}, {6, 1, 1}, {5, 3}, {5, 2, 1}, {5, 1, 1, 1}, {4, 4}, {4, 3, 1}, {4, 2, 2}, {4, 2, 1, 1}, {4, 1, 1, 1, 1}, {3, 3, 2}, {3, 3, 1, 1}, {3, 2, 2, 1}, {3, 2, 1, 1, 1}, {2, 2, 2, 2}, {2, 2, 2, 1, 1}}\)], "Output"] }, Open ]], Cell[BoxData[ \(\({d =. , f =. };\)\)], "Input"], Cell[BoxData[ \(Clear@allEulerRepresentatives; allEulerRepresentatives[d_Integer, f_Integer] := Select[Nest[branchEulerRepresentativeList[d, f], {{}}, Min[d, f]], Plus @@ # \[Equal] d &]\)], "Input"], Cell[CellGroupData[{ Cell[BoxData[ \(allEulerRepresentatives[3, 0]\)], "Input"], Cell[BoxData[ \({}\)], "Output"] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[ \(allEulerRepresentatives[3, 1]\)], "Input"], Cell[BoxData[ \({{3}}\)], "Output"] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[ \(allEulerRepresentatives[3, 2]\)], "Input"], Cell[BoxData[ \({{3}, {2, 1}}\)], "Output"] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[ \(allEulerRepresentatives[0, 0]\)], "Input"], Cell[BoxData[ \({{}}\)], "Output"] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[ \(allEulerRepresentatives[0, 1]\)], "Input"], Cell[BoxData[ \({{}}\)], "Output"] }, Open ]], Cell[TextData[{ Cell[BoxData[ \(TraditionalForm\`d\ = \ 3\ \[LessEqual] \ f\)]], " \[Rule] brelan (111), paire (211), suite (321)." }], "Text"], Cell[CellGroupData[{ Cell[BoxData[ \(allEulerRepresentatives[3, 3]\)], "Input"], Cell[BoxData[ \({{3}, {2, 1}, {1, 1, 1}}\)], "Output"] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[ \(allEulerRepresentatives[3, 6]\)], "Input"], Cell[BoxData[ \({{3}, {2, 1}, {1, 1, 1}}\)], "Output"] }, Open ]], Cell[TextData[{ StyleBox["Partitions", "Output"], " fait presque pareil." }], "Text"], Cell[CellGroupData[{ Cell[BoxData[ \(Partitions@3\)], "Input"], Cell[BoxData[ \({{3}, {2, 1}, {1, 1, 1}}\)], "Output"] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[ \(With[{d = 3, f = 6}, \[IndentingNewLine]Select[Partitions@d, Length@# \[LessEqual] f &] \[Equal] allEulerRepresentatives[d, f]]\)], "Input"], Cell[BoxData[ \(True\)], "Output"] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[ \(With[{d = 5, f = 3}, \[IndentingNewLine]Select[Partitions@d, Length@# \[LessEqual] f &] \[Equal] allEulerRepresentatives[d, f]]\)], "Input"], Cell[BoxData[ \(True\)], "Output"] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[ \(With[{d = 3, f = 6}, \[IndentingNewLine]zoomTiming[ allEulerRepresentatives[d, f], Select[Partitions@d, Length@# \[LessEqual] f &], 1000]\[IndentingNewLine]]\)], "Input"], Cell[BoxData[ \({0.3499999999999943`\ Second, 0.3400000000000034`\ Second}\)], "Output"] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[ \(With[{d = 3, f = 6}, \[IndentingNewLine]Select[Partitions@d, Length@# \[LessEqual] f &] \[Equal] DeleteCases[Partitions@d, Append[Table[_, {f - 1}], __]]]\)], "Input"], Cell[BoxData[ \(True\)], "Output"] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[ \(With[{d = 3, f = 6}, \[IndentingNewLine]zoomTiming[ allEulerRepresentatives[d, f], Select[Partitions@d, Length@# \[LessEqual] f &], DeleteCases[Partitions@d, Flatten@{Table[_, {f - 1}], __}], 1000]\[IndentingNewLine]]\)], "Input"], Cell[BoxData[ \({0.3500000000000085`\ Second, 0.3499999999999943`\ Second, 0.3499999999999943`\ Second}\)], "Output"] }, Open ]], Cell[BoxData[ \(Clear@branchEulerRepresentative; Clear@branchEulerRepresentativeList;\)], "Input"], Cell[BoxData[ \(Clear@allEulerRepresentatives; allEulerRepresentatives[d_Integer, f_Integer] := Select[Partitions@d, Length@# \[LessEqual] f &]\)], "Input", InitializationCell->True], Cell[BoxData[ \(Clear@allLagrangeRepresentatives; allLagrangeRepresentatives[d_, f_] := eulerToLagrange /@ allEulerRepresentatives[d, f]\)], "Input", InitializationCell->True], Cell[CellGroupData[{ Cell[BoxData[ \(\(allLagrangeRepresentatives[#, 3] &\) /@ Range@3\)], "Input"], Cell[BoxData[ \({{{1}}, {{1, 1}, {1, 2}}, {{1, 1, 1}, {1, 1, 2}, {1, 2, 3}}}\)], "Output"] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[ \(allLagrangeRepresentatives[3, 6]\)], "Input"], Cell[BoxData[ \({{1, 1, 1}, {1, 1, 2}, {1, 2, 3}}\)], "Output"] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[ \(allLagrangeRepresentatives[6, 3]\)], "Input"], Cell[BoxData[ \({{1, 1, 1, 1, 1, 1}, {1, 1, 1, 1, 1, 2}, {1, 1, 1, 1, 2, 2}, {1, 1, 1, 1, 2, 3}, {1, 1, 1, 2, 2, 2}, {1, 1, 1, 2, 2, 3}, {1, 1, 2, 2, 3, 3}}\)], "Output"] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[ \(allLagrangeRepresentatives[0, 1]\)], "Input"], Cell[BoxData[ \({{}}\)], "Output"] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[ \(allLagrangeRepresentatives[0, 0]\)], "Input"], Cell[BoxData[ \({{}}\)], "Output"] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[ \(allLagrangeRepresentatives[1, 0]\)], "Input"], Cell[BoxData[ \({}\)], "Output"] }, Open ]] }, Open ]] }, Open ]], Cell[CellGroupData[{ Cell["Repr\[EAcute]sentant conditionnel", "Subsubsection", CellTags->{"section10", "c:29"}], Cell["\<\ Les faces sont \[EAcute]quivalentes si elles ont le m\[EHat]me \ nombre d'occupation dans la combinaison conditionnante. \ \>", "Text"], Cell[BoxData[ \(f = 8; combination = {2, 2, 2, 3, 3, 4, 5, 5, 6, 6};\)], "Input"], Cell[CellGroupData[{ Cell[BoxData[ \(With[{vector = lagrangeToEuler@combination}, \(MapAt[ Apply[Join, Last /@ #] &, #, \(-1\)] &\) /@ listQuotient[MapIndexed[List, PadRight[vector, f]], First, withValues \[Rule] True]]\)], "Input"], Cell[BoxData[ \({{0, {1, 7, 8}}, {1, {4}}, {2, {3, 5, 6}}, {3, {2}}}\)], "Output"] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[ \(Prepend[\(MapAt[Last /@ # &, #, \(-1\)] &\) /@ listQuotient[\({Length@#, First@#} &\) /@ Split@combination, First, withValues \[Rule] True], {0, Range@f\[Backslash]combination}]\)], "Input"], Cell[BoxData[ \({{0, {1, 7, 8}}, {1, {4}}, {2, {3, 5, 6}}, {3, {2}}}\)], "Output"] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[ \(% \[Equal] %%\)], "Input"], Cell[BoxData[ \(True\)], "Output"] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[ \(zoomTiming[\[IndentingNewLine]With[{vector = lagrangeToEuler@combination}, \(MapAt[ Apply[Join, Last /@ #] &, #, \(-1\)] &\) /@ listQuotient[MapIndexed[List, PadRight[vector, f]], First, withValues \[Rule] True]], \[IndentingNewLine]Prepend[\(MapAt[ Last /@ # &, #, \(-1\)] &\) /@ listQuotient[\({Length@#, First@#} &\) /@ Split@combination, First, withValues \[Rule] True], {0, Range@f\[Backslash] combination}], \[IndentingNewLine]1000]\)], "Input"], Cell[BoxData[ \({1.0399999999999991`\ Second, 0.8500000000000014`\ Second}\)], "Output"] }, Open ]], Cell[BoxData[ \(f =. ; combination =. ;\)], "Input"], Cell["\<\ \[Wolf] Chaque classe est une combinaison sans \ r\[EAcute]p\[EAcute]tition (ensemble ordonn\[EAcute], liste strictement \ croissante).\ \>", "Text"], Cell[BoxData[ \(Clear@faceQuotient; faceQuotient[f_Integer]@combination_List := Prepend[\(MapAt[Last /@ # &, #, \(-1\)] &\) /@ listQuotient[\({Length@#, First@#} &\) /@ Split@combination, First, withValues \[Rule] True], {0, Range@f\[Backslash]combination}]\)], "Input", InitializationCell->True], Cell[CellGroupData[{ Cell[BoxData[ \(faceQuotient[6]@{}\)], "Input"], Cell[BoxData[ \({{0, {1, 2, 3, 4, 5, 6}}}\)], "Output"] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[ \(faceQuotient[6]@{1, 1}\)], "Input"], Cell[BoxData[ \({{0, {2, 3, 4, 5, 6}}, {2, {1}}}\)], "Output"] }, Open ]], Cell["\<\ Repr\[EAcute]sentant de la seconde combinaison conditionn\[EAcute] \ par la premi\[EGrave]re ? \ \>", "Text"], Cell[BoxData[{ \(combination1 = {2, 2, 2, 3, 3, 4, 5, 5, 6, 6}; combination2 = {2, 2, 3, 4, 4, 5, 5, 5, 6, 6, 7, 8, 8};\), "\[IndentingNewLine]", \(\(f = Last@combination2;\)\)}], "Input"], Cell[CellGroupData[{ Cell[BoxData[ \(faceQuotient1 = faceQuotient[f]@combination1\)], "Input"], Cell[BoxData[ \({{0, {1, 7, 8}}, {1, {4}}, {2, {3, 5, 6}}, {3, {2}}}\)], "Output"] }, Open ]], Cell["\<\ R\[EAcute]partir les faces de la seconde combinaison sur les \ classes de la premi\[EGrave]re.\ \>", "Text"], Cell[CellGroupData[{ Cell[BoxData[ \(faceQuotient2 = \(MapAt[ With[{class = #}, Select[combination2, #~myElement~class &]] &, #, \(-1\)] &\) /@ faceQuotient1\)], "Input"], Cell[BoxData[ \({{0, {7, 8, 8}}, {1, {4, 4}}, {2, {3, 5, 5, 5, 6, 6}}, {3, {2, 2}}}\)], "Output"] }, Open ]], Cell["Reconnaissance de forme.", "Text"], Cell[CellGroupData[{ Cell[BoxData[ \(faceQuotient2 = \(MapAt[ With[{class = #}, Cases[combination2, Alternatives @@ class]] &, #, \(-1\)] &\) /@ faceQuotient1\)], "Input"], Cell[BoxData[ \({{0, {7, 8, 8}}, {1, {4, 4}}, {2, {3, 5, 5, 5, 6, 6}}, {3, {2, 2}}}\)], "Output"] }, Open ]], Cell["\[Lambda]-calcul.", "Text"], Cell[CellGroupData[{ Cell[BoxData[ \(faceQuotient2 = \(Transpose@{First /@ #, \(Cases[combination2, Alternatives @@ #] &\) /@ \(Last /@ #\)} &\)@ faceQuotient1\)], "Input"], Cell[BoxData[ \({{0, {7, 8, 8}}, {1, {4, 4}}, {2, {3, 5, 5, 5, 6, 6}}, {3, {2, 2}}}\)], "Output"] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[ \(zoomTiming[\[IndentingNewLine]\(MapAt[ With[{class = #}, Select[combination2, #~myElement~class &]] &, #, \(-1\)] &\) /@ faceQuotient1, \[IndentingNewLine]\(MapAt[ With[{class = #}, Cases[combination2, Alternatives @@ class]] &, #, \(-1\)] &\) /@ faceQuotient1, \[IndentingNewLine]\(Transpose@{First /@ #, \(Cases[ combination2, Alternatives @@ #] &\) /@ \(Last /@ #\)} &\)@ faceQuotient1, \[IndentingNewLine]3000]\)], "Input"], Cell[BoxData[ \({4.700000000000003`\ Second, 0.8900000000000006`\ Second, 0.8700000000000045`\ Second}\)], "Output"] }, Open ]], Cell["Repr\[EAcute]sentants des sous-combinaisons.", "Text"], Cell[CellGroupData[{ Cell[BoxData[ \(\(MapAt[lagrangeRepresentative, #, \(-1\)] &\) /@ faceQuotient2\)], "Input"], Cell[BoxData[ \({{0, {1, 1, 2}}, {1, {1, 1}}, {2, {1, 1, 1, 2, 2, 3}}, {3, {1, 1}}}\)], "Output"] }, Open ]], Cell[TextData[{ "Une permutation par classe, pour obliger chaque repr\[EAcute]sentant \ \[AGrave] rester dans sa classe. \[Wolf] La permutation repr\[EAcute]sentante \ d'une classe (combinaison sans r\[EAcute]p\[EAcute]tition) vers son \ r\[EAcute]presentant est ", StyleBox["croissante", FontSlant->"Italic"], " sur la classe (bien que non globalement croissante en \ g\[EAcute]n\[EAcute]ral)", "." }], "Text"], Cell[CellGroupData[{ Cell[BoxData[ \(graphList = \(\((Reverse /@ representingPermutationGraph@#)\) &\) /@ \(Last /@ faceQuotient1\)\)], "Input"], Cell[BoxData[ \({{{1, 1}, {2, 7}, {3, 8}, {4, 2}, {5, 3}, {6, 4}, {7, 5}, {8, 6}}, {{1, 4}, {2, 1}, {3, 2}, {4, 3}}, {{1, 3}, {2, 5}, {3, 6}, {4, 1}, {5, 2}, {6, 4}}, {{1, 2}, {2, 1}}}\)], "Output"] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[ \(scanPrint@ MapThread[ With[{graph1 = #2}, MapAt[function1[graph1, lagrangeRepresentative@#] &, #1, \(-1\)]] &, \ {faceQuotient2, graphList}]\)], "Input"], Cell[BoxData[ \({0, function1[{{1, 1}, {2, 7}, {3, 8}, {4, 2}, {5, 3}, {6, 4}, {7, 5}, {8, 6}}, {1, 1, 2}]}\)], "Print"], Cell[BoxData[ \({1, function1[{{1, 4}, {2, 1}, {3, 2}, {4, 3}}, {1, 1}]}\)], "Print"], Cell[BoxData[ \({2, function1[{{1, 3}, {2, 5}, {3, 6}, {4, 1}, {5, 2}, {6, 4}}, {1, 1, 1, 2, 2, 3}]}\)], "Print"], Cell[BoxData[ \({3, function1[{{1, 2}, {2, 1}}, {1, 1}]}\)], "Print"] }, Open ]], Cell["\<\ \[Wolf] La permutation \[EAcute]tant croissante sur la classe, il \ est en fait inutile de trier.\ \>", "Text"], Cell[CellGroupData[{ Cell[BoxData[{ \(faceQuotient2\), "\n", \(MapThread[ With[{graph1 = #2}, MapAt[ (*\(Sort\)\(@\)*) transform[ graph1]@\(lagrangeRepresentative@#\) &, #1, \(-1\)]] &, \ {faceQuotient2, graphList}]\)}], "Input"], Cell[BoxData[ \({{0, {7, 8, 8}}, {1, {4, 4}}, {2, {3, 5, 5, 5, 6, 6}}, {3, {2, 2}}}\)], "Output"], Cell[BoxData[ \({{0, {1, 1, 7}}, {1, {4, 4}}, {2, {3, 3, 3, 5, 5, 6}}, {3, {2, 2}}}\)], "Output"] }, Open ]], Cell["\<\ Combinaison repr\[EAcute]sentant la seconde combinaison, conditionn\ \[EAcute]e par la premi\[EGrave]re.\ \>", "Text"], Cell[CellGroupData[{ Cell[BoxData[ \(Sort[Join @@ \(Last /@ %\)]\)], "Input"], Cell[BoxData[ \({1, 1, 2, 2, 3, 3, 3, 4, 4, 5, 5, 6, 7}\)], "Output"] }, Open ]], Cell[BoxData[ \(\({f, faceQuotient1, faceQuotient2, graphList, combination1, combination2} =. ;\)\)], "Input"], Cell[BoxData[{ \(\(Clear@conditionalLagrangeRepresentative;\)\), "\[IndentingNewLine]", \(\(conditionalLagrangeRepresentative[_]@{} = {};\)\), "\ \[IndentingNewLine]", \(conditionalLagrangeRepresentative[combination1_List]@combination2_List := With[{faceQuotient1 = faceQuotient[Last@combination2]@ combination1}, \[IndentingNewLine]With[{faceQuotient2 = \ \(Transpose@{First /@ #, \(Cases[combination2, Alternatives @@ #] &\) /@ \(Last /@ #\)} &\)@ faceQuotient1, \[IndentingNewLine]graphList = \(\((Reverse /@ representingPermutationGraph@#)\) &\) /@ \(Last /@ faceQuotient1\)}, \[IndentingNewLine]Sort[ Join @@ \(Last /@ \[IndentingNewLine]MapThread[ With[{graph1 = #2}, MapAt[ (*\(Sort\)\(@\)*) transform[ graph1]@\(lagrangeRepresentative@#\) &, #1, \ \(-1\)]] &, {faceQuotient2, graphList}]\)\[IndentingNewLine]]\[IndentingNewLine]]\ \[IndentingNewLine]]\)}], "Input", InitializationCell->True], Cell[CellGroupData[{ Cell[BoxData[ \(conditionalLagrangeRepresentative[{1, 1, 1, 2, 2, 3, 4, 4, 5, 5}]@{1, 1, 2, 3, 3, 4, 4, 4, 5, 5}\)], "Input"], Cell[BoxData[ \({1, 1, 2, 2, 2, 3, 3, 4, 4, 5}\)], "Output"] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[ \(conditionalLagrangeRepresentative[{1, 1, 1, 2, 2, 3, 4, 4, 6, 6}]@{1, 1, 2, 3, 3, 4, 4, 4, 6, 6}\)], "Input"], Cell[BoxData[ \({1, 1, 2, 2, 2, 3, 3, 4, 4, 6}\)], "Output"] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[ \(conditionalLagrangeRepresentative[{3}]@{3, 4, 5}\)], "Input"], Cell[BoxData[ \({1, 2, 3}\)], "Output"] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[ \(conditionalLagrangeRepresentative[{2, 3}]@{3, 4, 5}\)], "Input"], Cell[BoxData[ \({1, 2, 4}\)], "Output"] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[ \(conditionalLagrangeRepresentative[{1, 2}]@{3, 4}\)], "Input"], Cell[BoxData[ \({3, 4}\)], "Output"] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[ \(conditionalLagrangeRepresentative[{1, 2, 3}]@{2, 3, 4}\)], "Input"], Cell[BoxData[ \({1, 2, 4}\)], "Output"] }, Open ]], Cell["\<\ Le repr\[EAcute]sentant conditionn\[EAcute] par la combinaison vide \ est le repr\[EAcute]sentant (inconditionnel).\ \>", "Text"], Cell[CellGroupData[{ Cell[BoxData[ \(conditionalLagrangeRepresentative[{}]@{2, 3, 4}\)], "Input"], Cell[BoxData[ \({1, 2, 3}\)], "Output"] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[ \(Apply[ And, \(conditionalLagrangeRepresentative[{}]@# \[Equal] lagrangeRepresentative@# &\) /@ allCombinations[4, 2]]\)], "Input"], Cell[BoxData[ \(True\)], "Output"] }, Open ]], Cell["\<\ Toute combinaison est son propre repr\[EAcute]sentant conditionn\ \[EAcute] par elle-m\[EHat]me.\ \>", "Text"], Cell[CellGroupData[{ Cell[BoxData[ \(Apply[ And, \(conditionalLagrangeRepresentative[#]@# \[Equal] # &\) /@ allCombinations[4, 6]]\)], "Input"], Cell[BoxData[ \(True\)], "Output"] }, Open ]], Cell[TextData[{ "\[WarningSign] G\[EAcute]n\[EAcute]raliser \[AGrave] ", Cell[BoxData[ \(TraditionalForm\`n\)]], " combinaisons conditionnantes (les classes de faces sont \ caract\[EAcute]ris\[EAcute]es par un ", Cell[BoxData[ \(TraditionalForm\`n\)]], "-uple de nombres d'occupation). Mais cela est inutile tant qu'on en reste \ \[AGrave] des probabilit\[EAcute]s markoviennes." }], "Text"] }, Open ]], Cell[CellGroupData[{ Cell["Birepr\[EAcute]sentant", "Subsubsection", CellTags->"c:30"], Cell[BoxData[ \(\(bicombination = {{1, 1, 3, 3, 5, 5}, {1, 2, 3, 3, 3, 5}};\)\)], "Input"], Cell["\<\ Permutation globale ramenant la premi\[EGrave]re composante sur son \ repr\[EAcute]sentant.\ \>", "Text"], Cell[CellGroupData[{ Cell[BoxData[{ \(\(graph1 = representingPermutationGraph@\(First@ bicombination\);\)\), "\[IndentingNewLine]", \({combination1, combination2} = \(Sort@\(transform[graph1]@#\) &\) /@ bicombination\)}], "Input"], Cell[BoxData[ \({{1, 1, 2, 2, 3, 3}, {1, 2, 2, 2, 3, 4}}\)], "Output"] }, Open ]], Cell["\<\ Ramener la seconde sur son repr\[EAcute]sentant conditionn\[EAcute] \ par la premi\[EGrave]re.\ \>", "Text"], Cell[CellGroupData[{ Cell[BoxData[ \(conditionalLagrangeRepresentative[combination1]@combination2\)], "Input"], Cell[BoxData[ \({1, 1, 1, 2, 3, 4}\)], "Output"] }, Open ]], Cell["Birepr\[EAcute]sentant de la bicombinaison :", "Text"], Cell[CellGroupData[{ Cell[BoxData[ \({combination1, conditionalLagrangeRepresentative[combination1]@ combination2}\)], "Input"], Cell[BoxData[ \({{1, 1, 2, 2, 3, 3}, {1, 1, 1, 2, 3, 4}}\)], "Output"] }, Open ]], Cell[BoxData[ \(\({f, combination1, combination2, graph1} =. ;\)\)], "Input"], Cell[BoxData[ \(Clear@lagrangeBirepresentative; lagrangeBirepresentative@bicombination_ := With[{graph1 = representingPermutationGraph@\(First@bicombination\)}, With[\[IndentingNewLine]{combination1 = Sort@\(transform[graph1]@\(First@bicombination\)\), combination2 = Sort@\(transform[graph1]@\(Last@ bicombination\)\)}, \[IndentingNewLine]{combination1, conditionalLagrangeRepresentative[combination1]@ combination2}]]\)], "Input", InitializationCell->True], Cell[CellGroupData[{ Cell[BoxData[ \(lagrangeBirepresentative@{{1, 1, 3, 3, 5, 5}, {1, 2, 3, 3, 3, 5}}\)], "Input"], Cell[BoxData[ \({{1, 1, 2, 2, 3, 3}, {1, 1, 1, 2, 3, 4}}\)], "Output"] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[ \(lagrangeBirepresentative@{{1, 2, 6}, {1, 3, 6}}\)], "Input"], Cell[BoxData[ \({{1, 2, 3}, {1, 2, 4}}\)], "Output"] }, Open ]] }, Open ]], Cell[CellGroupData[{ Cell["\<\ Ensemble des repr\[EAcute]sentants conditionnels et ensemble des \ birepr\[EAcute]sentants\ \>", "Subsubsection", CellTags->"c:31"], Cell[BoxData[ \({d = 6, f = 5}; combination = {1, 2, 3, 3, 4, 4};\)], "Input"], Cell[CellGroupData[{ Cell[BoxData[ \(faceQuotient1 = faceQuotient[f]@combination\)], "Input"], Cell[BoxData[ \({{0, {5}}, {1, {1, 2}}, {2, {3, 4}}}\)], "Output"] }, Open ]], Cell["\<\ R\[EAcute]partir les d\[EAcute]s d'un repr\[EAcute]sentant \ conditionnel de toutes les mani\[EGrave]res sur les classes de faces. \ \>", \ "Text"], Cell[CellGroupData[{ Cell[BoxData[ \(allEulerRepresentatives[d, Length@faceQuotient1]\)], "Input"], Cell[BoxData[ \({{6}, {5, 1}, {4, 2}, {4, 1, 1}, {3, 3}, {3, 2, 1}, {2, 2, 2}}\)], "Output"] }, Open ]], Cell["Compl\[EAcute]ter avec des z\[EAcute]ros et permuter de toutes les mani\ \[EGrave]res.", "Text"], Cell[CellGroupData[{ Cell[BoxData[ \(eulerRepresentativeList = \[IndentingNewLine]Flatten[\(Permutations@ Join[#, Table[0, {Length@faceQuotient1 - Length@#}]] &\) /@ allEulerRepresentatives[d, Length@faceQuotient1], 1]\)], "Input"], Cell[BoxData[ \({{6, 0, 0}, {0, 6, 0}, {0, 0, 6}, {5, 1, 0}, {5, 0, 1}, {1, 5, 0}, {1, 0, 5}, {0, 5, 1}, {0, 1, 5}, {4, 2, 0}, {4, 0, 2}, {2, 4, 0}, {2, 0, 4}, {0, 4, 2}, {0, 2, 4}, {4, 1, 1}, {1, 4, 1}, {1, 1, 4}, {3, 3, 0}, {3, 0, 3}, {0, 3, 3}, {3, 2, 1}, {3, 1, 2}, {2, 3, 1}, {2, 1, 3}, {1, 3, 2}, {1, 2, 3}, {2, 2, 2}}\)], "Output"] }, Open ]], Cell[BoxData[ \(Join[#, Table[0, {Length@faceQuotient1 - Length@#}]]\)], "Input"], Cell[BoxData[ \(PadRight[#, Length@faceQuotient1]\)], "Input"], Cell[CellGroupData[{ Cell[BoxData[ \(eulerRepresentativeList = \[IndentingNewLine]Flatten[\(Permutations@\ \[IndentingNewLine]PadRight[#, Length@faceQuotient1]\[IndentingNewLine] &\) /@ allEulerRepresentatives[d, Length@faceQuotient1], 1]\)], "Input"], Cell[BoxData[ \({{6, 0, 0}, {0, 6, 0}, {0, 0, 6}, {5, 1, 0}, {5, 0, 1}, {1, 5, 0}, {1, 0, 5}, {0, 5, 1}, {0, 1, 5}, {4, 2, 0}, {4, 0, 2}, {2, 4, 0}, {2, 0, 4}, {0, 4, 2}, {0, 2, 4}, {4, 1, 1}, {1, 4, 1}, {1, 1, 4}, {3, 3, 0}, {3, 0, 3}, {0, 3, 3}, {3, 2, 1}, {3, 1, 2}, {2, 3, 1}, {2, 1, 3}, {1, 3, 2}, {1, 2, 3}, {2, 2, 2}}\)], "Output"] }, Open ]], Cell["\<\ Nombres d'occupation de la combinaison. Nombres d'occupation d'un repr\[EAcute]sentant.\ \>", "Text"], Cell[CellGroupData[{ Cell[BoxData[{ \(Length /@ \(Last /@ faceQuotient1\)\), "\[IndentingNewLine]", \(part1 = 23; eulerRepresentativeList[\([part1]\)]\)}], "Input"], Cell[BoxData[ \({1, 2, 2}\)], "Output"], Cell[BoxData[ \({3, 1, 2}\)], "Output"] }, Open ]], Cell["\<\ Produit cart\[EAcute]sien des ensembles de \ sous-repr\[EAcute]sentants possibles.\ \>", "Text"], Cell[CellGroupData[{ Cell[BoxData[ \(\((\(MapThread[ allLagrangeRepresentatives, {#, Length /@ \(Last /@ faceQuotient1\)}] &\) /@ eulerRepresentativeList)\)[\([part1]\)]\)], "Input"], Cell[BoxData[ \({{{1, 1, 1}}, {{1}}, {{1, 1}, {1, 2}}}\)], "Output"] }, Open ]], Cell["\<\ Permuter pour que les sous-repr\[EAcute]sentants restent dans la \ bonne classe.\ \>", "Text"], Cell[CellGroupData[{ Cell[BoxData[ \(graphList = \(\((Reverse /@ representingPermutationGraph@#)\) &\) /@ \(Last /@ faceQuotient1\)\)], "Input"], Cell[BoxData[ \({{{1, 5}, {2, 1}, {3, 2}, {4, 3}, {5, 4}}, {{1, 1}, {2, 2}}, {{1, 3}, {2, 4}, {3, 1}, {4, 2}}}\)], "Output"] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[ \(\((\(MapThread[ With[{graph1 = #1}, \(function1[ graph1, #] &\) /@ #2] &, {graphList, #}] &\) /@ \ \((\(MapThread[allLagrangeRepresentatives, {#, Length /@ \(Last /@ faceQuotient1\)}] &\) /@ eulerRepresentativeList)\))\)[\([part1]\)]\)], "Input"], Cell[BoxData[ \({{function1[{{1, 5}, {2, 1}, {3, 2}, {4, 3}, {5, 4}}, {1, 1, 1}]}, {function1[{{1, 1}, {2, 2}}, {1}]}, {function1[{{1, 3}, {2, 4}, {3, 1}, {4, 2}}, {1, 1}], function1[{{1, 3}, {2, 4}, {3, 1}, {4, 2}}, {1, 2}]}}\)], "Output"] }, Open ]], Cell[TextData[{ "Inutile de trier, c. f. section ", CounterBox["Section", "section10"], ".", CounterBox["Subsection", "section10"], ".", CounterBox["Subsubsection", "section10"], "." }], "Text"], Cell[CellGroupData[{ Cell[BoxData[ \(\((\(MapThread[ With[{graph1 = #1}, (*\(Sort\)\(@\)*) \(transform[ graph1]@# &\) /@ #2] &, {graphList, #}] &\) /@ \ \((\(MapThread[allLagrangeRepresentatives, {#, Length /@ \(Last /@ faceQuotient1\)}] &\) /@ eulerRepresentativeList)\))\)[\([part1]\)]\)], "Input"], Cell[BoxData[ \({{{5, 5, 5}}, {{1}}, {{3, 3}, {3, 4}}}\)], "Output"] }, Open ]], Cell["D\[EAcute]velopper le produit cart\[EAcute]sien.", "Text"], Cell[CellGroupData[{ Cell[BoxData[ \(Distribute[{{{5, 5, 5}}, {{1}}, {{3, 3}, {3, 4}}}, List]\)], "Input"], Cell[BoxData[ \({{{5, 5, 5}, {1}, {3, 3}}, {{5, 5, 5}, {1}, {3, 4}}}\)], "Output"] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[ \(\((\(Distribute[#, List] &\) /@ \[IndentingNewLine]\((\(MapThread[ With[{graph1 = #1}, \(transform[ graph1]@# &\) /@ #2] &, {graphList, #}] &\)\n\t\ \t /@ \((\(MapThread[allLagrangeRepresentatives, {#, Length /@ \(Last /@ faceQuotient1\)}] &\) /@ eulerRepresentativeList)\))\)\[IndentingNewLine])\)[\([\ part1]\)]\)], "Input"], Cell[BoxData[ \({{{5, 5, 5}, {1}, {3, 3}}, {{5, 5, 5}, {1}, {3, 4}}}\)], "Output"] }, Open ]], Cell[BoxData[ \(part1 =. \)], "Input"], Cell["Joindre les sous-repr\[EAcute]sentants.", "Text"], Cell[CellGroupData[{ Cell[BoxData[ \(Flatten[\(\(Sort[Join @@ #] &\) /@ Distribute[#, List] &\) /@ \[IndentingNewLine]\((\(MapThread[ With[{graph1 = #1}, \(transform[ graph1]@# &\) /@ #2] &, {graphList, #}] &\)\n\t /@ \ \((\(MapThread[allLagrangeRepresentatives, {#, Length /@ \(Last /@ faceQuotient1\)}] &\) /@ eulerRepresentativeList)\))\), 1]\)], "Input"], Cell[BoxData[ \({{5, 5, 5, 5, 5, 5}, {1, 1, 1, 1, 1, 1}, {1, 1, 1, 1, 1, 2}, {1, 1, 1, 1, 2, 2}, {1, 1, 1, 2, 2, 2}, {3, 3, 3, 3, 3, 3}, {3, 3, 3, 3, 3, 4}, {3, 3, 3, 3, 4, 4}, {3, 3, 3, 4, 4, 4}, {1, 5, 5, 5, 5, 5}, {3, 5, 5, 5, 5, 5}, {1, 1, 1, 1, 1, 5}, {1, 1, 1, 1, 2, 5}, {1, 1, 1, 2, 2, 5}, {3, 3, 3, 3, 3, 5}, {3, 3, 3, 3, 4, 5}, {3, 3, 3, 4, 4, 5}, {1, 1, 1, 1, 1, 3}, {1, 1, 1, 1, 2, 3}, {1, 1, 1, 2, 2, 3}, {1, 3, 3, 3, 3, 3}, {1, 3, 3, 3, 3, 4}, {1, 3, 3, 3, 4, 4}, {1, 1, 5, 5, 5, 5}, {1, 2, 5, 5, 5, 5}, {3, 3, 5, 5, 5, 5}, {3, 4, 5, 5, 5, 5}, {1, 1, 1, 1, 5, 5}, {1, 1, 1, 2, 5, 5}, {1, 1, 2, 2, 5, 5}, {3, 3, 3, 3, 5, 5}, {3, 3, 3, 4, 5, 5}, {3, 3, 4, 4, 5, 5}, {1, 1, 1, 1, 3, 3}, {1, 1, 1, 1, 3, 4}, {1, 1, 1, 2, 3, 3}, {1, 1, 1, 2, 3, 4}, {1, 1, 2, 2, 3, 3}, {1, 1, 2, 2, 3, 4}, {1, 1, 3, 3, 3, 3}, {1, 1, 3, 3, 3, 4}, {1, 1, 3, 3, 4, 4}, {1, 2, 3, 3, 3, 3}, {1, 2, 3, 3, 3, 4}, {1, 2, 3, 3, 4, 4}, {1, 3, 5, 5, 5, 5}, {1, 1, 1, 1, 3, 5}, {1, 1, 1, 2, 3, 5}, {1, 1, 2, 2, 3, 5}, {1, 3, 3, 3, 3, 5}, {1, 3, 3, 3, 4, 5}, {1, 3, 3, 4, 4, 5}, {1, 1, 1, 5, 5, 5}, {1, 1, 2, 5, 5, 5}, {3, 3, 3, 5, 5, 5}, {3, 3, 4, 5, 5, 5}, {1, 1, 1, 3, 3, 3}, {1, 1, 1, 3, 3, 4}, {1, 1, 2, 3, 3, 3}, {1, 1, 2, 3, 3, 4}, {1, 1, 3, 5, 5, 5}, {1, 2, 3, 5, 5, 5}, {1, 3, 3, 5, 5, 5}, {1, 3, 4, 5, 5, 5}, {1, 1, 1, 3, 5, 5}, {1, 1, 2, 3, 5, 5}, {1, 3, 3, 3, 5, 5}, {1, 3, 3, 4, 5, 5}, {1, 1, 1, 3, 3, 5}, {1, 1, 1, 3, 4, 5}, {1, 1, 2, 3, 3, 5}, {1, 1, 2, 3, 4, 5}, {1, 1, 3, 3, 3, 5}, {1, 1, 3, 3, 4, 5}, {1, 2, 3, 3, 3, 5}, {1, 2, 3, 3, 4, 5}, {1, 1, 3, 3, 5, 5}, {1, 1, 3, 4, 5, 5}, {1, 2, 3, 3, 5, 5}, {1, 2, 3, 4, 5, 5}}\)], "Output"] }, Open ]], Cell[BoxData[ \(\({d, f, faceQuotient1, graphList, eulerRepresentativeList, combination} =. ;\)\)], "Input"], Cell[BoxData[{ \(\(Clear@allConditionalLagrangeRepresentatives;\)\), "\n", \(\(allConditionalLagrangeRepresentatives[combination_]\)[d_, f_] := With[{faceQuotient1 = faceQuotient[f]@ combination}, \[IndentingNewLine]With[{eulerRepresentativeList \ = \[IndentingNewLine]Flatten[\(Permutations[ PadRight[#, Length@faceQuotient1]] &\) /@ allEulerRepresentatives[d, Length@faceQuotient1], 1], \[IndentingNewLine]graphList = \(\((Reverse /@ representingPermutationGraph@#)\) &\) /@ \(Last /@ faceQuotient1\)}, \[IndentingNewLine]Flatten[\(\(Sort[ Join @@ #] &\) /@ Distribute[#, List] &\) /@ \[IndentingNewLine]\((\(MapThread[ With[{graph1 = #1}, (*\(Sort\)\(@\)*) \(transform[ graph1]@# &\) /@ #2] &, {graphList, #}] &\) \ /@ \((\(MapThread[allLagrangeRepresentatives, {#, Length /@ \(Last /@ faceQuotient1\)}] &\) /@ eulerRepresentativeList)\))\), 1]\[IndentingNewLine]]\[IndentingNewLine]]\)}], "Input", InitializationCell->True], Cell[CellGroupData[{ Cell[BoxData[ \(\(allConditionalLagrangeRepresentatives[{1, 2, 3, 3, 4, 4}]\)[6, 5]\)], "Input"], Cell[BoxData[ \({{5, 5, 5, 5, 5, 5}, {1, 1, 1, 1, 1, 1}, {1, 1, 1, 1, 1, 2}, {1, 1, 1, 1, 2, 2}, {1, 1, 1, 2, 2, 2}, {3, 3, 3, 3, 3, 3}, {3, 3, 3, 3, 3, 4}, {3, 3, 3, 3, 4, 4}, {3, 3, 3, 4, 4, 4}, {1, 5, 5, 5, 5, 5}, {3, 5, 5, 5, 5, 5}, {1, 1, 1, 1, 1, 5}, {1, 1, 1, 1, 2, 5}, {1, 1, 1, 2, 2, 5}, {3, 3, 3, 3, 3, 5}, {3, 3, 3, 3, 4, 5}, {3, 3, 3, 4, 4, 5}, {1, 1, 1, 1, 1, 3}, {1, 1, 1, 1, 2, 3}, {1, 1, 1, 2, 2, 3}, {1, 3, 3, 3, 3, 3}, {1, 3, 3, 3, 3, 4}, {1, 3, 3, 3, 4, 4}, {1, 1, 5, 5, 5, 5}, {1, 2, 5, 5, 5, 5}, {3, 3, 5, 5, 5, 5}, {3, 4, 5, 5, 5, 5}, {1, 1, 1, 1, 5, 5}, {1, 1, 1, 2, 5, 5}, {1, 1, 2, 2, 5, 5}, {3, 3, 3, 3, 5, 5}, {3, 3, 3, 4, 5, 5}, {3, 3, 4, 4, 5, 5}, {1, 1, 1, 1, 3, 3}, {1, 1, 1, 1, 3, 4}, {1, 1, 1, 2, 3, 3}, {1, 1, 1, 2, 3, 4}, {1, 1, 2, 2, 3, 3}, {1, 1, 2, 2, 3, 4}, {1, 1, 3, 3, 3, 3}, {1, 1, 3, 3, 3, 4}, {1, 1, 3, 3, 4, 4}, {1, 2, 3, 3, 3, 3}, {1, 2, 3, 3, 3, 4}, {1, 2, 3, 3, 4, 4}, {1, 3, 5, 5, 5, 5}, {1, 1, 1, 1, 3, 5}, {1, 1, 1, 2, 3, 5}, {1, 1, 2, 2, 3, 5}, {1, 3, 3, 3, 3, 5}, {1, 3, 3, 3, 4, 5}, {1, 3, 3, 4, 4, 5}, {1, 1, 1, 5, 5, 5}, {1, 1, 2, 5, 5, 5}, {3, 3, 3, 5, 5, 5}, {3, 3, 4, 5, 5, 5}, {1, 1, 1, 3, 3, 3}, {1, 1, 1, 3, 3, 4}, {1, 1, 2, 3, 3, 3}, {1, 1, 2, 3, 3, 4}, {1, 1, 3, 5, 5, 5}, {1, 2, 3, 5, 5, 5}, {1, 3, 3, 5, 5, 5}, {1, 3, 4, 5, 5, 5}, {1, 1, 1, 3, 5, 5}, {1, 1, 2, 3, 5, 5}, {1, 3, 3, 3, 5, 5}, {1, 3, 3, 4, 5, 5}, {1, 1, 1, 3, 3, 5}, {1, 1, 1, 3, 4, 5}, {1, 1, 2, 3, 3, 5}, {1, 1, 2, 3, 4, 5}, {1, 1, 3, 3, 3, 5}, {1, 1, 3, 3, 4, 5}, {1, 2, 3, 3, 3, 5}, {1, 2, 3, 3, 4, 5}, {1, 1, 3, 3, 5, 5}, {1, 1, 3, 4, 5, 5}, {1, 2, 3, 3, 5, 5}, {1, 2, 3, 4, 5, 5}}\)], "Output"] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[ \(\(allConditionalLagrangeRepresentatives[{}]\)[3, 6]\)], "Input"], Cell[BoxData[ \({{1, 1, 1}, {1, 1, 2}, {1, 2, 3}}\)], "Output"] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[ \(\(allConditionalLagrangeRepresentatives[{6}]\)[3, 6]\)], "Input"], Cell[BoxData[ \({{1, 1, 1}, {1, 1, 2}, {1, 2, 3}, {6, 6, 6}, {1, 1, 6}, {1, 2, 6}, {1, 6, 6}}\)], "Output"] }, Open ]], Cell[BoxData[{ \(\(Clear@allLagrangeBirepresentatives;\)\), "\[IndentingNewLine]", \(allLagrangeBirepresentatives[d_, f_] := Flatten[\(With[{combination = #}, \[IndentingNewLine]\({combination, #} \ &\) /@ \(allConditionalLagrangeRepresentatives[#]\)[d, f]] &\) /@ allLagrangeRepresentatives[d, f], 1]\)}], "Input", InitializationCell->True], Cell[CellGroupData[{ Cell[BoxData[ \(allLagrangeBirepresentatives[3, 6]\)], "Input"], Cell[BoxData[ \({{{1, 1, 1}, {2, 2, 2}}, {{1, 1, 1}, {2, 2, 3}}, {{1, 1, 1}, {2, 3, 4}}, {{1, 1, 1}, {1, 1, 1}}, {{1, 1, 1}, {1, 2, 2}}, {{1, 1, 1}, {1, 2, 3}}, {{1, 1, 1}, {1, 1, 2}}, {{1, 1, 2}, {3, 3, 3}}, {{1, 1, 2}, {3, 3, 4}}, {{1, 1, 2}, {3, 4, 5}}, {{1, 1, 2}, {2, 2, 2}}, {{1, 1, 2}, {1, 1, 1}}, {{1, 1, 2}, {2, 3, 3}}, {{1, 1, 2}, {2, 3, 4}}, {{1, 1, 2}, {1, 3, 3}}, {{1, 1, 2}, {1, 3, 4}}, {{1, 1, 2}, {2, 2, 3}}, {{1, 1, 2}, {1, 1, 3}}, {{1, 1, 2}, {1, 2, 2}}, {{1, 1, 2}, {1, 1, 2}}, {{1, 1, 2}, {1, 2, 3}}, {{1, 2, 3}, {4, 4, 4}}, {{1, 2, 3}, {4, 4, 5}}, {{1, 2, 3}, {4, 5, 6}}, {{1, 2, 3}, {1, 1, 1}}, {{1, 2, 3}, {1, 1, 2}}, {{1, 2, 3}, {1, 2, 3}}, {{1, 2, 3}, {1, 4, 4}}, {{1, 2, 3}, {1, 4, 5}}, {{1, 2, 3}, {1, 1, 4}}, {{1, 2, 3}, {1, 2, 4}}}\)], "Output"] }, Open ]], Cell["\<\ Le plus grand nombre de valeurs d'une fonction de deux combinaisons \ globalement invariante par permutation de faces est\ \>", "Text"], Cell[CellGroupData[{ Cell[BoxData[ \(Length@%\)], "Input"], Cell[BoxData[ \(31\)], "Output"] }, Open ]] }, Open ]] }, Open ]] }, Open ]], Cell[CellGroupData[{ Cell["Arbre du destin", "Section", CellTags->"c:32"], Cell[CellGroupData[{ Cell["Ramifier un \[EAcute]tat", "Subsection", CellTags->"c:33"], Cell[BoxData[ \({d = 3, f = 3}; state = {_};\)], "Input"], Cell["Arrangements des d\[EAcute]s non encore mis de c\[OHat]t\[EAcute] :", \ "Text"], Cell[CellGroupData[{ Cell[BoxData[ \(arrangements = Distribute[Table[Range@f, {d - Length@state}], List]\)], "Input"], Cell[BoxData[ \({{1, 1}, {1, 2}, {1, 3}, {2, 1}, {2, 2}, {2, 3}, {3, 1}, {3, 2}, {3, 3}}\)], "Output"] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[ \(Map[Sort, history /@ arrangements, {2}]\)], "Input"], Cell[BoxData[ \({{{}, {1}, {1, 1}}, {{}, {1}, {1, 2}}, {{}, {1}, {1, 3}}, {{}, {2}, {1, 2}}, {{}, {2}, {2, 2}}, {{}, {2}, {2, 3}}, {{}, {3}, {1, 3}}, {{}, {3}, {2, 3}}, {{}, {3}, {3, 3}}}\)], "Output"] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[ \(listQuotient[Map[Sort, history /@ arrangements, {2}], Last]\)], "Input"], Cell[BoxData[ \({{{{}, {1}, {1, 1}}}, {{{}, {1}, {1, 2}}, {{}, {2}, {1, 2}}}, {{{}, {1}, {1, 3}}, {{}, {3}, {1, 3}}}, {{{}, {2}, {2, 2}}}, {{{}, {2}, {2, 3}}, {{}, {3}, {2, 3}}}, {{{}, {3}, {3, 3}}}}\)], "Output"] }, Open ]], Cell["\<\ Toutes les combinaisons pleines (de plus grande longueur) et leur \ sous-combinaisons.\ \>", "Text"], Cell[CellGroupData[{ Cell[BoxData[ \(\(Union @@ # &\) /@ listQuotient[Map[Sort, history /@ arrangements, {2}], Last]\)], "Input"], Cell[BoxData[ \({{{}, {1}, {1, 1}}, {{}, {1}, {2}, {1, 2}}, {{}, {1}, {3}, {1, 3}}, {{}, {2}, {2, 2}}, {{}, {2}, {3}, {2, 3}}, {{}, {3}, {3, 3}}}\)], "Output"] }, Open ]], Cell["\<\ Probabilit\[EAcute] d'obtenir une combinaison de faces en lan\ \[CCedilla]ant les d\[EAcute]s = redondance / nombre total d'arrangements. \ \[Wolf] Les d\[EAcute]s sont discernables, les arrangements sont \ \[EAcute]quiprobables..\ \>", "Text"], Cell[CellGroupData[{ Cell[BoxData[ \(\(\((Length@#/Length@arrangements)\) &\) /@ listQuotient[Map[Sort, history /@ arrangements, {2}], Last]\)], "Input"], Cell[BoxData[ \({1\/9, 2\/9, 2\/9, 1\/9, 2\/9, 1\/9}\)], "Output"] }, Open ]], Cell["\<\ {{probabilit\[EAcute] d'obtenir une combinaison de faces en lan\ \[CCedilla]ant les d\[EAcute]s, {accroissements d'\[EAcute]tat possible}}\ \[Ellipsis]}\ \>", "Text"], Cell[CellGroupData[{ Cell[BoxData[ \(branchState1 = \({Length@#/Length@arrangements, Union @@ #} &\) /@ listQuotient[Map[Sort, history /@ arrangements, {2}], Last]\)], "Input"], Cell[BoxData[ \({{1\/9, {{}, {1}, {1, 1}}}, {2\/9, {{}, {1}, {2}, {1, 2}}}, {2\/9, {{}, {1}, {3}, {1, 3}}}, {1\/9, {{}, {2}, {2, 2}}}, {2\/9, {{}, {2}, {3}, {2, 3}}}, {1\/9, {{}, {3}, {3, 3}}}}\)], "Output"] }, Open ]], Cell["\<\ {{{probabilit\[EAcute], \[EAcute]v\[EAcute]nement}, \[EAcute]tats \ suivants possibles}\[Ellipsis]}\ \>", "Text"], Cell[CellGroupData[{ Cell[BoxData[ \(\({{First@#, Last@\(Last@#\)}, allow[\(Sort@Join[state, #] &\) /@ \((Last@#)\)]} &\) /@ branchState1\)], "Input"], Cell[BoxData[ \({{{1\/9, {1, 1}}, allow[{{_}, {1, _}, {1, 1, _}}]}, {{2\/9, {1, 2}}, allow[{{_}, {1, _}, {2, _}, {1, 2, _}}]}, {{2\/9, {1, 3}}, allow[{{_}, {1, _}, {3, _}, {1, 3, _}}]}, {{1\/9, {2, 2}}, allow[{{_}, {2, _}, {2, 2, _}}]}, {{2\/9, {2, 3}}, allow[{{_}, {2, _}, {3, _}, {2, 3, _}}]}, {{1\/9, {3, 3}}, allow[{{_}, {3, _}, {3, 3, _}}]}}\)], "Output"] }, Open ]], Cell["\<\ Un premier joueur peut tout faire ; un joueur suivant doit s'arr\ \[EHat]ter \[AGrave] date fixe.\ \>", "Text"], Cell[BoxData[ \(\(allow = Identity;\)\)], "Input"], Cell[CellGroupData[{ Cell[BoxData[ \(\({{First@#, Last@\(Last@#\)}, allow[\(Sort@Join[state, #] &\) /@ \((Last@#)\)]} &\) /@ branchState1\)], "Input"], Cell[BoxData[ \({{{1\/9, {1, 1}}, {{_}, {1, _}, {1, 1, _}}}, {{2\/9, {1, 2}}, {{_}, {1, _}, {2, _}, {1, 2, _}}}, {{2\/9, {1, 3}}, {{_}, {1, _}, {3, _}, {1, 3, _}}}, {{1\/9, {2, 2}}, {{_}, {2, _}, {2, 2, _}}}, {{2\/9, {2, 3}}, {{_}, {2, _}, {3, _}, {2, 3, _}}}, {{1\/9, {3, 3}}, {{_}, {3, _}, {3, 3, _}}}}\)], "Output"] }, Open ]], Cell[BoxData[ \(\({d, f, state, arrangements, branchState1, allow} =. ;\)\)], "Input"], Cell[BoxData[ \(Clear@branchState; branchState[d_Integer, f_Integer, allow_]@ state_List \ := \[IndentingNewLine]With[\[IndentingNewLine]{arrangements = Distribute[Table[Range@f, {d - Length@state}], List]}, \[IndentingNewLine]With[\[IndentingNewLine]{\ branchState1 = \({Length@#/Length@arrangements, Union @@ #} &\) /@ \n\t\t\t\tlistQuotient[ Map[Sort, history /@ arrangements, {2}], Last]}, \[IndentingNewLine]\({{First@#, Last@\(Last@#\)}, allow[\(Sort@Join[state, #] &\) /@ \((Last@#)\)]} &\) /@ branchState1\[IndentingNewLine]]\[IndentingNewLine]]\)], "Input", InitializationCell->True], Cell[CellGroupData[{ Cell[BoxData[ \(branchState[0, 3, Identity]@{}\)], "Input"], Cell[BoxData[ \({{{1, {}}, {{}}}}\)], "Output"] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[ \(branchState[0, 0, Identity]@{}\)], "Input"], Cell[BoxData[ \({{{1, {}}, {{}}}}\)], "Output"] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[ \(branchState[1, 0, Identity]@{}\)], "Input"], Cell[BoxData[ \({}\)], "Output"] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[ \(branchState[3, 3, Identity]@{0, 0, 0}\)], "Input"], Cell[BoxData[ \({{{1, {}}, {{0, 0, 0}}}}\)], "Output"] }, Open ]], Cell["Rameau d'un premier joueur.", "Text"], Cell[CellGroupData[{ Cell[BoxData[ \(branchState[3, 3, Identity]@{_}\)], "Input"], Cell[BoxData[ \({{{1\/9, {1, 1}}, {{_}, {1, _}, {1, 1, _}}}, {{2\/9, {1, 2}}, {{_}, {1, _}, {2, _}, {1, 2, _}}}, {{2\/9, {1, 3}}, {{_}, {1, _}, {3, _}, {1, 3, _}}}, {{1\/9, {2, 2}}, {{_}, {2, _}, {2, 2, _}}}, {{2\/9, {2, 3}}, {{_}, {2, _}, {3, _}, {2, 3, _}}}, {{1\/9, {3, 3}}, {{_}, {3, _}, {3, 3, _}}}}\)], "Output"] }, Open ]], Cell["Rameau d'un joueur suivant.", "Text"], Cell[BoxData[ \(dropLast = Drop[#, \(-1\)] &; takeLast = Take[#, \(-1\)] &;\)], "Input",\ InitializationCell->True], Cell[CellGroupData[{ Cell[BoxData[ \(branchState[3, 3, dropLast]@{_}\)], "Input"], Cell[BoxData[ \({{{1\/9, {1, 1}}, {{_}, {1, _}}}, {{2\/9, {1, 2}}, {{_}, {1, _}, {2, _}}}, {{2\/9, {1, 3}}, {{_}, {1, _}, {3, _}}}, {{1\/9, {2, 2}}, {{_}, {2, _}}}, {{2\/9, {2, 3}}, {{_}, {2, _}, {3, _}}}, {{1\/9, {3, 3}}, {{_}, {3, _}}}}\)], "Output"] }, Open ]], Cell["\<\ En fin de tour (pour tous les joueurs), tous les d\[EAcute]s sont \ mis de c\[OHat]t\[EAcute].\ \>", "Text"], Cell[CellGroupData[{ Cell[BoxData[ \(branchState[3, 3, takeLast]@{_}\)], "Input"], Cell[BoxData[ \({{{1\/9, {1, 1}}, {{1, 1, _}}}, {{2\/9, {1, 2}}, {{1, 2, _}}}, {{2\/9, {1, 3}}, {{1, 3, _}}}, {{1\/9, {2, 2}}, {{2, 2, _}}}, {{2\/9, {2, 3}}, {{2, 3, _}}}, {{1\/9, {3, 3}}, {{3, 3, _}}}}\)], "Output"] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[ \(branchState[3, 4, takeLast]@{4}\)], "Input"], Cell[BoxData[ \({{{1\/16, {1, 1}}, {{1, 1, 4}}}, {{1\/8, {1, 2}}, {{1, 2, 4}}}, {{1\/8, {1, 3}}, {{1, 3, 4}}}, {{1\/8, {1, 4}}, {{1, 4, 4}}}, {{1\/16, {2, 2}}, {{2, 2, 4}}}, {{1\/8, {2, 3}}, {{2, 3, 4}}}, {{1\/8, {2, 4}}, {{2, 4, 4}}}, {{1\/16, {3, 3}}, {{3, 3, 4}}}, {{1\/8, {3, 4}}, {{3, 4, 4}}}, {{1\/16, {4, 4}}, {{4, 4, 4}}}}\)], "Output"] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[ \(branchState[3, 4, takeLast]@{2}\)], "Input"], Cell[BoxData[ \({{{1\/16, {1, 1}}, {{1, 1, 2}}}, {{1\/8, {1, 2}}, {{1, 2, 2}}}, {{1\/8, {1, 3}}, {{1, 2, 3}}}, {{1\/8, {1, 4}}, {{1, 2, 4}}}, {{1\/16, {2, 2}}, {{2, 2, 2}}}, {{1\/8, {2, 3}}, {{2, 2, 3}}}, {{1\/8, {2, 4}}, {{2, 2, 4}}}, {{1\/16, {3, 3}}, {{2, 3, 3}}}, {{1\/8, {3, 4}}, {{2, 3, 4}}}, {{1\/16, {4, 4}}, {{2, 4, 4}}}}\)], "Output"] }, Open ]], Cell["V\[EAcute]rification : retrouver l'ensemble des combinaisons.", "Text"], Cell[CellGroupData[{ Cell[BoxData[ \(Short[branchState[3, 6, Identity]@{}, 15]\)], "Input"], Cell[BoxData[ TagBox[\({{{1\/216, {1, 1, 1}}, {{}, {1}, {1, 1}, {1, 1, 1}}}, {{1\/72, {1, 1, 2}}, {{}, {1}, {2}, {1, 1}, {1, 2}, {1, 1, 2}}}, {{1\/72, {1, 1, 3}}, {{}, {1}, {3}, {1, 1}, {1, 3}, {1, 1, 3}}}, {{1\/72, {1, 1, 4}}, {{}, {1}, {4}, {1, 1}, {1, 4}, {1, 1, 4}}}, {{1\/72, {1, 1, 5}}, {{}, {1}, {5}, {1, 1}, {1, 5}, {1, 1, 5}}}, {{1\/72, {1, 1, 6}}, {{}, {1}, {6}, {1, 1}, {1, 6}, {1, 1, 6}}}, {{1\/72, {1, 2, 2}}, {{}, {1}, {2}, {1, 2}, {2, 2}, {1, 2, 2}}}, {{1\/36, {1, 2, 3}}, {{}, {1}, {2}, {3}, {1, 2}, {1, 3}, {2, 3}, {1, 2, 3}}}, {{1\/36, {1, 2, 4}}, {{}, {1}, {2}, {4}, {1, 2}, {1, 4}, {2, 4}, {1, 2, 4}}}, \[LeftSkeleton]38\[RightSkeleton], {{1\/72, {4, 4, 5}}, {{}, {4}, {5}, {4, 4}, {4, 5}, {4, 4, 5}}}, {{1\/72, {4, 4, 6}}, {{}, {4}, {6}, {4, 4}, {4, 6}, {4, 4, 6}}}, {{1\/72, {4, 5, 5}}, {{}, {4}, {5}, {4, 5}, {5, 5}, {4, 5, 5}}}, {{1\/36, {4, 5, 6}}, {{}, {4}, {5}, {6}, {4, 5}, {4, 6}, {5, 6}, {4, 5, 6}}}, {{1\/72, {4, 6, 6}}, {{}, {4}, {6}, {4, 6}, {6, 6}, {4, 6, 6}}}, {{1\/216, {5, 5, 5}}, {{}, {5}, {5, 5}, {5, 5, 5}}}, {{1\/72, {5, 5, 6}}, {{}, {5}, {6}, {5, 5}, {5, 6}, {5, 5, 6}}}, {{1\/72, {5, 6, 6}}, {{}, {5}, {6}, {5, 6}, {6, 6}, {5, 6, 6}}}, {{1\/216, {6, 6, 6}}, {{}, {6}, {6, 6}, {6, 6, 6}}}}\), (Short[ #, 15]&)]], "Output"] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[ \(With[{d = 4, f = 5}, allCombinations[d, f] \[Equal] Last /@ \(First /@ branchState[d, f, Identity]@{}\)]\)], "Input"], Cell[BoxData[ \(True\)], "Output"] }, Open ]] }, Open ]], Cell[CellGroupData[{ Cell["Ramifier un ensemble d'\[EAcute]tats", "Subsection", CellTags->"c:34"], Cell[BoxData[ \({d = 3, f = 3}; stateList = {{1}, {1, 2}};\)], "Input"], Cell[CellGroupData[{ Cell[BoxData[ \(branchStateList1 = \({#, branchState[d, f, Identity]@#} &\) /@ stateList\)], "Input"], Cell[BoxData[ \({{{1}, {{{1\/9, {1, 1}}, {{1}, {1, 1}, {1, 1, 1}}}, {{2\/9, {1, 2}}, {{1}, {1, 1}, {1, 2}, {1, 1, 2}}}, {{2\/9, {1, 3}}, {{1}, {1, 1}, {1, 3}, {1, 1, 3}}}, {{1\/9, {2, 2}}, {{1}, {1, 2}, {1, 2, 2}}}, {{2\/9, {2, 3}}, {{1}, {1, 2}, {1, 3}, {1, 2, 3}}}, {{1\/9, {3, 3}}, {{1}, {1, 3}, {1, 3, 3}}}}}, {{1, 2}, {{{1\/3, {1}}, {{1, 2}, {1, 1, 2}}}, {{1\/3, {2}}, {{1, 2}, {1, 2, 2}}}, {{1\/3, {3}}, {{1, 2}, {1, 2, 3}}}}}}\)], "Output"] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[ \(nextStates = Union@Flatten[Last /@ Flatten[Last /@ branchStateList1, 1], 1]\)], "Input"], Cell[BoxData[ \({{1}, {1, 1}, {1, 2}, {1, 3}, {1, 1, 1}, {1, 1, 2}, {1, 1, 3}, {1, 2, 2}, {1, 2, 3}, {1, 3, 3}}\)], "Output"] }, Open ]], Cell["Rep\[EAcute]rer chaque \[EAcute]tat suivant par sa position.", "Text"], Cell[CellGroupData[{ Cell[BoxData[ \(\(MapAt[\(MapAt[\(First@ Position[nextStates, #, 1, 1] &\) /@ # &, #, \(-1\)] &\) /@ # &, #, \(-1\)] \ &\) /@ branchStateList1\)], "Input"], Cell[BoxData[ \({{{1}, {{{1\/9, {1, 1}}, {{1}, {2}, {5}}}, {{2\/9, {1, 2}}, {{1}, {2}, {3}, {6}}}, {{2\/9, {1, 3}}, {{1}, {2}, {4}, {7}}}, {{1\/9, {2, 2}}, {{1}, {3}, {8}}}, {{2\/9, {2, 3}}, {{1}, {3}, {4}, {9}}}, {{1\/9, {3, 3}}, {{1}, {4}, {10}}}}}, {{1, 2}, {{{1\/3, {1}}, {{3}, {6}}}, {{1\/3, {2}}, {{3}, {8}}}, {{1\/3, \ {3}}, {{3}, {9}}}}}}\)], "Output"] }, Open ]], Cell["Garder aussi l'\[EAcute]tat, pour plus de lisibilit\[EAcute].", "Text"], Cell[CellGroupData[{ Cell[BoxData[ \(\(MapAt[\(MapAt[\({#, First@Position[nextStates, #, 1, 1]} &\) /@ # &, #, \(-1\)] &\) /@ # &, #, \ \(-1\)] &\) /@ branchStateList1\)], "Input"], Cell[BoxData[ \({{{1}, {{{1\/9, {1, 1}}, {{{1}, {1}}, {{1, 1}, {2}}, {{1, 1, 1}, {5}}}}, {{2\/9, {1, 2}}, {{{1}, {1}}, {{1, 1}, {2}}, {{1, 2}, {3}}, {{1, 1, 2}, {6}}}}, {{2\/9, {1, 3}}, {{{1}, {1}}, {{1, 1}, {2}}, {{1, 3}, {4}}, {{1, 1, 3}, {7}}}}, {{1\/9, {2, 2}}, {{{1}, {1}}, {{1, 2}, {3}}, {{1, 2, 2}, {8}}}}, {{2\/9, {2, 3}}, {{{1}, {1}}, {{1, 2}, {3}}, {{1, 3}, {4}}, {{1, 2, 3}, {9}}}}, {{1\/9, {3, 3}}, {{{1}, {1}}, {{1, 3}, {4}}, {{1, 3, 3}, {10}}}}}}, {{1, 2}, {{{1\/3, {1}}, {{{1, 2}, {3}}, {{1, 1, 2}, {6}}}}, {{1\/3, {2}}, {{{1, 2}, {3}}, {{1, 2, 2}, {8}}}}, {{1\/3, {3}}, {{{1, 2}, {3}}, {{1, 2, 3}, {9}}}}}}}\)], "Output"] }, Open ]], Cell[BoxData[ \(\({branchStateList1, nextStates, d, f, stateList} =. ;\)\)], "Input"], Cell[BoxData[ \(Clear@branchStateList; branchStateList[d_, f_, allow_]@stateList_List := With[{branchStateList1 = \({#, branchState[d, f, allow]@#} &\) /@ stateList}, \[IndentingNewLine]With[{nextStates = Union@Flatten[Last /@ Flatten[Last /@ branchStateList1, 1], 1]}, \[IndentingNewLine]{\(MapAt[\(MapAt[\({#, First@ Position[nextStates, #, 1, 1]} &\) /@ # &, #, \(-1\)] &\) /@ # &, \ #, \(-1\)] &\) /@ branchStateList1, nextStates}]\[IndentingNewLine]]\)], "Input", InitializationCell->True], Cell[CellGroupData[{ Cell[BoxData[ \(branchStateList[3, 3, Identity]@{{1}, {1, 2}}\)], "Input"], Cell[BoxData[ \({{{{1}, {{{1\/9, {1, 1}}, {{{1}, {1}}, {{1, 1}, {2}}, {{1, 1, 1}, {5}}}}, {{2\/9, {1, 2}}, {{{1}, {1}}, {{1, 1}, {2}}, {{1, 2}, {3}}, {{1, 1, 2}, {6}}}}, {{2\/9, {1, 3}}, {{{1}, {1}}, {{1, 1}, {2}}, {{1, 3}, {4}}, {{1, 1, 3}, {7}}}}, {{1\/9, {2, 2}}, {{{1}, {1}}, {{1, 2}, {3}}, {{1, 2, 2}, {8}}}}, {{2\/9, {2, 3}}, {{{1}, {1}}, {{1, 2}, {3}}, {{1, 3}, {4}}, {{1, 2, 3}, {9}}}}, {{1\/9, {3, 3}}, {{{1}, {1}}, {{1, 3}, {4}}, {{1, 3, 3}, {10}}}}}}, {{1, 2}, {{{1\/3, {1}}, {{{1, 2}, {3}}, {{1, 1, 2}, {6}}}}, {{1\/3, {2}}, {{{1, 2}, {3}}, {{1, 2, 2}, {8}}}}, {{1\/3, {3}}, {{{1, 2}, {3}}, {{1, 2, 3}, {9}}}}}}}, {{1}, {1, 1}, {1, 2}, {1, 3}, {1, 1, 1}, {1, 1, 2}, {1, 1, 3}, {1, 2, 2}, {1, 2, 3}, {1, 3, 3}}}\)], "Output"] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[ \(branchStateList[0, 3, Identity]@{{}}\)], "Input"], Cell[BoxData[ \({{{{}, {{{1, {}}, {{{}, {1}}}}}}}, {{}}}\)], "Output"] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[ \(branchStateList[0, 0, Identity]@{{}}\)], "Input"], Cell[BoxData[ \({{{{}, {{{1, {}}, {{{}, {1}}}}}}}, {{}}}\)], "Output"] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[ \(branchStateList[1, 0, Identity]@{{}}\)], "Input"], Cell[BoxData[ \({{{{}, {}}}, {}}\)], "Output"] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[ \(branchStateList[3, 3, dropLast]@{{1}, {1, 2}}\)], "Input"], Cell[BoxData[ \({{{{1}, {{{1\/9, {1, 1}}, {{{1}, {1}}, {{1, 1}, {2}}}}, {{2\/9, {1, 2}}, {{{1}, {1}}, {{1, 1}, {2}}, {{1, 2}, {3}}}}, {{2\/9, {1, 3}}, {{{1}, {1}}, {{1, 1}, {2}}, {{1, 3}, {4}}}}, {{1\/9, {2, 2}}, {{{1}, {1}}, {{1, 2}, {3}}}}, {{2\/9, {2, 3}}, {{{1}, {1}}, {{1, 2}, {3}}, {{1, 3}, {4}}}}, {{1\/9, {3, 3}}, {{{1}, {1}}, {{1, 3}, {4}}}}}}, {{1, 2}, {{{1\/3, {1}}, {{{1, 2}, {3}}}}, {{1\/3, {2}}, {{{1, 2}, {3}}}}, {{1\/3, {3}}, {{{1, 2}, {3}}}}}}}, {{1}, {1, 1}, {1, 2}, {1, 3}}}\)], "Output"] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[ \(branchStateList[3, 3, takeLast]@{{1}, {1, 2}}\)], "Input"], Cell[BoxData[ \({{{{1}, {{{1\/9, {1, 1}}, {{{1, 1, 1}, {1}}}}, {{2\/9, {1, 2}}, {{{1, 1, 2}, {2}}}}, {{2\/9, {1, 3}}, {{{1, 1, 3}, {3}}}}, {{1\/9, {2, 2}}, {{{1, 2, 2}, {4}}}}, {{2\/9, {2, 3}}, {{{1, 2, 3}, {5}}}}, {{1\/9, {3, 3}}, {{{1, 3, 3}, {6}}}}}}, {{1, 2}, {{{1\/3, {1}}, {{{1, 1, 2}, {2}}}}, {{1\/3, {2}}, {{{1, 2, 2}, {4}}}}, {{1\/3, {3}}, {{{1, 2, 3}, {5}}}}}}}, {{1, 1, 1}, {1, 1, 2}, {1, 1, 3}, {1, 2, 2}, {1, 2, 3}, {1, 3, 3}}}\)], "Output"] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[ \(branchStateList[3, 3, Identity]@{{}}\)], "Input"], Cell[BoxData[ \({{{{}, {{{1\/27, {1, 1, 1}}, {{{}, {1}}, {{1}, {2}}, {{1, 1}, {5}}, {{1, 1, 1}, {11}}}}, {{1\/9, {1, 1, 2}}, {{{}, {1}}, {{1}, {2}}, {{2}, {3}}, {{1, 1}, {5}}, {{1, 2}, {6}}, {{1, 1, 2}, {12}}}}, {{1\/9, {1, 1, 3}}, {{{}, {1}}, {{1}, {2}}, {{3}, {4}}, {{1, 1}, {5}}, {{1, 3}, {7}}, {{1, 1, 3}, {13}}}}, {{1\/9, {1, 2, 2}}, {{{}, {1}}, {{1}, {2}}, {{2}, {3}}, {{1, 2}, {6}}, {{2, 2}, {8}}, {{1, 2, 2}, {14}}}}, {{2\/9, {1, 2, 3}}, {{{}, {1}}, {{1}, {2}}, {{2}, {3}}, {{3}, {4}}, \ {{1, 2}, {6}}, {{1, 3}, {7}}, {{2, 3}, {9}}, {{1, 2, 3}, {15}}}}, {{1\/9, {1, 3, 3}}, {{{}, {1}}, {{1}, {2}}, {{3}, {4}}, {{1, 3}, {7}}, {{3, 3}, {10}}, {{1, 3, 3}, {16}}}}, {{1\/27, {2, 2, 2}}, {{{}, {1}}, {{2}, {3}}, {{2, 2}, {8}}, {{2, 2, 2}, {17}}}}, {{1\/9, {2, 2, 3}}, {{{}, {1}}, {{2}, {3}}, {{3}, {4}}, {{2, 2}, {8}}, {{2, 3}, {9}}, {{2, 2, 3}, {18}}}}, {{1\/9, {2, 3, 3}}, {{{}, {1}}, {{2}, {3}}, {{3}, {4}}, {{2, 3}, {9}}, {{3, 3}, {10}}, {{2, 3, 3}, {19}}}}, {{1\/27, {3, 3, 3}}, {{{}, {1}}, {{3}, {4}}, {{3, 3}, {10}}, {{3, 3, 3}, {20}}}}}}}, {{}, {1}, {2}, {3}, {1, 1}, {1, 2}, {1, 3}, {2, 2}, {2, 3}, {3, 3}, {1, 1, 1}, {1, 1, 2}, {1, 1, 3}, {1, 2, 2}, {1, 2, 3}, {1, 3, 3}, {2, 2, 2}, {2, 2, 3}, {2, 3, 3}, {3, 3, 3}}}\)], "Output"] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[ \(branchStateList[3, 3, Identity]@{{1, 1, 1}}\)], "Input"], Cell[BoxData[ \({{{{1, 1, 1}, {{{1, {}}, {{{1, 1, 1}, {1}}}}}}}, {{1, 1, 1}}}\)], "Output"] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[ \(branchStateList[3, 3, takeLast]@{}\)], "Input"], Cell[BoxData[ \({{}, {}}\)], "Output"] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[ \(branchStateList[1, 2, Identity]@{{}}\)], "Input"], Cell[BoxData[ \({{{{}, {{{1\/2, {1}}, {{{}, {1}}, {{1}, {2}}}}, {{1\/2, {2}}, {{{}, \ {1}}, {{2}, {3}}}}}}}, {{}, {1}, {2}}}\)], "Output"] }, Open ]] }, Open ]], Cell[CellGroupData[{ Cell["Cr\[EAcute]er un niveau", "Subsection", CellTags->"c:35"], Cell[CellGroupData[{ Cell[BoxData[{ \({d = 2, f = 2}; allow = Identity; fateTree1 = {_, {0, {{}, {1}, {1, 2}}}}; j1 = fateTree1[\([\(-1\), 1]\)]\), "\[IndentingNewLine]", \(stateList = fateTree1[\([\(-1\), \(-1\)]\)]\)}], "Input"], Cell[BoxData[ \(0\)], "Output"], Cell[BoxData[ \({{}, {1}, {1, 2}}\)], "Output"] }, Open ]], Cell["Les \[EAcute]tats vifs sont exactement les \[EAcute]tats non pleins.", \ "Text"], Cell[CellGroupData[{ Cell[BoxData[ \(branchStateList[d, f, allow]@ DeleteCases[stateList, Table[_, {d}]]\)], "Input"], Cell[BoxData[ \({{{{}, {{{1\/4, {1, 1}}, {{{}, {1}}, {{1}, {2}}, {{1, 1}, {4}}}}, {{1\/2, {1, 2}}, {{{}, {1}}, {{1}, {2}}, {{2}, {3}}, {{1, 2}, {5}}}}, {{1\/4, {2, 2}}, {{{}, {1}}, {{2}, {3}}, {{2, 2}, {6}}}}}}, {{1}, {{{1\/2, {1}}, {{{1}, {2}}, {{1, 1}, {4}}}}, {{1\/2, {2}}, {{{1}, {2}}, {{1, 2}, {5}}}}}}}, {{}, {1}, {2}, {1, 1}, {1, 2}, {2, 2}}}\)], "Output"] }, Open ]], Cell["\<\ {{{\[EAcute]tat vif\[Ellipsis]}\[Ellipsis]}, {\[EAcute]tats morts}}\ \ \>", "Text"], Cell[CellGroupData[{ Cell[BoxData[ \(MapAt[{#, Cases[stateList, Table[_, {d}]]} &, branchStateList[d, f, allow]@DeleteCases[stateList, Table[_, {d}]], 1]\)], "Input"], Cell[BoxData[ \({{{{{}, {{{1\/4, {1, 1}}, {{{}, {1}}, {{1}, {2}}, {{1, 1}, {4}}}}, {{1\/2, {1, 2}}, {{{}, {1}}, {{1}, {2}}, {{2}, {3}}, {{1, 2}, {5}}}}, {{1\/4, {2, 2}}, {{{}, {1}}, {{2}, {3}}, {{2, 2}, {6}}}}}}, {{1}, {{{1\/2, {1}}, {{{1}, {2}}, {{1, 1}, {4}}}}, {{1\/2, {2}}, {{{1}, {2}}, {{1, 2}, {5}}}}}}}, {{1, 2}}}, {{}, {1}, {2}, {1, 1}, {1, 2}, {2, 2}}}\)], "Output"] }, Open ]], Cell["Arbre du destin accru d'un niveau.", "Text"], Cell[CellGroupData[{ Cell[BoxData[ \(Join[dropLast@fateTree1, Transpose@{{j1, j1 + 1}, \[IndentingNewLine]MapAt[{#, Cases[stateList, Table[_, {d}]]} &, branchStateList[d, f, allow]@ DeleteCases[stateList, Table[_, {d}]], 1]\[IndentingNewLine]}]\)], "Input"], Cell[BoxData[ \({_, {0, {{{{}, {{{1\/4, {1, 1}}, {{{}, {1}}, {{1}, {2}}, {{1, 1}, {4}}}}, {{1\/2, {1, 2}}, {{{}, {1}}, {{1}, {2}}, {{2}, {3}}, {{1, 2}, {5}}}}, {{1\/4, {2, 2}}, {{{}, {1}}, {{2}, {3}}, {{2, 2}, {6}}}}}}, {{1}, {{{1\/2, {1}}, {{{1}, {2}}, {{1, 1}, {4}}}}, {{1\/2, {2}}, {{{1}, {2}}, {{1, 2}, {5}}}}}}}, {{1, 2}}}}, {1, {{}, {1}, {2}, {1, 1}, {1, 2}, {2, 2}}}}\)], "Output"] }, Open ]], Cell[BoxData[ \(\({d, f, fateTree1, allow, j1, stateList} =. ;\)\)], "Input"], Cell[BoxData[ \(Clear@branchFateTree; branchFateTree[d_Integer, f_, allow_]@fateTree1_List := With[{j1 = fateTree1[\([\(-1\), 1]\)], stateList = fateTree1[\([\(-1\), \(-1\)]\)]}, \[IndentingNewLine]Join[ dropLast@fateTree1, Transpose@{{j1, j1 + 1}, MapAt[List[#, Cases[stateList, Table[_, {d}]]] &, branchStateList[d, f, allow]@ DeleteCases[stateList, Table[_, {d}]], 1]\[IndentingNewLine]}]\[IndentingNewLine]]\)], "Input", InitializationCell->True], Cell[CellGroupData[{ Cell[BoxData[ \(branchFateTree[1, 1, Identity]@{_, {0, {{}}}}\)], "Input"], Cell[BoxData[ \({_, {0, {{{{}, {{{1, {1}}, {{{}, {1}}, {{1}, {2}}}}}}}, {}}}, {1, {{}, \ {1}}}}\)], "Output"] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[ \(With[{d = 2}, branchFateTree[d, 2, Identity]@{_, {0, {{}, {1}, Range@d}}}]\)], "Input"], Cell[BoxData[ \({_, {0, {{{{}, {{{1\/4, {1, 1}}, {{{}, {1}}, {{1}, {2}}, {{1, 1}, {4}}}}, {{1\/2, {1, 2}}, {{{}, {1}}, {{1}, {2}}, {{2}, {3}}, {{1, 2}, {5}}}}, {{1\/4, {2, 2}}, {{{}, {1}}, {{2}, {3}}, {{2, 2}, {6}}}}}}, {{1}, {{{1\/2, {1}}, {{{1}, {2}}, {{1, 1}, {4}}}}, {{1\/2, {2}}, {{{1}, {2}}, {{1, 2}, {5}}}}}}}, {{1, 2}}}}, {1, {{}, {1}, {2}, {1, 1}, {1, 2}, {2, 2}}}}\)], "Output"] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[ \(branchFateTree[2, 2, Identity]@%\)], "Input"], Cell[BoxData[ \({_, {0, {{{{}, {{{1\/4, {1, 1}}, {{{}, {1}}, {{1}, {2}}, {{1, 1}, {4}}}}, {{1\/2, {1, 2}}, {{{}, {1}}, {{1}, {2}}, {{2}, {3}}, {{1, 2}, {5}}}}, {{1\/4, {2, 2}}, {{{}, {1}}, {{2}, {3}}, {{2, 2}, {6}}}}}}, {{1}, {{{1\/2, {1}}, {{{1}, {2}}, {{1, 1}, {4}}}}, {{1\/2, {2}}, {{{1}, {2}}, {{1, 2}, {5}}}}}}}, {{1, 2}}}}, {1, {{{{}, {{{1\/4, {1, 1}}, {{{}, {1}}, {{1}, {2}}, {{1, 1}, {4}}}}, {{1\/2, {1, 2}}, {{{}, {1}}, {{1}, {2}}, {{2}, {3}}, {{1, 2}, {5}}}}, {{1\/4, {2, 2}}, {{{}, {1}}, {{2}, {3}}, {{2, 2}, {6}}}}}}, {{1}, {{{1\/2, {1}}, {{{1}, {2}}, {{1, 1}, {4}}}}, {{1\/2, {2}}, {{{1}, {2}}, {{1, 2}, {5}}}}}}, {{2}, {{{1\/2, {1}}, {{{2}, {3}}, {{1, 2}, {5}}}}, {{1\/2, {2}}, {{{2}, {3}}, {{2, 2}, {6}}}}}}}, {{1, 1}, {1, 2}, {2, 2}}}}, {2, {{}, {1}, {2}, {1, 1}, {1, 2}, {2, 2}}}}\)], "Output"] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[ \(branchFateTree[1, 1, Identity]@{_, {0, {{}}}}\)], "Input"], Cell[BoxData[ \({_, {0, {{{{}, {{{1, {1}}, {{{}, {1}}, {{1}, {2}}}}}}}, {}}}, {1, {{}, \ {1}}}}\)], "Output"] }, Open ]] }, Open ]], Cell[CellGroupData[{ Cell["R\[EAcute]currence sur les niveaux", "Subsection", CellTags->"c:36"], Cell[CellGroupData[{ Cell[BoxData[ \({d = 2, f = 2, j = 3}; allow = Identity; branchFateTree[d, f, allow]@{{0, {{}}}}\)], "Input"], Cell[BoxData[ \({{0, {{{{}, {{{1\/4, {1, 1}}, {{{}, {1}}, {{1}, {2}}, {{1, 1}, {4}}}}, {{1\/2, {1, 2}}, {{{}, {1}}, {{1}, {2}}, {{2}, {3}}, {{1, 2}, {5}}}}, {{1\/4, {2, 2}}, {{{}, {1}}, {{2}, {3}}, {{2, 2}, {6}}}}}}}, {}}}, {1, {{}, {1}, {2}, {1, 1}, {1, 2}, {2, 2}}}}\)], "Output"] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[ \(Fold[branchFateTree[d, f, #2]@#1 &, {{0, {{}}}}, Join[Table[allow, {j - 1}], {takeLast, takeLast}]]\)], "Input"], Cell[BoxData[ \({{0, {{{{}, {{{1\/4, {1, 1}}, {{{}, {1}}, {{1}, {2}}, {{1, 1}, {4}}}}, {{1\/2, {1, 2}}, {{{}, {1}}, {{1}, {2}}, {{2}, {3}}, {{1, 2}, {5}}}}, {{1\/4, {2, 2}}, {{{}, {1}}, {{2}, {3}}, {{2, 2}, {6}}}}}}}, {}}}, {1, {{{{}, {{{1\/4, {1, 1}}, {{{}, {1}}, {{1}, {2}}, {{1, 1}, {4}}}}, {{1\/2, {1, 2}}, {{{}, {1}}, {{1}, {2}}, {{2}, {3}}, {{1, 2}, {5}}}}, {{1\/4, {2, 2}}, {{{}, {1}}, {{2}, {3}}, {{2, 2}, {6}}}}}}, {{1}, {{{1\/2, {1}}, {{{1}, {2}}, {{1, 1}, {4}}}}, {{1\/2, {2}}, {{{1}, {2}}, {{1, 2}, {5}}}}}}, {{2}, {{{1\/2, {1}}, {{{2}, {3}}, {{1, 2}, {5}}}}, {{1\/2, {2}}, {{{2}, {3}}, {{2, 2}, {6}}}}}}}, {{1, 1}, {1, 2}, {2, 2}}}}, {2, {{{{}, {{{1\/4, {1, 1}}, {{{1, 1}, {1}}}}, {{1\/2, {1, 2}}, {{{1, 2}, {2}}}}, {{1\/4, {2, 2}}, {{{2, 2}, {3}}}}}}, {{1}, {{{1\/2, {1}}, {{{1, 1}, {1}}}}, {{1\/2, {2}}, {{{1, 2}, {2}}}}}}, {{2}, {{{1\/2, {1}}, {{{1, 2}, {2}}}}, {{1\/2, {2}}, {{{2, 2}, {3}}}}}}}, {{1, 1}, {1, 2}, {2, 2}}}}, {3, {{}, {{1, 1}, {1, 2}, {2, 2}}}}, {4, {}}}\)], "Output"] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[ \(fateTree1 = dropLast@Fold[branchFateTree[d, f, #2]@#1 &, {{0, {{}}}}, Join[Table[allow, {j - 1}], {takeLast, takeLast}]]\)], "Input"], Cell[BoxData[ \({{0, {{{{}, {{{1\/4, {1, 1}}, {{{}, {1}}, {{1}, {2}}, {{1, 1}, {4}}}}, {{1\/2, {1, 2}}, {{{}, {1}}, {{1}, {2}}, {{2}, {3}}, {{1, 2}, {5}}}}, {{1\/4, {2, 2}}, {{{}, {1}}, {{2}, {3}}, {{2, 2}, {6}}}}}}}, {}}}, {1, {{{{}, {{{1\/4, {1, 1}}, {{{}, {1}}, {{1}, {2}}, {{1, 1}, {4}}}}, {{1\/2, {1, 2}}, {{{}, {1}}, {{1}, {2}}, {{2}, {3}}, {{1, 2}, {5}}}}, {{1\/4, {2, 2}}, {{{}, {1}}, {{2}, {3}}, {{2, 2}, {6}}}}}}, {{1}, {{{1\/2, {1}}, {{{1}, {2}}, {{1, 1}, {4}}}}, {{1\/2, {2}}, {{{1}, {2}}, {{1, 2}, {5}}}}}}, {{2}, {{{1\/2, {1}}, {{{2}, {3}}, {{1, 2}, {5}}}}, {{1\/2, {2}}, {{{2}, {3}}, {{2, 2}, {6}}}}}}}, {{1, 1}, {1, 2}, {2, 2}}}}, {2, {{{{}, {{{1\/4, {1, 1}}, {{{1, 1}, {1}}}}, {{1\/2, {1, 2}}, {{{1, 2}, {2}}}}, {{1\/4, {2, 2}}, {{{2, 2}, {3}}}}}}, {{1}, {{{1\/2, {1}}, {{{1, 1}, {1}}}}, {{1\/2, {2}}, {{{1, 2}, {2}}}}}}, {{2}, {{{1\/2, {1}}, {{{1, 2}, {2}}}}, {{1\/2, {2}}, {{{2, 2}, {3}}}}}}}, {{1, 1}, {1, 2}, {2, 2}}}}, {3, {{}, {{1, 1}, {1, 2}, {2, 2}}}}}\)], "Output"] }, Open ]], Cell[BoxData[ \(\({d, f, j, allow, fateTree1} =. ;\)\)], "Input"], Cell[BoxData[{ \(\(Clear@fateTree;\)\), "\n", \(fateTree[player_, d_, f_, j_Integer] := \[IndentingNewLine]dropLast@ Fold[branchFateTree[d, f, #2]@#1 &, {{0, {{}}}}, Join[\[IndentingNewLine]Switch[player, \[IndentingNewLine]"\", Table[Identity, {j - 1}], \[IndentingNewLine]"\", Table[dropLast, {j - 1}]], {takeLast, takeLast}]]\)}], "Input", InitializationCell->True], Cell[CellGroupData[{ Cell[BoxData[ \(fateTree["\", 2, 2, 3]\)], "Input"], Cell[BoxData[ \({{0, {{{{}, {{{1\/4, {1, 1}}, {{{}, {1}}, {{1}, {2}}, {{1, 1}, {4}}}}, {{1\/2, {1, 2}}, {{{}, {1}}, {{1}, {2}}, {{2}, {3}}, {{1, 2}, {5}}}}, {{1\/4, {2, 2}}, {{{}, {1}}, {{2}, {3}}, {{2, 2}, {6}}}}}}}, {}}}, {1, {{{{}, {{{1\/4, {1, 1}}, {{{}, {1}}, {{1}, {2}}, {{1, 1}, {4}}}}, {{1\/2, {1, 2}}, {{{}, {1}}, {{1}, {2}}, {{2}, {3}}, {{1, 2}, {5}}}}, {{1\/4, {2, 2}}, {{{}, {1}}, {{2}, {3}}, {{2, 2}, {6}}}}}}, {{1}, {{{1\/2, {1}}, {{{1}, {2}}, {{1, 1}, {4}}}}, {{1\/2, {2}}, {{{1}, {2}}, {{1, 2}, {5}}}}}}, {{2}, {{{1\/2, {1}}, {{{2}, {3}}, {{1, 2}, {5}}}}, {{1\/2, {2}}, {{{2}, {3}}, {{2, 2}, {6}}}}}}}, {{1, 1}, {1, 2}, {2, 2}}}}, {2, {{{{}, {{{1\/4, {1, 1}}, {{{1, 1}, {1}}}}, {{1\/2, {1, 2}}, {{{1, 2}, {2}}}}, {{1\/4, {2, 2}}, {{{2, 2}, {3}}}}}}, {{1}, {{{1\/2, {1}}, {{{1, 1}, {1}}}}, {{1\/2, {2}}, {{{1, 2}, {2}}}}}}, {{2}, {{{1\/2, {1}}, {{{1, 2}, {2}}}}, {{1\/2, {2}}, {{{2, 2}, {3}}}}}}}, {{1, 1}, {1, 2}, {2, 2}}}}, {3, {{}, {{1, 1}, {1, 2}, {2, 2}}}}}\)], "Output"] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[ \(fateTree["\", 0, 2, 3]\)], "Input"], Cell[BoxData[ \({{0, {{}, {{}}}}, {1, {{}, {}}}, {2, {{}, {}}}, {3, {{}, {}}}}\)], \ "Output"] }, Open ]], Cell["\<\ Le pointage r\[EAcute]duit la taille de l'arbre du destin mais emp\ \[EHat]che de distinguer les destins qui passent simultan\[EAcute]ment par un \ m\[EHat]me \[EAcute]tat. L'utilit\[EAcute] ne peut d\[EAcute]pendre du pass\ \[EAcute] strict.\ \>", "Text"], Cell[CellGroupData[{ Cell["Cas normal", "Outline2", FontWeight->"Bold"], Cell[CellGroupData[{ Cell[BoxData[ \({d = 3, f = 6, j = 3}; Timing@\(ByteCount@fateTree["\", d, f, j]\)\)], "Input"], Cell[BoxData[ \({0.269999999999996`\ Second, 316492}\)], "Output"] }, Open ]], Cell["PPC G4 1000 MHz {0.27 Second, 316492}", "Text"], Cell[CellGroupData[{ Cell[BoxData[ \(Timing@\(ByteCount@fateTree["\", d, f, j]\)\)], "Input"], Cell[BoxData[ \({0.259999999999998`\ Second, 263732}\)], "Output"] }, Open ]], Cell["1000 MHz {0.23 Second, 263732}", "Text"], Cell[BoxData[ \(\({d =. , f =. , j =. };\)\)], "Input"] }, Open ]] }, Open ]] }, Open ]], Cell[CellGroupData[{ Cell["Utilit\[EAcute] et strat\[EAcute]gie", "Section", CellTags->"c:37"], Cell[CellGroupData[{ Cell["S\[EAcute]parer utilit\[EAcute] et strat\[EAcute]gie", "Subsection", CellTags->{"section4", "c:38"}], Cell["\<\ \[WarningSign] Pr\[EAcute]conditionnement : assurer qu'initialement \ il n'y a que l'\[EAcute]tat vide.\ \>", "Text"], Cell[BoxData[{ \(\(Clear@dropStrategy;\)\), "\[IndentingNewLine]", \(\(dropStrategy@utilityAndStrategy1_List := utilityAndStrategy1[\([1, \(-1\), 1, 1, \(-1\), 1]\)];\)\)}], "Input",\ InitializationCell->True], Cell[BoxData[ \(\(utilityAndStrategy1 = {{0, {{{{}, {\(-7\), {{{1, 1}, {{{1, 1}, {4}}}}, {{1, 2}, {{{1, 2}, {5}}}}, {{2, 2}, {{{2, 2}, {6}}}}}}}}, {}}}, {1, {{{{}, {\(-17\), \ {{{1, 1}, {{{1, 1}, {1}}}}, {{1, 2}, {{{1, 2}, {2}}}}, {{2, 2}, {{{2, 2}, {3}}}}}}}, {{1}, {\(-\(35\/2\)\), {{{1}, \ {{{1, 1}, {1}}}}, {{2}, {{{1, 2}, {2}}}}}}}, {{2}, {\(-\(33\/2\)\), {{{1}, \ {{{1, 2}, {2}}}}, {{2}, {{{2, 2}, {3}}}}}}}}, {{{1, 1}, {\(-8\), {}}}, {{1, 2}, {\(-7\), {}}}, {{2, 2}, {\(-6\), {}}}}}}, {2, {{}, {{{1, 1}, {\(-18\), {}}}, {{1, 2}, {\(-17\), {}}}, {{2, 2}, {\(-16\), {}}}}}}};\)\)], "Input"], Cell[CellGroupData[{ Cell[BoxData[ \(dropStrategy@utilityAndStrategy1\)], "Input"], Cell[BoxData[ \(\(-7\)\)], "Output"] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[ \(\(MapAt[Map[MapAt[function1, #, \(-1\)] &, #, {2}] &, #, \(-1\)] &\) /@ utilityAndStrategy1\)], "Input"], Cell[BoxData[ \({{0, {{{{}, function1[{\(-7\), {{{1, 1}, {{{1, 1}, {4}}}}, {{1, 2}, {{{1, 2}, {5}}}}, {{2, 2}, {{{2, 2}, {6}}}}}}]}}, {}}}, {1, {{{{}, function1[{\(-17\), {{{1, 1}, {{{1, 1}, {1}}}}, {{1, 2}, {{{1, 2}, {2}}}}, {{2, 2}, {{{2, 2}, {3}}}}}}]}, {{1}, function1[{\(-\(35\/2\)\), {{{1}, {{{1, 1}, {1}}}}, {{2}, {{{1, 2}, {2}}}}}}]}, {{2}, function1[{\(-\(33\/2\)\), {{{1}, {{{1, 2}, {2}}}}, {{2}, {{{2, 2}, {3}}}}}}]}}, {{{1, 1}, function1[{\(-8\), {}}]}, {{1, 2}, function1[{\(-7\), {}}]}, {{2, 2}, function1[{\(-6\), {}}]}}}}, {2, {{}, {{{1, 1}, function1[{\(-18\), {}}]}, {{1, 2}, function1[{\(-17\), {}}]}, {{2, 2}, function1[{\(-16\), {}}]}}}}}\)], "Output"] }, Open ]], Cell["Effacer l'utilit\[EAcute]. ", "Text"], Cell[CellGroupData[{ Cell[BoxData[ \(\(MapAt[Map[MapAt[Last, #, \(-1\)] &, #, {2}] &, #, \(-1\)] &\) /@ utilityAndStrategy1\)], "Input"], Cell[BoxData[ \({{0, {{{{}, {{{1, 1}, {{{1, 1}, {4}}}}, {{1, 2}, {{{1, 2}, {5}}}}, {{2, 2}, {{{2, 2}, {6}}}}}}}, {}}}, {1, {{{{}, {{{1, 1}, {{{1, 1}, {1}}}}, {{1, 2}, {{{1, 2}, {2}}}}, {{2, 2}, {{{2, 2}, {3}}}}}}, {{1}, {{{1}, {{{1, 1}, {1}}}}, {{2}, {{{1, 2}, {2}}}}}}, {{2}, {{{1}, {{{1, 2}, {2}}}}, {{2}, {{{2, 2}, {3}}}}}}}, {{{1, 1}, {}}, {{1, 2}, {}}, {{2, 2}, {}}}}}, {2, {{}, {{{1, 1}, {}}, {{1, 2}, {}}, {{2, 2}, {}}}}}}\)], "Output"] }, Open ]], Cell[BoxData[ \(Clear@dropUtility; dropUtility@ utilityAndStrategy1_List := \(MapAt[ Map[MapAt[Last, #, \(-1\)] &, #, {2}] &, #, \(-1\)] &\) /@ utilityAndStrategy1;\)], "Input", InitializationCell->True], Cell[CellGroupData[{ Cell[BoxData[ \(dropUtility@utilityAndStrategy1\)], "Input"], Cell[BoxData[ \({{0, {{{{}, {{{1, 1}, {{{1, 1}, {4}}}}, {{1, 2}, {{{1, 2}, {5}}}}, {{2, 2}, {{{2, 2}, {6}}}}}}}, {}}}, {1, {{{{}, {{{1, 1}, {{{1, 1}, {1}}}}, {{1, 2}, {{{1, 2}, {2}}}}, {{2, 2}, {{{2, 2}, {3}}}}}}, {{1}, {{{1}, {{{1, 1}, {1}}}}, {{2}, {{{1, 2}, {2}}}}}}, {{2}, {{{1}, {{{1, 2}, {2}}}}, {{2}, {{{2, 2}, {3}}}}}}}, {{{1, 1}, {}}, {{1, 2}, {}}, {{2, 2}, {}}}}}, {2, {{}, {{{1, 1}, {}}, {{1, 2}, {}}, {{2, 2}, {}}}}}}\)], "Output"] }, Open ]], Cell[BoxData[ \(\(utilityAndStrategy1 =. ;\)\)], "Input"] }, Open ]], Cell[CellGroupData[{ Cell["Purifier une strat\[EAcute]gie", "Subsection", CellTags->"c:39"], Cell["Une strat\[EAcute]gie non pure (choix multiple \[EAcute]quiprobable).", \ "Text"], Cell[BoxData[ RowBox[{ RowBox[{"strategy", "=", RowBox[{"{", RowBox[{ RowBox[{"{", RowBox[{"0", ",", RowBox[{"{", RowBox[{ RowBox[{"{", RowBox[{"{", RowBox[{\({}\), ",", RowBox[{"{", RowBox[{ RowBox[{"{", RowBox[{\({1, 1}\), ",", StyleBox[\({{{}, {1}}, {{1}, {2}}}\), FontColor->RGBColor[1, 0, 0]]}], "}"}], ",", \({{1, 2}, {{{1, 2}, {5}}}}\), ",", \({{2, 2}, {{{}, {1}}, {{2}, {3}}}}\)}], "}"}]}], "}"}], "}"}], ",", \({}\)}], "}"}]}], "}"}], ",", \({1, {{{{}, {{{1, 1}, {{{1, 1}, {1}}}}, {{1, 2}, {{{1, 2}, {2}}}}, {{2, 2}, {{{2, 2}, {3}}}}}}, {{1}, {{{1}, {{{1, 1}, {1}}}}, {{2}, {{{1, 2}, {2}}}}}}, {{2}, {{{1}, {{{1, 2}, {2}}}}, {{2}, {{{2, 2}, {3}}}}}}}, {{{1, 1}, {}}, {{1, 2}, {}}, {{2, 2}, {}}}}}\), ",", \({2, {{}, {{{1, 1}, {}}, {{1, 2}, {}}, {{2, 2}, {}}}}}\)}], "}"}]}], ";"}]], "Input"], Cell["\<\ Conserver la strat\[EAcute]gie pure premi\[EGrave]re dans l'ordre \ lexicographique.\ \>", "Text"], Cell[CellGroupData[{ Cell[BoxData[ \(\(MapAt[\(MapAt[\(MapAt[ function1, #, \(-1\)] &\) /@ # &, #, \(-1\)] &\) /@ \ # &, #, {\(-1\), 1}] &\) /@ strategy\)], "Input"], Cell[BoxData[ \({{0, {{{{}, {{{1, 1}, function1[{{{}, {1}}, {{1}, {2}}}]}, {{1, 2}, function1[{{{1, 2}, {5}}}]}, {{2, 2}, function1[{{{}, {1}}, {{2}, {3}}}]}}}}, {}}}, {1, {{{{}, \ {{{1, 1}, function1[{{{1, 1}, {1}}}]}, {{1, 2}, function1[{{{1, 2}, {2}}}]}, {{2, 2}, function1[{{{2, 2}, {3}}}]}}}, {{1}, {{{1}, function1[{{{1, 1}, {1}}}]}, {{2}, function1[{{{1, 2}, {2}}}]}}}, {{2}, {{{1}, function1[{{{1, 2}, {2}}}]}, {{2}, function1[{{{2, 2}, {3}}}]}}}}, {{{1, 1}, {}}, {{1, 2}, {}}, {{2, 2}, {}}}}}, {2, {{}, {{{1, 1}, {}}, {{1, 2}, {}}, {{2, 2}, {}}}}}}\)], "Output"] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[ \(\(MapAt[\(MapAt[\(MapAt[ Take[#, 1] &, #, \(-1\)] &\) /@ # &, #, \(-1\)] &\) /@ \ # &, #, {\(-1\), 1}] &\) /@ strategy\)], "Input"], Cell[BoxData[ \({{0, {{{{}, {{{1, 1}, {{{}, {1}}}}, {{1, 2}, {{{1, 2}, {5}}}}, {{2, 2}, {{{}, {1}}}}}}}, {}}}, {1, {{{{}, {{{1, 1}, {{{1, 1}, {1}}}}, {{1, 2}, {{{1, 2}, {2}}}}, {{2, 2}, {{{2, 2}, {3}}}}}}, {{1}, {{{1}, {{{1, 1}, {1}}}}, {{2}, {{{1, 2}, {2}}}}}}, {{2}, {{{1}, {{{1, 2}, {2}}}}, {{2}, {{{2, 2}, {3}}}}}}}, {{{1, 1}, {}}, {{1, 2}, {}}, {{2, 2}, {}}}}}, {2, {{}, {{{1, 1}, {}}, {{1, 2}, {}}, {{2, 2}, {}}}}}}\)], "Output"] }, Open ]], Cell["\<\ \[WarningSign] Option avec ordre lexicographique inverse.\ \>", \ "Text"], Cell[BoxData[ \(\(purify = \(MapAt[\(MapAt[\(MapAt[ Take[#, 1] &, #, \(-1\)] &\) /@ # &, #, \(-1\)] &\ \) /@ # &, #, {\(-1\), 1}] &\) /@ # &;\)\)], "Input", InitializationCell->True], Cell[CellGroupData[{ Cell[BoxData[ \(purify@strategy\)], "Input"], Cell[BoxData[ \({{0, {{{{}, {{{1, 1}, {{{}, {1}}}}, {{1, 2}, {{{1, 2}, {5}}}}, {{2, 2}, {{{}, {1}}}}}}}, {}}}, {1, {{{{}, {{{1, 1}, {{{1, 1}, {1}}}}, {{1, 2}, {{{1, 2}, {2}}}}, {{2, 2}, {{{2, 2}, {3}}}}}}, {{1}, {{{1}, {{{1, 1}, {1}}}}, {{2}, {{{1, 2}, {2}}}}}}, {{2}, {{{1}, {{{1, 2}, {2}}}}, {{2}, {{{2, 2}, {3}}}}}}}, {{{1, 1}, {}}, {{1, 2}, {}}, {{2, 2}, {}}}}}, {2, {{}, {{{1, 1}, {}}, {{1, 2}, {}}, {{2, 2}, {}}}}}}\)], "Output"] }, Open ]], Cell[BoxData[ \(\(strategy =. ;\)\)], "Input"] }, Open ]], Cell[CellGroupData[{ Cell["\[CapitalEAcute]laguer un arbre du destin selon une fonction d'utilit\ \[EAcute]", "Subsection", CellTags->"c:40"], Cell["\[CapitalEAcute]liminer les strat\[EAcute]gies les moins utiles.", \ "Text"], Cell[TextData[{ "D\[EAcute]f. : \[AGrave] une certaine date, un \[EAcute]tat plein est ", StyleBox["vain", FontSlant->"Italic"], " si tous les autres \[EAcute]tats pleins \[AGrave] la m\[EHat]me date sont \ plus utiles que lui ; un \[EAcute]tat non plein est vain si tous ses sur-\ \[EAcute]tats pleins dans un futur strict son vains." }], "Text"], Cell["\<\ Un \[EAcute]tat vain maintenant est forc\[EAcute]ment vain plus \ tard. Mais un \[EAcute]tat non vain maintenant peut devenir vain plus tard \ (apr\[EGrave]s que toutes les occasions ont \[EAcute]t\[EAcute] \ manqu\[EAcute]es).\ \>", "Text"], Cell[BoxData[{ \(\({d = 2, f = 4, j = 3};\)\), "\n", \(\(utility = If[Last@#2 - First@#2 \[LessEqual] j - #1, #1, \(-#1\)] &;\)\)}], "Input"], Cell[CellGroupData[{ Cell[BoxData[ \(\(Table[utility[j1, #], {j1, 3}] &\) /@ {{1, 4}, {1, 3}, {1, 2}, {1, 1}}\)], "Input"], Cell[BoxData[ \({{\(-1\), \(-2\), \(-3\)}, {1, \(-2\), \(-3\)}, {1, 2, \(-3\)}, {1, 2, 3}}\)], "Output"] }, Open ]], Cell[TextData[{ "\[Lambda]-calcul pour ne pas introduire un ", StyleBox["j2", "Output"], "." }], "Text"], Cell[CellGroupData[{ Cell[BoxData[ \(minUtilities = Min /@ Outer[utility, Range@j, allCombinations[d, f], 1]\)], "Input"], Cell[BoxData[ \({\(-1\), \(-2\), \(-3\)}\)], "Output"] }, Open ]], Cell["Sur-combinaisons pleines.", "Text"], Cell[CellGroupData[{ Cell[BoxData[ \(j1 = 1; state = {1}; Last /@ \(Last /@ branchState[d, f, Identity]@state\)\)], "Input"], Cell[BoxData[ \({{1, 1}, {1, 2}, {1, 3}, {1, 4}}\)], "Output"] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[ \(\(Sort@Join[state, #] &\) /@ allCombinations[d - Length@state, f]\)], "Input"], Cell[BoxData[ \({{1, 1}, {1, 2}, {1, 3}, {1, 4}}\)], "Output"] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[ \(zoomTiming[ Last /@ \(Last /@ branchState[d, f, Identity]@state\), \(Sort@Join[state, #] &\) /@ allCombinations[d - Length@state, f], 1000]\)], "Input"], Cell[BoxData[ \({0.7800000000000011`\ Second, 0.14999999999999858`\ Second}\)], "Output"] }, Open ]], Cell[BoxData[ \(\(utility =. ;\)\)], "Input"], Cell[CellGroupData[{ Cell[BoxData[ \(Apply[ Or, \(With[{state1 = #}, \[IndentingNewLine]Apply[ Or, \(utility[#, state1] > minUtilities[\([#]\)] &\) /@ Range[j1 + 1, j]]\[IndentingNewLine]] &\) /@ \((\(Sort@ Join[state, #] &\) /@ allCombinations[d - Length@state, f])\)]\)], "Input"], Cell[BoxData[ \(utility[2, {1, 1}] > \(-2\) || utility[3, {1, 1}] > \(-3\) || utility[2, {1, 2}] > \(-2\) || utility[3, {1, 2}] > \(-3\) || utility[2, {1, 3}] > \(-2\) || utility[3, {1, 3}] > \(-3\) || utility[2, {1, 4}] > \(-2\) || utility[3, {1, 4}] > \(-3\)\)], "Output"] }, Open ]], Cell[BoxData[ \(\({d, f, j, j1, state} =. ;\)\)], "Input"], Cell[BoxData[{ \(\(Clear@notVainQ;\)\), "\[IndentingNewLine]", \(notVainQ[d_Integer, f_, j_Integer, j1_Integer, utility_]@state_List := With[{minUtilities = Min /@ Outer[utility, Range@j, allCombinations[d, f], 1]}, \[IndentingNewLine]Switch[ Length@state, \[IndentingNewLine]d, utility[j1, state] > minUtilities[\([j1]\)], \[IndentingNewLine]_, Apply[Or, \(With[{state1 = #}, \[IndentingNewLine]Apply[ Or, \(utility[#, state1] > minUtilities[\([#]\)] &\) /@ Range[j1 + 1, j]]\[IndentingNewLine]] &\) /@ \((\(Sort@ Join[state, #] &\) /@ allCombinations[d - Length@state, f])\)]\[IndentingNewLine]]\[IndentingNewLine]]\)}], \ "Input", InitializationCell->True], Cell[BoxData[{ \(\({d = 2, f = 4, j = 3};\)\), "\n", \(\(utility = With[{j1 = #1, state = #2}, If[Last@state - First@state \[LessEqual] j - j1, j1, \(-j1\)]] &;\)\)}], "Input"], Cell[CellGroupData[{ Cell[BoxData[ \(notVainQ[d, f, j, 1, utility]@{1}\)], "Input"], Cell[BoxData[ \(True\)], "Output"] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[ \(notVainQ[d, f, j, 1, utility]@{1, 3}\)], "Input"], Cell[BoxData[ \(True\)], "Output"] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[ \(Table[notVainQ[d, f, j, j1, utility]@{2, 2}, {j1, 2}]\)], "Input"], Cell[BoxData[ \({True, True}\)], "Output"] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[ \(Table[notVainQ[d, f, j, j1, utility]@{1, 2}, {j1, 2}]\)], "Input"], Cell[BoxData[ \({True, True}\)], "Output"] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[ \(Table[notVainQ[d, f, j, j1, utility]@{1, 3}, {j1, 2}]\)], "Input"], Cell[BoxData[ \({True, False}\)], "Output"] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[ \(Table[notVainQ[d, f, j, j1, utility]@{3}, {j1, 2}]\)], "Input"], Cell[BoxData[ \({True, True}\)], "Output"] }, Open ]], Cell["\<\ Filtrer les \[EAcute]tats vains, comme \[EAcute]lagage \ \[LeftGuillemet] \[Alpha]-\[Beta] \[RightGuillemet] de von Neumann.\ \>", \ "Text"], Cell[BoxData[ \(Clear@dropVain; dropVain[d_, f_, j_, j1_, utility_]@stateList_List := Select[stateList, notVainQ[d, f, j, j1, utility]]\)], "Input", InitializationCell->True], Cell[CellGroupData[{ Cell[BoxData[ \(stateList = Union[Join @@ \(Last /@ branchState[d, f, Identity]@{}\)]\)], "Input"], Cell[BoxData[ \({{}, {1}, {2}, {3}, {4}, {1, 1}, {1, 2}, {1, 3}, {1, 4}, {2, 2}, {2, 3}, {2, 4}, {3, 3}, {3, 4}, {4, 4}}\)], "Output"] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[ \(dropVain[d, f, j, 1, utility]@stateList\)], "Input"], Cell[BoxData[ \({{}, {1}, {2}, {3}, {4}, {1, 1}, {1, 2}, {1, 3}, {2, 2}, {2, 3}, {2, 4}, {3, 3}, {3, 4}, {4, 4}}\)], "Output"] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[ \(dropVain[d, f, j, 2, utility]@stateList\)], "Input"], Cell[BoxData[ \({{}, {1}, {2}, {3}, {4}, {1, 1}, {1, 2}, {2, 2}, {2, 3}, {3, 3}, {3, 4}, {4, 4}}\)], "Output"] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[ \(Fold[ branchFateTree[d, f, #2]@#1 &, {{0, {{}}}}, {dropVain[d, f, j, 1, utility], dropVain[d, f, j, 2, utility]}]\)], "Input"], Cell[BoxData[ \({{0, {{{{}, {{{1\/16, {1, 1}}, {{{}, {1}}, {{1}, {2}}, {{1, 1}, {6}}}}, {{1\/8, {1, 2}}, {{{}, {1}}, {{1}, {2}}, {{2}, {3}}, {{1, 2}, {7}}}}, {{1\/8, {1, 3}}, {{{}, {1}}, {{1}, {2}}, {{3}, {4}}, {{1, 3}, {8}}}}, {{1\/8, {1, 4}}, {{{}, {1}}, {{1}, {2}}, {{4}, {5}}}}, {{1\/16, {2, 2}}, {{{}, {1}}, {{2}, {3}}, {{2, 2}, {9}}}}, {{1\/8, {2, 3}}, {{{}, {1}}, {{2}, {3}}, {{3}, {4}}, {{2, 3}, {10}}}}, {{1\/8, {2, 4}}, {{{}, {1}}, {{2}, {3}}, {{4}, {5}}, {{2, 4}, {11}}}}, {{1\/16, {3, 3}}, {{{}, {1}}, {{3}, {4}}, {{3, 3}, {12}}}}, {{1\/8, {3, 4}}, {{{}, {1}}, {{3}, {4}}, {{4}, {5}}, {{3, 4}, {13}}}}, {{1\/16, {4, 4}}, {{{}, {1}}, {{4}, {5}}, {{4, 4}, {14}}}}}}}, {}}}, {1, {{{{}, {{{1\/16, {1, 1}}, {{{}, {1}}, {{1}, {2}}, {{1, 1}, {6}}}}, {{1\/8, {1, 2}}, {{{}, {1}}, {{1}, {2}}, {{2}, {3}}, {{1, 2}, {7}}}}, {{1\/8, {1, 3}}, {{{}, {1}}, {{1}, {2}}, {{3}, {4}}}}, {{1\/8, {1, 4}}, {{{}, {1}}, {{1}, {2}}, {{4}, {5}}}}, {{1\/16, {2, 2}}, {{{}, {1}}, {{2}, {3}}, {{2, 2}, {8}}}}, {{1\/8, {2, 3}}, {{{}, {1}}, {{2}, {3}}, {{3}, {4}}, {{2, 3}, {9}}}}, {{1\/8, {2, 4}}, {{{}, {1}}, {{2}, {3}}, {{4}, {5}}}}, {{1\/16, {3, 3}}, {{{}, {1}}, {{3}, {4}}, {{3, 3}, {10}}}}, {{1\/8, {3, 4}}, {{{}, {1}}, {{3}, {4}}, {{4}, {5}}, {{3, 4}, {11}}}}, {{1\/16, {4, 4}}, {{{}, {1}}, {{4}, {5}}, {{4, 4}, {12}}}}}}, {{1}, {{{1\/4, {1}}, {{{1}, {2}}, {{1, 1}, {6}}}}, {{1\/4, {2}}, {{{1}, {2}}, {{1, 2}, {7}}}}, {{1\/4, {3}}, {{{1}, {2}}}}, {{1\/4, \ {4}}, {{{1}, {2}}}}}}, {{2}, {{{1\/4, {1}}, {{{2}, {3}}, {{1, 2}, {7}}}}, {{1\/4, {2}}, {{{2}, {3}}, {{2, 2}, {8}}}}, {{1\/4, {3}}, {{{2}, {3}}, {{2, 3}, {9}}}}, {{1\/4, {4}}, {{{2}, {3}}}}}}, {{3}, {{{1\ \/4, {1}}, {{{3}, {4}}}}, {{1\/4, {2}}, {{{3}, {4}}, {{2, 3}, {9}}}}, {{1\/4, {3}}, {{{3}, {4}}, {{3, 3}, {10}}}}, {{1\/4, {4}}, {{{3}, {4}}, {{3, 4}, {11}}}}}}, {{4}, {{{1\/4, {1}}, {{{4}, {5}}}}, \ {{1\/4, {2}}, {{{4}, {5}}}}, {{1\/4, {3}}, {{{4}, {5}}, {{3, 4}, {11}}}}, {{1\/4, {4}}, {{{4}, {5}}, {{4, 4}, {12}}}}}}}, {{1, 1}, {1, 2}, {1, 3}, {2, 2}, {2, 3}, {2, 4}, {3, 3}, {3, 4}, {4, 4}}}}, {2, {{}, {1}, {2}, {3}, {4}, {1, 1}, {1, 2}, {2, 2}, {2, 3}, {3, 3}, {3, 4}, {4, 4}}}}\)], "Output"] }, Open ]], Cell[BoxData[ \({d =. , f =. , j =. }; stateList =. ; utility =. ;\)], "Input"], Cell[TextData[{ "Recr\[EAcute]er un arbre du destin en filtrant les \[EAcute]tats vains. \ \[WarningSign] Plut\[OHat]t que recopier la d\[EAcute]finition pr\[EAcute]c\ \[EAcute]dente de ", StyleBox["fateTree", "Output"], ", la transformer en rempla\[CCedilla]ant seulement les filtres." }], "Text"], Cell[BoxData[ \(fateTree[player_, d_, f_, j_Integer, utility_] := \[IndentingNewLine]With[{minUtilities = Min /@ Outer[utility, Range@j, allCombinations[d, f], 1]}, \[IndentingNewLine]dropLast@ Fold[branchFateTree[d, f, #2]@#1 &, {{0, {{}}}}, Join[\[IndentingNewLine]Switch[ player, \[IndentingNewLine]"\", \(Composition[ dropVain[d, f, j, #, utility], Identity] &\) /@ Range[j - 1], \[IndentingNewLine]"\", \(Composition[ dropVain[d, f, j, #, utility], dropLast] &\) /@ Range[j - 1]\[IndentingNewLine]], \[IndentingNewLine]{takeLast, takeLast}]]\[IndentingNewLine]]\)], "Input", InitializationCell->True], Cell["\<\ \[Wolf] V\[EAcute]rification : si l'utilit\[EAcute] est uniforme, \ alors tous les \[EAcute]tats sont vains.\ \>", "Text"], Cell[CellGroupData[{ Cell[BoxData[ \(fateTree["\", 2, 3, 3, 0 &]\)], "Input"], Cell[BoxData[ \({{0, {{{{}, {{{1\/9, {1, 1}}, {}}, {{2\/9, {1, 2}}, {}}, {{2\/9, {1, 3}}, {}}, {{1\/9, {2, 2}}, {}}, {{2\/9, {2, 3}}, {}}, {{1\/9, {3, 3}}, {}}}}}, {}}}, {1, {{}, {}}}, {2, {{}, {}}}, {3, \ {{}, {}}}}\)], "Output"] }, Open ]], Cell[BoxData[ RowBox[{"Notation", "[", RowBox[{ TagBox[\(\[Delta][x_, y_]\), NotationBoxTag, TagStyle->"NotationTemplateStyle"], " ", "\[DoubleLongLeftRightArrow]", " ", TagBox[\(KroneckerDelta[x_, y_]\), NotationBoxTag, TagStyle->"NotationTemplateStyle"]}], "]"}]], "Input", InitializationCell->True], Cell[CellGroupData[{ Cell[BoxData[ \(fateTree["\", 2, 3, 3, \[Delta][{1, 2}, #2] &]\)], "Input"], Cell[BoxData[ \({{0, {{{{}, {{{1\/9, {1, 1}}, {{{}, {1}}, {{1}, {2}}}}, {{2\/9, {1, 2}}, {{{}, {1}}, {{1}, {2}}, {{2}, {3}}, {{1, 2}, {4}}}}, {{2\/9, {1, 3}}, {{{}, {1}}, {{1}, {2}}}}, {{1\/9, {2, 2}}, {{{}, {1}}, {{2}, {3}}}}, {{2\/9, {2, 3}}, {{{}, {1}}, {{2}, {3}}}}, {{1\/9, {3, 3}}, {{{}, {1}}}}}}}, {}}}, {1, {{{{}, {{{1\/9, {1, 1}}, {{{}, {1}}, {{1}, {2}}}}, {{2\/9, {1, 2}}, {{{}, {1}}, {{1}, {2}}, {{2}, {3}}, {{1, 2}, {4}}}}, {{2\/9, {1, 3}}, {{{}, {1}}, {{1}, {2}}}}, {{1\/9, {2, 2}}, {{{}, {1}}, {{2}, {3}}}}, {{2\/9, {2, 3}}, {{{}, {1}}, {{2}, {3}}}}, {{1\/9, {3, 3}}, {{{}, {1}}}}}}, {{1}, {{{1\/3, {1}}, {{{1}, \ {2}}}}, {{1\/3, {2}}, {{{1}, {2}}, {{1, 2}, {4}}}}, {{1\/3, {3}}, {{{1}, {2}}}}}}, {{2}, {{{1\ \/3, {1}}, {{{2}, {3}}, {{1, 2}, {4}}}}, {{1\/3, {2}}, {{{2}, {3}}}}, {{1\/3, \ {3}}, {{{2}, {3}}}}}}}, {{1, 2}}}}, {2, {{{{}, {{{1\/9, {1, 1}}, {{{1, 1}, {1}}}}, {{2\/9, {1, 2}}, {{{1, 2}, {2}}}}, {{2\/9, {1, 3}}, {{{1, 3}, {3}}}}, {{1\/9, {2, 2}}, {{{2, 2}, {4}}}}, {{2\/9, {2, 3}}, {{{2, 3}, {5}}}}, {{1\/9, {3, 3}}, {{{3, 3}, {6}}}}}}, {{1}, {{{1\/3, {1}}, {{{1, 1}, {1}}}}, {{1\/3, {2}}, {{{1, 2}, {2}}}}, {{1\/3, {3}}, {{{1, 3}, {3}}}}}}, {{2}, {{{1\/3, {1}}, {{{1, 2}, {2}}}}, {{1\/3, {2}}, {{{2, 2}, {4}}}}, {{1\/3, {3}}, {{{2, 3}, {5}}}}}}}, {{1, 2}}}}, {3, {{}, {{1, 1}, {1, 2}, {1, 3}, {2, 2}, {2, 3}, {3, 3}}}}}\)], "Output"] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[ \(Take[ With[{j = 3}, \[IndentingNewLine]fateTree["\", 2, 3, j, If[Last@#2 - First@#2 \[LessEqual] j - #1, #1, \(-#1\)] &]\[IndentingNewLine]], 2]\)], "Input"], Cell[BoxData[ \({{0, {{{{}, {{{1\/9, {1, 1}}, {{{}, {1}}, {{1}, {2}}}}, {{2\/9, {1, 2}}, {{{}, {1}}, {{1}, {2}}, {{2}, {3}}}}, {{2\/9, {1, 3}}, {{{}, {1}}, {{1}, {2}}, {{3}, {4}}}}, {{1\/9, {2, 2}}, {{{}, {1}}, {{2}, {3}}}}, {{2\/9, {2, 3}}, {{{}, {1}}, {{2}, {3}}, {{3}, {4}}}}, {{1\/9, {3, 3}}, {{{}, {1}}, {{3}, {4}}}}}}}, {}}}, {1, {{{{}, {{{1\ \/9, {1, 1}}, {{{}, {1}}, {{1}, {2}}, {{1, 1}, {5}}}}, {{2\/9, {1, 2}}, {{{}, {1}}, {{1}, {2}}, {{2}, {3}}, {{1, 2}, {6}}}}, {{2\/9, {1, 3}}, {{{}, {1}}, {{1}, {2}}, {{3}, {4}}}}, {{1\/9, {2, 2}}, {{{}, {1}}, {{2}, {3}}, {{2, 2}, {7}}}}, {{2\/9, {2, 3}}, {{{}, {1}}, {{2}, {3}}, {{3}, {4}}, {{2, 3}, {8}}}}, {{1\/9, {3, 3}}, {{{}, {1}}, {{3}, {4}}, {{3, 3}, {9}}}}}}, {{1}, {{{1\/3, {1}}, {{{1}, {2}}, {{1, 1}, {5}}}}, {{1\/3, {2}}, {{{1}, {2}}, {{1, 2}, {6}}}}, {{1\/3, {3}}, {{{1}, {2}}}}}}, {{2}, {{{1\ \/3, {1}}, {{{2}, {3}}, {{1, 2}, {6}}}}, {{1\/3, {2}}, {{{2}, {3}}, {{2, 2}, {7}}}}, {{1\/3, {3}}, {{{2}, {3}}, {{2, 3}, {8}}}}}}, {{3}, {{{1\/3, {1}}, {{{3}, {4}}}}, {{1\ \/3, {2}}, {{{3}, {4}}, {{2, 3}, {8}}}}, {{1\/3, {3}}, {{{3}, {4}}, {{3, 3}, {9}}}}}}}, {}}}}\)], "Output"] }, Open ]] }, Open ]], Cell[CellGroupData[{ Cell["Forcer un arbre du destin par une strat\[EAcute]gie", "Subsection", CellTags->"c:41"], Cell[BoxData[{\(fateTree1 = fateTree["\", 2, 2, 3];\), "\n", RowBox[{ RowBox[{"strategy", " ", "=", RowBox[{"{", RowBox[{\({0, {{{{}, {{{1, 1}, {{{}, {1}}}}, {{1, 2}, {{{1, 2}, {5}}}}, {{2, 2}, {{{}, {1}}}}}}}, {}}}\), ",", RowBox[{"{", RowBox[{"1", ",", RowBox[{"{", RowBox[{ RowBox[{"{", RowBox[{ RowBox[{"{", RowBox[{\({}\), ",", RowBox[{"{", RowBox[{\({{1, 1}, {{{}, {1}}}}\), ",", RowBox[{"{", RowBox[{\({1, 2}\), ",", RowBox[{"{", RowBox[{\({{1, 2}, {5}}\), StyleBox[",", FontColor->RGBColor[1, 0, 0]], StyleBox[\({{1}, {2}}\), FontColor->RGBColor[1, 0, 0]]}], "}"}]}], "}"}], ",", \({{2, 2}, {{{}, {1}}}}\)}], "}"}]}], "}"}], ",", \({{1}, {{{1}, {{{1}, {2}}}}, {{2}, {{{1, 2}, {5}}}}}}\), ",", \({{2}, {{{1}, {{{1, 2}, {5}}}}, {{2}, {{{2}, {3}}}}}}\)}], "}"}], ",", \({{{1, 1}, {}}, {{1, 2}, {}}, {{2, 2}, {}}}\)}], "}"}]}], "}"}], ",", \({2, {{{{}, {{{1, 1}, {{{1, 1}, {1}}}}, {{1, 2}, {{{1, 2}, {2}}}}, {{2, 2}, {{{2, 2}, {3}}}}}}, {{1}, {{{1}, {{{1, 1}, {1}}}}, {{2}, {{{1, 2}, {2}}}}}}, {{2}, {{{1}, {{{1, 2}, {2}}}}, {{2}, {{{2, 2}, {3}}}}}}}, {{{1, 1}, {}}, {{1, 2}, {}}, {{2, 2}, {}}}}}\), ",", \({3, {{}, {{{1, 1}, {}}, {{1, 2}, {}}, {{2, 2}, {}}}}}\)}], "}"}]}], ";"}]}], "Input"], Cell["\<\ Restreindre les \[EAcute]tats dans l'arbre du destin \[AGrave] ceux \ contribuant \[AGrave] la strat\[EAcute]gie.\ \>", "Text"], Cell[CellGroupData[{ Cell[BoxData[ \(\(\(MapThread[\[IndentingNewLine]With[{strategyLevel = #2}, \ \[IndentingNewLine]MapAt[ function1[#, strategyLevel[\([\(-1\), 1]\)]] &, #1, {\(-1\), 1}]] &, {fateTree1, strategy}]\)[\([2]\)]\)[\([\(-1\), 1]\)]\)], "Input"], Cell[BoxData[ \(function1[{{{}, {{{1\/4, {1, 1}}, {{{}, {1}}, {{1}, {2}}, {{1, 1}, {4}}}}, {{1\/2, {1, 2}}, {{{}, {1}}, {{1}, {2}}, {{2}, {3}}, {{1, 2}, {5}}}}, {{1\/4, {2, 2}}, {{{}, {1}}, {{2}, {3}}, {{2, 2}, {6}}}}}}, {{1}, {{{1\/2, {1}}, {{{1}, {2}}, {{1, 1}, {4}}}}, {{1\/2, {2}}, {{{1}, {2}}, {{1, 2}, {5}}}}}}, {{2}, {{{1\/2, {1}}, {{{2}, {3}}, {{1, 2}, {5}}}}, {{1\/2, {2}}, {{{2}, {3}}, {{2, 2}, {6}}}}}}}, {{{}, {{{1, 1}, {{{}, {1}}}}, {{1, 2}, {{{1, 2}, {5}}, {{1}, {2}}}}, {{2, 2}, {{{}, {1}}}}}}, {{1}, {{{1}, {{{1}, {2}}}}, {{2}, {{{1, 2}, {5}}}}}}, {{2}, {{{1}, {{{1, 2}, {5}}}}, {{2}, {{{2}, {3}}}}}}}]\)], "Output"] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[ \(\(\(MapThread[\[IndentingNewLine]With[{strategyLevel = #2}, \ \[IndentingNewLine]MapAt[ MapThread[ With[{h1 = Last@#2}, MapAt[function1[#, h1] &, #1, \(-1\)]] &, {#, strategyLevel[\([\(-1\), 1]\)]}] &, #1, {\(-1\), 1}]] &, {fateTree1, strategy}]\)[\([2]\)]\)[\([\(-1\), 1, 1, \(-1\)]\)]\)], "Input"], Cell[BoxData[ \(function1[{{{1\/4, {1, 1}}, {{{}, {1}}, {{1}, {2}}, {{1, 1}, {4}}}}, {{1\/2, {1, 2}}, {{{}, {1}}, {{1}, {2}}, {{2}, {3}}, {{1, 2}, {5}}}}, {{1\/4, {2, 2}}, {{{}, {1}}, {{2}, {3}}, {{2, 2}, {6}}}}}, {{{1, 1}, {{{}, {1}}}}, {{1, 2}, {{{1, 2}, {5}}, {{1}, {2}}}}, {{2, 2}, {{{}, {1}}}}}]\)], "Output"] }, Open ]], Cell[TextData[{ "\[Lambda]-calcul, \[EAcute]liminer ", StyleBox["h1", "Output"], "." }], "Text"], Cell[CellGroupData[{ Cell[BoxData[ \(\(\(MapThread[\[IndentingNewLine]With[{strategyLevel = #2}, \ \[IndentingNewLine]MapAt[ MapThread[{First@#1, function1[Last@#1, Last@#2]} &, {#, strategyLevel[\([\(-1\), 1]\)]}] &, #1, {\(-1\), 1}]] &, {fateTree1, strategy}]\)[\([2]\)]\)[\([\(-1\), 1, 1, \(-1\)]\)]\)], "Input"], Cell[BoxData[ \(function1[{{{1\/4, {1, 1}}, {{{}, {1}}, {{1}, {2}}, {{1, 1}, {4}}}}, {{1\/2, {1, 2}}, {{{}, {1}}, {{1}, {2}}, {{2}, {3}}, {{1, 2}, {5}}}}, {{1\/4, {2, 2}}, {{{}, {1}}, {{2}, {3}}, {{2, 2}, {6}}}}}, {{{1, 1}, {{{}, {1}}}}, {{1, 2}, {{{1, 2}, {5}}, {{1}, {2}}}}, {{2, 2}, {{{}, {1}}}}}]\)], "Output"] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[ \(% \[Equal] %%\)], "Input"], Cell[BoxData[ \(True\)], "Output"] }, Open ]], Cell["On gagne du temps par dessus le march\[EAcute].", "Text"], Cell[CellGroupData[{ Cell[BoxData[ \(zoomTiming[ MapThread[\[IndentingNewLine]With[{strategyLevel = #2}, \ \[IndentingNewLine]MapAt[ MapThread[ With[{h1 = Last@#2}, MapAt[function1[#, h1] &, #1, \(-1\)]] &, {#, strategyLevel[\([\(-1\), 1]\)]}] &, #1, {\(-1\), 1}]] &, {fateTree1, strategy}], MapThread[\[IndentingNewLine]With[{strategyLevel = #2}, \ \[IndentingNewLine]MapAt[ MapThread[{First@#1, function1[Last@#1, Last@#2]} &, {#, strategyLevel[\([\(-1\), 1]\)]}] &, #1, {\(-1\), 1}]] &, {fateTree1, strategy}], 1000]\)], "Input"], Cell[BoxData[ \({0.4099999999999966`\ Second, 0.30000000000000426`\ Second}\)], "Output"] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[ \(\(\(MapThread[\[IndentingNewLine]With[{strategyLevel = #2}, \ \[IndentingNewLine]MapAt[ MapThread[\[IndentingNewLine]{First@#1, MapThread[ function1, {Last@#1, Last@#2}]}\[IndentingNewLine] &, {#, strategyLevel[\([\(-1\), 1]\)]}] &, #1, {\(-1\), 1}]] &, {fateTree1, strategy}]\)[\([2]\)]\)[\([\(-1\), 1, 1, \(-1\), 2]\)]\)], "Input"], Cell[BoxData[ \(function1[{{1\/2, {1, 2}}, {{{}, {1}}, {{1}, {2}}, {{2}, {3}}, {{1, 2}, {5}}}}, {{1, 2}, {{{1, 2}, {5}}, {{1}, {2}}}}]\)], "Output"] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[ \(\(\(MapThread[\[IndentingNewLine]With[{strategyLevel = #2}, \ \[IndentingNewLine]MapAt[ MapThread[{First@#1, MapThread[ With[{h2 = Last@#2}, MapAt[function1[#, h2] &, #1, \(-1\)]] &, {Last@#1, Last@#2}]} &, {#, strategyLevel[\([\(-1\), 1]\)]}] &, #1, {\(-1\), 1}]] &, {fateTree1, strategy}]\)[\([2]\)]\)[\([\(-1\), 1, 1, \(-1\), 2, \(-1\)]\)]\)], "Input"], Cell[BoxData[ \(function1[{{{}, {1}}, {{1}, {2}}, {{2}, {3}}, {{1, 2}, {5}}}, {{{1, 2}, {5}}, {{1}, {2}}}]\)], "Output"] }, Open ]], Cell[TextData[{ "\[Lambda]-calcul, \[EAcute]liminer ", StyleBox["h2", "Output"], "." }], "Text"], Cell[CellGroupData[{ Cell[BoxData[ \(\(\(MapThread[\[IndentingNewLine]With[{strategyLevel = #2}, \ \[IndentingNewLine]MapAt[ MapThread[\[IndentingNewLine]{First@#1, MapThread[\[IndentingNewLine]{First@#1, function1[Last@#1, Last@#2]}\[IndentingNewLine] &, {Last@#1, Last@#2}]} &, {#, strategyLevel[\([\(-1\), 1]\)]}] &, #1, {\(-1\), 1}]] &, {fateTree1, strategy}]\)[\([2]\)]\)[\([\(-1\), 1, 1, \(-1\), 2, \(-1\)]\)]\)], "Input"], Cell[BoxData[ \(function1[{{{}, {1}}, {{1}, {2}}, {{2}, {3}}, {{1, 2}, {5}}}, {{{1, 2}, {5}}, {{1}, {2}}}]\)], "Output"] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[ \(% \[Equal] %%\)], "Input"], Cell[BoxData[ \(True\)], "Output"] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[ \(zoomTiming[ MapThread[\[IndentingNewLine]With[{strategyLevel = #2}, \ \[IndentingNewLine]MapAt[ MapThread[{First@#1, MapThread[ With[{h2 = Last@#2}, MapAt[function1[#, h2] &, #1, \(-1\)]] &, {Last@#1, Last@#2}]} &, {#, strategyLevel[\([\(-1\), 1]\)]}] &, #1, {\(-1\), 1}]] &, {fateTree1, strategy}], MapThread[\[IndentingNewLine]With[{strategyLevel = #2}, \ \[IndentingNewLine]MapAt[ MapThread[\[IndentingNewLine]{First@#1, MapThread[\[IndentingNewLine]{First@#1, function1[Last@#1, Last@#2]}\[IndentingNewLine] &, {Last@#1, Last@#2}]} &, {#, strategyLevel[\([\(-1\), 1]\)]}] &, #1, {\(-1\), 1}]] &, {fateTree1, strategy}], 1000]\)], "Input"], Cell[BoxData[ \({0.8999999999999986`\ Second, 0.6300000000000026`\ Second}\)], "Output"] }, Open ]], Cell[TextData[{ StyleBox["P", "Output"], "oint de for\[CCedilla]age local. \[Wolf] Les positions des \[EAcute]tats \ ne sont pas forc\[EAcute]ment identiques dans l'arbre du destin, qui a pu \ \[EHat]tre \[EAcute]lagu\[EAcute], et dans la strat\[EAcute]gie." }], "Text"], Cell[CellGroupData[{ Cell[BoxData[ \(\(MapThread[ With[{strategyLevel = #2}, MapAt[MapThread[{First@#1, MapThread[{First@#1, force1[Last@#1, Last@#2]} &, {Last@#1, Last@#2}]} &, {#, strategyLevel[\([\(-1\), 1]\)]}] &, #1, {\(-1\), 1}]] &, {fateTree1, strategy}]\)[\([2]\)]\)], "Input"], Cell[BoxData[ \({1, {{{{}, {{{1\/4, {1, 1}}, force1[{{{}, {1}}, {{1}, {2}}, {{1, 1}, {4}}}, {{{}, {1}}}]}, {{1\/2, {1, 2}}, force1[{{{}, {1}}, {{1}, {2}}, {{2}, {3}}, {{1, 2}, {5}}}, {{{1, 2}, {5}}, {{1}, {2}}}]}, {{1\/4, {2, 2}}, force1[{{{}, {1}}, {{2}, {3}}, {{2, 2}, {6}}}, {{{}, {1}}}]}}}, {{1}, {{{1\/2, {1}}, force1[{{{1}, {2}}, {{1, 1}, {4}}}, {{{1}, {2}}}]}, {{1\/2, {2}}, force1[{{{1}, {2}}, {{1, 2}, {5}}}, {{{1, 2}, {5}}}]}}}, {{2}, {{{1\/2, {1}}, force1[{{{2}, {3}}, {{1, 2}, {5}}}, {{{1, 2}, {5}}}]}, {{1\/2, {2}}, force1[{{{2}, {3}}, {{2, 2}, {6}}}, {{{2}, {3}}}]}}}}, {{1, 1}, {1, 2}, {2, 2}}}}\)], "Output"] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[ \(\(With[{force1 = With[{stateList = First /@ #2}, \[IndentingNewLine]Select[#1, First@#~myElement~ stateList &]] &}, \[IndentingNewLine]MapThread[\ \[IndentingNewLine]With[{strategyLevel = #2}, \[IndentingNewLine]MapAt[ MapThread[\[IndentingNewLine]With[{h1 = Last@#2}, MapAt[MapThread[ With[{h2 = Last@#2}, MapAt[force1[#, h2] &, #1, \(-1\)]] &, {#, h1}] &, #1, \(-1\)]] &, {#, strategyLevel[\([\(-1\), 1]\)]}] &, #1, {\(-1\), 1}]] &, {fateTree1, strategy}]]\)[\([2]\)]\)], "Input"], Cell[BoxData[ \({1, {{{{}, {{{1\/4, {1, 1}}, {{{}, {1}}}}, {{1\/2, {1, 2}}, {{{1}, {2}}, {{1, 2}, {5}}}}, {{1\/4, {2, 2}}, {{{}, {1}}}}}}, {{1}, {{{1\/2, {1}}, {{{1}, {2}}}}, \ {{1\/2, {2}}, {{{1, 2}, {5}}}}}}, {{2}, {{{1\/2, {1}}, {{{1, 2}, {5}}}}, {{1\/2, {2}}, {{{2}, {3}}}}}}}, {{1, 1}, {1, 2}, {2, 2}}}}\)], "Output"] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[ \(\(With[{force1 = Cases[#1, Apply[Alternatives, \({First@#, _} &\) /@ #2]] &}, \ \[IndentingNewLine]MapThread[\[IndentingNewLine]With[{strategyLevel = #2}, \ \[IndentingNewLine]MapAt[ MapThread[\[IndentingNewLine]With[{h1 = Last@#2}, MapAt[MapThread[ With[{h2 = Last@#2}, MapAt[force1[#, h2] &, #1, \(-1\)]] &, {#, h1}] &, #1, \(-1\)]] &, {#, strategyLevel[\([\(-1\), 1]\)]}] &, #1, {\(-1\), 1}]] &, {fateTree1, strategy}]]\)[\([2]\)]\)], "Input"], Cell[BoxData[ \({1, {{{{}, {{{1\/4, {1, 1}}, {{{}, {1}}}}, {{1\/2, {1, 2}}, {{{1}, {2}}, {{1, 2}, {5}}}}, {{1\/4, {2, 2}}, {{{}, {1}}}}}}, {{1}, {{{1\/2, {1}}, {{{1}, {2}}}}, \ {{1\/2, {2}}, {{{1, 2}, {5}}}}}}, {{2}, {{{1\/2, {1}}, {{{1, 2}, {5}}}}, {{1\/2, {2}}, {{{2}, {3}}}}}}}, {{1, 1}, {1, 2}, {2, 2}}}}\)], "Output"] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[ \(zoomTiming[\[IndentingNewLine]With[{force1 = With[{stateList = First /@ #2}, \[IndentingNewLine]Select[#1, First@#~myElement~ stateList &]] &}, \[IndentingNewLine]MapThread[\ \[IndentingNewLine]With[{strategyLevel = #2}, \[IndentingNewLine]MapAt[ MapThread[\[IndentingNewLine]With[{h1 = Last@#2}, MapAt[MapThread[ With[{h2 = Last@#2}, MapAt[force1[#, h2] &, #1, \(-1\)]] &, {#, h1}] &, #1, \(-1\)]] &, {#, strategyLevel[\([\(-1\), 1]\)]}] &, #1, {\(-1\), 1}]] &, {fateTree1, strategy}]], With[{force1 = Cases[#1, Apply[Alternatives, \({First@#, _} &\) /@ #2]] &}, \ \[IndentingNewLine]MapThread[\[IndentingNewLine]With[{strategyLevel = #2}, \ \[IndentingNewLine]MapAt[ MapThread[\[IndentingNewLine]With[{h1 = Last@#2}, MapAt[MapThread[ With[{h2 = Last@#2}, MapAt[force1[#, h2] &, #1, \(-1\)]] &, {#, h1}] &, #1, \(-1\)]] &, {#, strategyLevel[\([\(-1\), 1]\)]}] &, #1, {\(-1\), 1}]] &, {fateTree1, strategy}]], 1000]\)], "Input"], Cell[BoxData[ \({2.8699999999999974`\ Second, 2.25`\ Second}\)], "Output"] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[ \(With[{force1 = Cases[#1, Apply[Alternatives, \({First@#, _} &\) /@ #2]] &}, \ \[IndentingNewLine]MapThread[ With[{strategyLevel = #2}, MapAt[MapThread[{First@#1, MapThread[{First@#1, force1[Last@#1, Last@#2]} &, {Last@#1, Last@#2}]} &, {#, strategyLevel[\([\(-1\), 1]\)]}] &, #1, {\(-1\), 1}]] &, {fateTree1, strategy}]]\)], "Input"], Cell[BoxData[ \({{0, {{{{}, {{{1\/4, {1, 1}}, {{{}, {1}}}}, {{1\/2, {1, 2}}, {{{1, 2}, {5}}}}, {{1\/4, {2, 2}}, {{{}, {1}}}}}}}, {}}}, {1, {{{{}, {{{1\/4, {1, 1}}, {{{}, {1}}}}, {{1\/2, {1, 2}}, {{{1}, {2}}, {{1, 2}, {5}}}}, {{1\/4, {2, 2}}, {{{}, {1}}}}}}, {{1}, {{{1\/2, {1}}, {{{1}, \ {2}}}}, {{1\/2, {2}}, {{{1, 2}, {5}}}}}}, {{2}, {{{1\/2, {1}}, {{{1, 2}, {5}}}}, {{1\/2, {2}}, {{{2}, {3}}}}}}}, {{1, 1}, {1, 2}, {2, 2}}}}, {2, {{{{}, {{{1\/4, {1, 1}}, {{{1, 1}, {1}}}}, {{1\/2, {1, 2}}, {{{1, 2}, {2}}}}, {{1\/4, {2, 2}}, {{{2, 2}, {3}}}}}}, {{1}, {{{1\/2, {1}}, {{{1, 1}, {1}}}}, {{1\/2, {2}}, {{{1, 2}, {2}}}}}}, {{2}, {{{1\/2, {1}}, {{{1, 2}, {2}}}}, {{1\/2, {2}}, {{{2, 2}, {3}}}}}}}, {{1, 1}, {1, 2}, {2, 2}}}}, {3, {{}, {{1, 1}, {1, 2}, {2, 2}}}}}\)], "Output"] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[ \(fateTree1[\([1]\)]\)], "Input"], Cell[BoxData[ \({0, {{{{}, {{{1\/4, {1, 1}}, {{{}, {1}}, {{1}, {2}}, {{1, 1}, {4}}}}, {{1\/2, {1, 2}}, {{{}, {1}}, {{1}, {2}}, {{2}, {3}}, {{1, 2}, {5}}}}, {{1\/4, {2, 2}}, {{{}, {1}}, {{2}, {3}}, {{2, 2}, {6}}}}}}}, {}}}\)], "Output"] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[ \(strategy[\([1]\)]\)], "Input"], Cell[BoxData[ \({0, {{{{}, {{{1, 1}, {{{}, {1}}}}, {{1, 2}, {{{1, 2}, {5}}}}, {{2, 2}, {{{}, {1}}}}}}}, {}}}\)], "Output"] }, Open ]], Cell[BoxData[ \(\({fateTree1, strategy} =. \ ;\)\)], "Input"], Cell[BoxData[{ \(\(Clear@force;\)\), "\[IndentingNewLine]", \(force[strategy_List]@fateTree1_List := With[{force1 = Cases[#1, Apply[Alternatives, \({First@#, _} &\) /@ #2]] &}, \ \[IndentingNewLine]MapThread[ With[{strategyLevel = #2}, MapAt[MapThread[{First@#1, MapThread[{First@#1, force1[Last@#1, Last@#2]} &, {Last@#1, Last@#2}]} &, {#, strategyLevel[\([\(-1\), 1]\)]}] &, #1, {\(-1\), 1}]] &, {fateTree1, strategy}]]\)}], "Input", InitializationCell->True], Cell[CellGroupData[{ Cell[BoxData[ \(force[{{0, {{{{}, {{{1, 1}, {{{}, {1}}}}, {{1, 2}, {{{1, 2}, {5}}}}, {{2, 2}, {{{}, {1}}}}}}}, {}}}, {1, {{{{}, {{{1, 1}, {{{}, {1}}}}, {{1, 2}, {{{1, 2}, {5}}, {{1}, {2}}}}, {{2, 2}, {{{}, {1}}}}}}, {{1}, {{{1}, {{{1}, {2}}}}, {{2}, \ {{{1, 2}, {5}}}}}}, {{2}, {{{1}, {{{1, 2}, {5}}}}, {{2}, {{{2}, {3}}}}}}}, {{{1, 1}, {}}, {{1, 2}, {}}, {{2, 2}, {}}}}}, {2, {{{{}, {{{1, 1}, {{{1, 1}, {1}}}}, {{1, 2}, {{{1, 2}, {2}}}}, {{2, 2}, {{{2, 2}, {3}}}}}}, {{1}, {{{1}, {{{1, 1}, {1}}}}, {{2}, {{{1, 2}, {2}}}}}}, {{2}, {{{1}, {{{1, 2}, {2}}}}, {{2}, {{{2, 2}, {3}}}}}}}, {{{1, 1}, {}}, {{1, 2}, {}}, {{2, 2}, {}}}}}, {3, {{}, {{{1, 1}, {}}, {{1, 2}, {}}, {{2, 2}, {}}}}}}]@{{0, {{{{}, {{{1\/4, {1, 1}}, {{{}, {1}}, {{1}, {2}}, {{1, 1}, {4}}}}, {{1\/2, {1, 2}}, {{{}, {1}}, {{1}, {2}}, {{2}, {3}}, {{1, 2}, {5}}}}, {{1\/4, {2, 2}}, {{{}, {1}}, {{2}, {3}}, {{2, 2}, {6}}}}}}}, {}}}, {1, {{{{}, {{{1\/4, {1, 1}}, {{{}, {1}}, {{1}, {2}}, {{1, 1}, {4}}}}, {{1\/2, {1, 2}}, {{{}, {1}}, {{1}, {2}}, {{2}, {3}}, {{1, 2}, {5}}}}, {{1\/4, {2, 2}}, {{{}, {1}}, {{2}, {3}}, {{2, 2}, {6}}}}}}, {{1}, {{{1\/2, {1}}, {{{1}, {2}}, \ {{1, 1}, {4}}}}, {{1\/2, {2}}, {{{1}, {2}}, {{1, 2}, {5}}}}}}, {{2}, {{{1\/2, {1}}, {{{2}, {3}}, \ {{1, 2}, {5}}}}, {{1\/2, {2}}, {{{2}, {3}}, {{2, 2}, {6}}}}}}}, {{1, 1}, {1, 2}, {2, 2}}}}, {2, {{{{}, {{{1\/4, {1, 1}}, {{{1, 1}, {1}}}}, {{1\/2, {1, 2}}, {{{1, 2}, {2}}}}, {{1\/4, {2, 2}}, {{{2, 2}, {3}}}}}}, {{1}, {{{1\/2, {1}}, {{{1, 1}, {1}}}}, {{1\/2, {2}}, {{{1, 2}, {2}}}}}}, {{2}, {{{1\/2, {1}}, {{{1, 2}, {2}}}}, {{1\/2, {2}}, {{{2, 2}, {3}}}}}}}, {{1, 1}, {1, 2}, {2, 2}}}}, {3, {{}, {{1, 1}, {1, 2}, {2, 2}}}}}\)], "Input"], Cell[BoxData[ \({{0, {{{{}, {{{1\/4, {1, 1}}, {{{}, {1}}}}, {{1\/2, {1, 2}}, {{{1, 2}, {5}}}}, {{1\/4, {2, 2}}, {{{}, {1}}}}}}}, {}}}, {1, {{{{}, {{{1\/4, {1, 1}}, {{{}, {1}}}}, {{1\/2, {1, 2}}, {{{1}, {2}}, {{1, 2}, {5}}}}, {{1\/4, {2, 2}}, {{{}, {1}}}}}}, {{1}, {{{1\/2, {1}}, {{{1}, \ {2}}}}, {{1\/2, {2}}, {{{1, 2}, {5}}}}}}, {{2}, {{{1\/2, {1}}, {{{1, 2}, {5}}}}, {{1\/2, {2}}, {{{2}, {3}}}}}}}, {{1, 1}, {1, 2}, {2, 2}}}}, {2, {{{{}, {{{1\/4, {1, 1}}, {{{1, 1}, {1}}}}, {{1\/2, {1, 2}}, {{{1, 2}, {2}}}}, {{1\/4, {2, 2}}, {{{2, 2}, {3}}}}}}, {{1}, {{{1\/2, {1}}, {{{1, 1}, {1}}}}, {{1\/2, {2}}, {{{1, 2}, {2}}}}}}, {{2}, {{{1\/2, {1}}, {{{1, 2}, {2}}}}, {{1\/2, {2}}, {{{2, 2}, {3}}}}}}}, {{1, 1}, {1, 2}, {2, 2}}}}, {3, {{}, {{1, 1}, {1, 2}, {2, 2}}}}}\)], "Output"] }, Open ]] }, Open ]] }, Open ]], Cell[CellGroupData[{ Cell["Politique r\[EAcute]trospective", "Section", CellTags->"c:42"], Cell[CellGroupData[{ Cell["Utilit\[EAcute] des \[EAcute]tats morts", "Subsection", CellTags->"c:43"], Cell["La liste suivant l'utilit\[EAcute] explique comment en profiter.", \ "Text"], Cell[BoxData[ \(Clear@fructify; fructify[utility_]@ fateTree1_List := \(With[{j1 = First@#}, MapAt[\({#, {utility[ j1, #], {}}} &\) /@ # &, #, {\(-1\), \(-1\)}]] &\) /@ fateTree1\)], "Input", InitializationCell->True], Cell[CellGroupData[{ Cell[BoxData[ \(fructify[utility]@fateTree["\", 2, 2, 2]\)], "Input"], Cell[BoxData[ \({{0, {{{{}, {{{1\/4, {1, 1}}, {{{}, {1}}, {{1}, {2}}, {{1, 1}, {4}}}}, {{1\/2, {1, 2}}, {{{}, {1}}, {{1}, {2}}, {{2}, {3}}, {{1, 2}, {5}}}}, {{1\/4, {2, 2}}, {{{}, {1}}, {{2}, {3}}, {{2, 2}, {6}}}}}}}, {}}}, {1, {{{{}, {{{1\/4, {1, 1}}, {{{1, 1}, {1}}}}, {{1\/2, {1, 2}}, {{{1, 2}, {2}}}}, {{1\/4, {2, 2}}, {{{2, 2}, {3}}}}}}, {{1}, {{{1\/2, {1}}, {{{1, 1}, {1}}}}, {{1\/2, {2}}, {{{1, 2}, {2}}}}}}, {{2}, {{{1\/2, {1}}, {{{1, 2}, {2}}}}, {{1\/2, {2}}, {{{2, 2}, {3}}}}}}}, {{{1, 1}, {utility[1, {1, 1}], {}}}, {{1, 2}, {utility[1, {1, 2}], {}}}, {{2, 2}, {utility[1, {2, 2}], {}}}}}}, {2, {{}, {{{1, 1}, {utility[2, {1, 1}], {}}}, {{1, 2}, {utility[2, {1, 2}], {}}}, {{2, 2}, {utility[2, {2, 2}], {}}}}}}}\)], "Output"] }, Open ]] }, Open ]], Cell[CellGroupData[{ Cell["Replier un rameau selon \[LeftGuillemet] mean-max \[RightGuillemet]", \ "Subsection", CellTags->"c:44"], Cell["\<\ Rameau d'un \[EAcute]tat et liste des \[EAcute]tats suivants morts \ avec leur {utilit\[EAcute]}.\ \>", "Text"], Cell[BoxData[{ \(\(stateBranch = {{1}, {{{1\/2, {1}}, {{{1}, {1}}, {{1, 1}, {2}}}}, {{1\/2, {2}}, {{{1}, {1}}, {{1, 2}, {5}}}}}};\)\), "\n", \(\(nextStates = {\[IndentingNewLine]{{1}, {utility[{1}]}}, \ \[IndentingNewLine]{{1, 1}, {utility[{1, 1}]}}, \[IndentingNewLine]{{2}, {utility[{2}]}}, \ \[IndentingNewLine]{{2, 2}, {utility[{2, 2}]}}, \[IndentingNewLine]{{1, 2}, {utility[{1, 2}]}}\[IndentingNewLine]};\)\)}], "Input"], Cell["\<\ Pour chaque \[EAcute]v\[EAcute]nement, position des \[EAcute]tats \ accessibles dans la liste des \[EAcute]tats suivants morts ou vifs.\ \>", \ "Text"], Cell[CellGroupData[{ Cell[BoxData[ \(Map[Last, Last /@ Last@stateBranch, {2}]\)], "Input"], Cell[BoxData[ \({{{1}, {2}}, {{1}, {5}}}\)], "Output"] }, Open ]], Cell["\<\ Apr\[EGrave]s un premier \[EAcute]v\[EAcute]nement, maximiser \ l'utilit\[EAcute] sur la sous-liste des \[EAcute]tats suivants accessibles.\ \ \>", "Text"], Cell[CellGroupData[{ Cell[BoxData[ \(maxAndArgPositionMax[#[\([\(-1\), 1]\)] &, nextStates, \((Map[Last, Last /@ Last@stateBranch, {2}])\)[\([1]\)]]\)], "Input"], Cell[BoxData[ \({Max[utility[{1}], utility[{1, 1}]], {}}\)], "Output"] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[{ \(\(utility = \(-10\) + Max@# &;\)\), "\[IndentingNewLine]", \(maxAndArgPositionMax[#[\([\(-1\), 1]\)] &, nextStates, \((Map[Last, Last /@ Last@stateBranch, {2}])\)[\([1]\)]]\)}], "Input"], Cell[BoxData[ \({\(-9\), {{{{1}, {\(-9\)}}, {1}}, {{{1, 1}, {\(-9\)}}, {2}}}}\)], "Output"] }, Open ]], Cell["Nettoyer.", "Text"], Cell[CellGroupData[{ Cell[BoxData[ \(MapAt[\(MapAt[function1, #, 1] &\) /@ # &, maxAndArgPositionMax[#[\([\(-1\), 1]\)] &, nextStates, \((Map[Last, Last /@ Last@stateBranch, {2}])\)[\([1]\)]], \(-1\)]\)], "Input"], Cell[BoxData[ \({\(-9\), {{function1[{{1}, {\(-9\)}}], {1}}, {function1[{{1, 1}, {\(-9\)}}], {2}}}}\)], "Output"] }, Open ]], Cell["\<\ {utilit\[EAcute] max, {{plus utile \[EAcute]tat suivant, sa \ position dans la liste des \[EAcute]tats suivants}\[Ellipsis]}}\ \>", "Text"], Cell[CellGroupData[{ Cell[BoxData[ \(MapAt[\(MapAt[First, #, 1] &\) /@ # &, maxAndArgPositionMax[#[\([\(-1\), 1]\)] &, nextStates, \((Map[Last, Last /@ Last@stateBranch, {2}])\)[\([1]\)]], \(-1\)]\)], "Input"], Cell[BoxData[ \({\(-9\), {{{1}, {1}}, {{1, 1}, {2}}}}\)], "Output"] }, Open ]], Cell["Appliquer \[AGrave] tous les \[EAcute]v\[EAcute]nements :", "Text"], Cell[CellGroupData[{ Cell[BoxData[ \(maxUtilities = \(MapAt[\(MapAt[First, #, 1] &\) /@ # &, maxAndArgPositionMax[#[\([\(-1\), 1]\)] &, nextStates, #], \(-1\)] &\) /@ Map[Last, Last /@ Last@stateBranch, {2}]\)], "Input"], Cell[BoxData[ \({{\(-9\), {{{1}, {1}}, {{1, 1}, {2}}}}, {\(-8\), {{{1, 2}, {5}}}}}\)], "Output"] }, Open ]], Cell["\<\ Th\[EAcute]or\[EGrave]me de von Neumann-Morgenstern : l'utilit\ \[EAcute] courante est l'esp\[EAcute]rance d'utilit\[EAcute] suivante.\ \>", \ "Text"], Cell[CellGroupData[{ Cell[BoxData[ \({First /@ maxUtilities, \(#[\([1, 1]\)] &\) /@ Last@stateBranch}\)], "Input"], Cell[BoxData[ \({{\(-9\), \(-8\)}, {1\/2, 1\/2}}\)], "Output"] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[ \(\((First /@ maxUtilities)\) . \((\(#[\([1, 1]\)] &\) /@ Last@stateBranch)\)\)], "Input"], Cell[BoxData[ \(\(-\(17\/2\)\)\)], "Output"] }, Open ]], Cell["\<\ {{\[EAcute]v\[EAcute]nement, {{plus utile \[EAcute]tat suivant, sa \ position dans la liste des \[EAcute]tats suivants}\[Ellipsis]}}\[Ellipsis]}\ \ \>", "Text"], Cell[CellGroupData[{ Cell[BoxData[ \(Transpose@{\(#[\([1, \(-1\)]\)] &\) /@ Last@stateBranch, Last /@ maxUtilities}\)], "Input"], Cell[BoxData[ \({{{1}, {{{1}, {1}}, {{1, 1}, {2}}}}, {{2}, {{{1, 2}, {5}}}}}\)], "Output"] }, Open ]], Cell["{\[EAcute]tat courant, {utilit\[EAcute], comment en profiter}}", "Text"], Cell[CellGroupData[{ Cell[BoxData[ \({\[IndentingNewLine]First@ stateBranch, \[IndentingNewLine]{\[IndentingNewLine]\((First /@ maxUtilities)\) . \((\(#[\([1, 1]\)] &\) /@ Last@stateBranch)\), Transpose@{\(#[\([1, \(-1\)]\)] &\) /@ Last@stateBranch, Last /@ maxUtilities}\[IndentingNewLine]}\[IndentingNewLine]}\)], \ "Input"], Cell[BoxData[ \({{1}, {\(-\(17\/2\)\), {{{1}, {{{1}, {1}}, {{1, 1}, {2}}}}, {{2}, {{{1, 2}, {5}}}}}}}\)], "Output"] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[{ \(\(maxUtilities =. ;\)\), "\[IndentingNewLine]", \(With[{maxUtilities = \(MapAt[\(MapAt[First, #, 1] &\) /@ # &, \ \[IndentingNewLine]maxAndArgPositionMax[#[\([\(-1\), 1]\)] &, nextStates, #], \[IndentingNewLine]\(-1\)] &\) /@ Map[Last, Last /@ Last@ stateBranch, {2}]}, \ \[IndentingNewLine]{\[IndentingNewLine]First@ stateBranch, \[IndentingNewLine]{\[IndentingNewLine]\((First /@ maxUtilities)\) . \((\(#[\([1, 1]\)] &\) /@ Last@stateBranch)\), Transpose@{\(#[\([1, \(-1\)]\)] &\) /@ Last@stateBranch, Last /@ maxUtilities}\[IndentingNewLine]}\[IndentingNewLine]}]\)\ }], "Input"], Cell[BoxData[ \({{1}, {\(-\(17\/2\)\), {{{1}, {{{1}, {1}}, {{1, 1}, {2}}}}, {{2}, {{{1, 2}, {5}}}}}}}\)], "Output"] }, Open ]], Cell[BoxData[ \(stateBranch =. ; nextStates =. ; utility =. ;\)], "Input"], Cell[BoxData[ \(Clear@meanMax; meanMax[stateBranch_List, nextStates_List] := \[IndentingNewLine]With[{maxUtilities = \ \(MapAt[\(MapAt[First, #, 1] &\) /@ # &, maxAndArgPositionMax[#[\([\(-1\), 1]\)] &, nextStates, #], \(-1\)] &\) /@ Map[Last, Last /@ Last@ stateBranch, {2}]}, \[IndentingNewLine]{\ \[IndentingNewLine]First@ stateBranch, \[IndentingNewLine]{\[IndentingNewLine]\((First /@ maxUtilities)\) . \((\(#[\([1, 1]\)] &\) /@ Last@stateBranch)\), Transpose@{\(#[\([1, \(-1\)]\)] &\) /@ Last@stateBranch, Last /@ maxUtilities}\[IndentingNewLine]}\[IndentingNewLine]}]\)], \ "Input", InitializationCell->True], Cell[CellGroupData[{ Cell[BoxData[ \(meanMax[{{}, {\[IndentingNewLine]{{p11, {1, 1}}, {{{1}, {1}}, {{1, 1}, {3}}}}, \[IndentingNewLine]{{p12, {1, 2}}, {{{1}, {1}}, {{2}, {2}}, {{1, 2}, {4}}}}, \[IndentingNewLine]{{p22, {2, 2}}, {{{2}, {2}}, {{2, 2}, {5}}}}}}, \[IndentingNewLine]{\[IndentingNewLine]{{1}, \ {\(-17\)}}, \[IndentingNewLine]{{2}, {\(-16\)}}, \[IndentingNewLine]{{1, 1}, {\(-8\)}}, \[IndentingNewLine]{{1, 2}, {\(-7\)}}, \[IndentingNewLine]{{2, 2}, {\(-6\)}}\[IndentingNewLine]}]\)], "Input"], Cell[BoxData[ \({{}, {\(-8\)\ p11 - 7\ p12 - 6\ p22, {{{1, 1}, {{{1, 1}, {3}}}}, {{1, 2}, {{{1, 2}, {4}}}}, {{2, 2}, {{{2, 2}, {5}}}}}}}\)], "Output"] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[ \(meanMax[{{1}, {{{1\/2, {1}}, {{{1, 1}, {1}}}}, {{1\/2, {2}}, {{{1, 2}, {2}}}}}}, {{{1, 1}, {\(-19. \)}}, {{1, 2}, {\(-18. \)}}, {{2, 2}, {\(-18. \)}}}]\)], "Input"], Cell[BoxData[ \({{1}, {\(-18.5`\), {{{1}, {{{1, 1}, {1}}}}, {{2}, {{{1, 2}, {2}}}}}}}\)], "Output"] }, Open ]] }, Open ]], Cell[CellGroupData[{ Cell["Replier un niveau", "Subsection", CellTags->"c:45"], Cell["Comme des grappes de cerises. ", "Text"], Cell[CellGroupData[{ Cell[BoxData[ \(fruitCluster = Take[fructify[utility]@fateTree["\", 2, 2, 2], \(-2\)]\)], "Input"], Cell[BoxData[ \({{1, {{{{}, {{{1\/4, {1, 1}}, {{{1, 1}, {1}}}}, {{1\/2, {1, 2}}, {{{1, 2}, {2}}}}, {{1\/4, {2, 2}}, {{{2, 2}, {3}}}}}}, {{1}, {{{1\/2, {1}}, {{{1, 1}, {1}}}}, {{1\/2, {2}}, {{{1, 2}, {2}}}}}}, {{2}, {{{1\/2, {1}}, {{{1, 2}, {2}}}}, {{1\/2, {2}}, {{{2, 2}, {3}}}}}}}, {{{1, 1}, {utility[1, {1, 1}], {}}}, {{1, 2}, {utility[1, {1, 2}], {}}}, {{2, 2}, {utility[1, {2, 2}], {}}}}}}, {2, {{}, {{{1, 1}, {utility[2, {1, 1}], {}}}, {{1, 2}, {utility[2, {1, 2}], {}}}, {{2, 2}, {utility[2, {2, 2}], {}}}}}}}\)], "Output"] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[ \(nextStates = Flatten[fruitCluster[\([\(-1\), \(-1\)]\)], 1]\)], "Input"], Cell[BoxData[ \({{{1, 1}, {utility[2, {1, 1}], {}}}, {{1, 2}, {utility[2, {1, 2}], {}}}, {{2, 2}, {utility[2, {2, 2}], {}}}}\)], "Output"] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[ \(fruitCluster[\([1, \(-1\), 1]\)]\)], "Input"], Cell[BoxData[ \({{{}, {{{1\/4, {1, 1}}, {{{1, 1}, {1}}}}, {{1\/2, {1, 2}}, {{{1, 2}, {2}}}}, {{1\/4, {2, 2}}, {{{2, 2}, {3}}}}}}, {{1}, {{{1\/2, {1}}, {{{1, 1}, {1}}}}, {{1\/2, {2}}, {{{1, 2}, {2}}}}}}, {{2}, {{{1\/2, {1}}, {{{1, 2}, {2}}}}, {{1\/2, {2}}, {{{2, 2}, {3}}}}}}}\)], "Output"] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[{ \(\(utility = \(-10\) #1 + Plus @@ #2 &;\)\), "\n", \(\(meanMax[#, nextStates] &\) /@ fruitCluster[\([1, \(-1\), 1]\)]\)}], "Input"], Cell[BoxData[ \({{{}, {\(-17\), {{{1, 1}, {{{1, 1}, {1}}}}, {{1, 2}, {{{1, 2}, {2}}}}, {{2, 2}, {{{2, 2}, {3}}}}}}}, {{1}, {\(-\(35\/2\)\), {{{1}, {{{1, 1}, {1}}}}, {{2}, {{{1, 2}, {2}}}}}}}, {{2}, {\(-\(33\/2\)\), {{{1}, {{{1, 2}, {2}}}}, {{2}, {{{2, 2}, {3}}}}}}}}\)], "Output"] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[ \(MapAt[\(meanMax[#, nextStates] &\) /@ # &, First@fruitCluster, {\(-1\), 1}]\)], "Input"], Cell[BoxData[ \({1, {{{{}, {\(-17\), {{{1, 1}, {{{1, 1}, {1}}}}, {{1, 2}, {{{1, 2}, {2}}}}, {{2, 2}, {{{2, 2}, {3}}}}}}}, {{1}, {\(-\(35\/2\)\), {{{1}, {{{1, 1}, {1}}}}, {{2}, {{{1, 2}, {2}}}}}}}, {{2}, {\(-\(33\/2\)\), {{{1}, {{{1, 2}, {2}}}}, {{2}, {{{2, 2}, {3}}}}}}}}, {{{1, 1}, {\(-8\), {}}}, {{1, 2}, {\(-7\), {}}}, {{2, 2}, {\(-6\), {}}}}}}\)], "Output"] }, Open ]], Cell[BoxData[ \(\({nextStates, utility, fruitCluster} =. ;\)\)], "Input"], Cell[BoxData[{ \(\(Clear@meanMaxLevel;\)\), "\[IndentingNewLine]", \(meanMaxLevel@fruitCluster_List := MapAt[\(meanMax[#, Flatten[fruitCluster[\([\(-1\), \(-1\)]\)], 1]] &\) /@ # &, First@fruitCluster, {\(-1\), 1}]\)}], "Input", InitializationCell->True], Cell[CellGroupData[{ Cell[BoxData[ \(meanMaxLevel@{{1, {{{{}, {{{1\/4, {1, 1}}, {{{1, 1}, {1}}}}, {{1\/2, {1, 2}}, {{{1, 2}, {2}}}}, {{1\/4, {2, 2}}, {{{2, 2}, {3}}}}}}, {{1}, {{{1\/2, {1}}, {{{1, 1}, {1}}}}, {{1\/2, {2}}, {{{1, 2}, {2}}}}}}, {{2}, {{{1\/2, {1}}, {{{1, 2}, {2}}}}, {{1\/2, {2}}, {{{2, 2}, {3}}}}}}}, {{{1, 1}, {\(-8\), {}}}, {{1, 2}, {\(-7\), {}}}, {{2, 2}, {\(-6\), {}}}}}}, {2, {{}, {{{1, 1}, {\(-18\), {}}}, {{1, 2}, {\(-17\), {}}}, {{2, 2}, {\(-16\), {}}}}}}}\)], "Input"], Cell[BoxData[ \({1, {{{{}, {\(-17\), {{{1, 1}, {{{1, 1}, {1}}}}, {{1, 2}, {{{1, 2}, {2}}}}, {{2, 2}, {{{2, 2}, {3}}}}}}}, {{1}, {\(-\(35\/2\)\), {{{1}, {{{1, 1}, {1}}}}, {{2}, {{{1, 2}, {2}}}}}}}, {{2}, {\(-\(33\/2\)\), {{{1}, {{{1, 2}, {2}}}}, {{2}, {{{2, 2}, {3}}}}}}}}, {{{1, 1}, {\(-8\), {}}}, {{1, 2}, {\(-7\), {}}}, {{2, 2}, {\(-6\), {}}}}}}\)], "Output"] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[{ \(\({d = 2, f = 2, j = 2, utility = \(-10. \) + Plus @@ #2 &};\)\), "\n", \(meanMaxLevel@ Take[fructify[utility]@fateTree["\", d, f, j], \(-2\)]\)}], "Input"], Cell[BoxData[ \({1, {{{{}, {\(-7.`\), {{{1, 1}, {{{1, 1}, {1}}}}, {{1, 2}, {{{1, 2}, {2}}}}, {{2, 2}, {{{2, 2}, {3}}}}}}}, {{1}, {\(-7.5`\), {{{1}, {{{1, 1}, {1}}}}, {{2}, {{{1, 2}, {2}}}}}}}, {{2}, {\(-6.5`\), {{{1}, {{{1, 2}, {2}}}}, {{2}, {{{2, 2}, {3}}}}}}}}, {{{1, 1}, {\(-8.`\), {}}}, {{1, 2}, {\(-7.`\), {}}}, {{2, 2}, {\(-6.`\), {}}}}}}\)], "Output"] }, Open ]], Cell[BoxData[ \(\({d =. , f =. , j =. , utility =. };\)\)], "Input"] }, Open ]], Cell[CellGroupData[{ Cell["R\[EAcute]currence \[AGrave] rebours sur les niveaux", "Subsection", CellTags->"c:46"], Cell["Sch\[EAcute]ma temporel.", "Text"], Cell[CellGroupData[{ Cell[BoxData[{ \(\({d = 2, f = 3, j = 3};\)\), "\[IndentingNewLine]", \(With[{fructifiedFateTree = Range[0, j]}, \[IndentingNewLine]reverseFoldList[function1, dropLast@fructifiedFateTree, Last@fructifiedFateTree]]\)}], "Input"], Cell[BoxData[ \({function1[0, function1[1, function1[2, 3]]], function1[1, function1[2, 3]], function1[2, 3], 3}\)], "Output"] }, Open ]], Cell[BoxData[ \(utility = \(-10\) #1 + Plus @@ #2 &; fructifiedFateTree = fructify[utility]@fateTree["\", d, f, j];\)], "Input"], Cell[CellGroupData[{ Cell[BoxData[ \(reverseFoldList[meanMaxLevel@{#1, #2} &\ , dropLast@fructifiedFateTree, Last@fructifiedFateTree]\)], "Input"], Cell[BoxData[ \({{0, {{{{}, {\(-6\), {{{1, 1}, {{{1, 1}, {5}}}}, {{1, 2}, {{{1, 2}, {6}}}}, {{1, 3}, {{{1, 3}, {7}}}}, {{2, 2}, {{{2, 2}, {8}}}}, {{2, 3}, {{{2, 3}, {9}}}}, {{3, 3}, {{{3, 3}, {10}}}}}}}}, {}}}, {1, {{{{}, {\(-16\), {{{1, 1}, {{{1, 1}, {5}}}}, {{1, 2}, {{{1, 2}, {6}}}}, {{1, 3}, {{{1, 3}, {7}}}}, {{2, 2}, {{{2, 2}, {8}}}}, {{2, 3}, {{{2, 3}, {9}}}}, {{3, 3}, {{{3, 3}, {10}}}}}}}, {{1}, {\(-17\), {{{1}, {{{1, 1}, {5}}}}, {{2}, {{{1, 2}, {6}}}}, {{3}, {{{1, 3}, {7}}}}}}}, {{2}, {\(-16\), {{{1}, {{{1, 2}, {6}}}}, {{2}, {{{2, 2}, {8}}}}, {{3}, {{{2, 3}, {9}}}}}}}, {{3}, {\(-15\), {{{1}, {{{1, 3}, {7}}}}, {{2}, {{{2, 3}, {9}}}}, {{3}, {{{3, 3}, {10}}}}}}}}, {{{1, 1}, {\(-8\), {}}}, {{1, 2}, {\(-7\), {}}}, {{1, 3}, {\(-6\), {}}}, {{2, 2}, {\(-6\), {}}}, {{2, 3}, {\(-5\), {}}}, {{3, 3}, {\(-4\), {}}}}}}, {2, {{{{}, {\(-26\), {{{1, 1}, {{{1, 1}, {1}}}}, {{1, 2}, {{{1, 2}, {2}}}}, {{1, 3}, {{{1, 3}, {3}}}}, {{2, 2}, {{{2, 2}, {4}}}}, {{2, 3}, {{{2, 3}, {5}}}}, {{3, 3}, {{{3, 3}, {6}}}}}}}, {{1}, {\(-27\), {{{1}, {{{1, 1}, {1}}}}, {{2}, {{{1, 2}, {2}}}}, {{3}, {{{1, 3}, {3}}}}}}}, {{2}, {\(-26\), {{{1}, {{{1, 2}, {2}}}}, {{2}, {{{2, 2}, {4}}}}, {{3}, {{{2, 3}, {5}}}}}}}, {{3}, {\(-25\), {{{1}, {{{1, 3}, {3}}}}, {{2}, {{{2, 3}, {5}}}}, {{3}, {{{3, 3}, {6}}}}}}}}, {{{1, 1}, {\(-18\), {}}}, {{1, 2}, {\(-17\), {}}}, {{1, 3}, {\(-16\), {}}}, {{2, 2}, {\(-16\), {}}}, {{2, 3}, {\(-15\), {}}}, {{3, 3}, {\(-14\), {}}}}}}, {3, {{}, {{{1, 1}, {\(-28\), {}}}, {{1, 2}, {\(-27\), {}}}, {{1, 3}, {\(-26\), {}}}, {{2, 2}, {\(-26\), {}}}, {{2, 3}, {\(-25\), {}}}, {{3, 3}, {\(-24\), {}}}}}}}\)], "Output"] }, Open ]], Cell[BoxData[ \(\({d, f, j, fructifiedFateTree, utility} =. ;\)\)], "Input"], Cell[BoxData[{ \(\(Clear@maxUtilityAndBestStrategy;\)\), "\[IndentingNewLine]", \(maxUtilityAndBestStrategy[fateTree1_, utility_] := With[{fructifiedFateTree = fructify[utility]@fateTree1}, \[IndentingNewLine]reverseFoldList[ meanMaxLevel@{#1, #2} &, dropLast@fructifiedFateTree, Last@fructifiedFateTree]\[IndentingNewLine]]\)}], "Input", InitializationCell->True], Cell[CellGroupData[{ Cell[BoxData[ \(maxUtilityAndBestStrategy[ fateTree["\", 2, 3, 3], \(-10\)\ #1 + Plus @@ #2 &]\)], "Input"], Cell[BoxData[ \({{0, {{{{}, {\(-6\), {{{1, 1}, {{{1, 1}, {5}}}}, {{1, 2}, {{{1, 2}, {6}}}}, {{1, 3}, {{{1, 3}, {7}}}}, {{2, 2}, {{{2, 2}, {8}}}}, {{2, 3}, {{{2, 3}, {9}}}}, {{3, 3}, {{{3, 3}, {10}}}}}}}}, {}}}, {1, {{{{}, {\(-16\), {{{1, 1}, {{{1, 1}, {5}}}}, {{1, 2}, {{{1, 2}, {6}}}}, {{1, 3}, {{{1, 3}, {7}}}}, {{2, 2}, {{{2, 2}, {8}}}}, {{2, 3}, {{{2, 3}, {9}}}}, {{3, 3}, {{{3, 3}, {10}}}}}}}, {{1}, {\(-17\), {{{1}, {{{1, 1}, {5}}}}, {{2}, {{{1, 2}, {6}}}}, {{3}, {{{1, 3}, {7}}}}}}}, {{2}, {\(-16\), {{{1}, {{{1, 2}, {6}}}}, {{2}, {{{2, 2}, {8}}}}, {{3}, {{{2, 3}, {9}}}}}}}, {{3}, {\(-15\), {{{1}, {{{1, 3}, {7}}}}, {{2}, {{{2, 3}, {9}}}}, {{3}, {{{3, 3}, {10}}}}}}}}, {{{1, 1}, {\(-8\), {}}}, {{1, 2}, {\(-7\), {}}}, {{1, 3}, {\(-6\), {}}}, {{2, 2}, {\(-6\), {}}}, {{2, 3}, {\(-5\), {}}}, {{3, 3}, {\(-4\), {}}}}}}, {2, {{{{}, {\(-26\), {{{1, 1}, {{{1, 1}, {1}}}}, {{1, 2}, {{{1, 2}, {2}}}}, {{1, 3}, {{{1, 3}, {3}}}}, {{2, 2}, {{{2, 2}, {4}}}}, {{2, 3}, {{{2, 3}, {5}}}}, {{3, 3}, {{{3, 3}, {6}}}}}}}, {{1}, {\(-27\), {{{1}, {{{1, 1}, {1}}}}, {{2}, {{{1, 2}, {2}}}}, {{3}, {{{1, 3}, {3}}}}}}}, {{2}, {\(-26\), {{{1}, {{{1, 2}, {2}}}}, {{2}, {{{2, 2}, {4}}}}, {{3}, {{{2, 3}, {5}}}}}}}, {{3}, {\(-25\), {{{1}, {{{1, 3}, {3}}}}, {{2}, {{{2, 3}, {5}}}}, {{3}, {{{3, 3}, {6}}}}}}}}, {{{1, 1}, {\(-18\), {}}}, {{1, 2}, {\(-17\), {}}}, {{1, 3}, {\(-16\), {}}}, {{2, 2}, {\(-16\), {}}}, {{2, 3}, {\(-15\), {}}}, {{3, 3}, {\(-14\), {}}}}}}, {3, {{}, {{{1, 1}, {\(-28\), {}}}, {{1, 2}, {\(-27\), {}}}, {{1, 3}, {\(-26\), {}}}, {{2, 2}, {\(-26\), {}}}, {{2, 3}, {\(-25\), {}}}, {{3, 3}, {\(-24\), {}}}}}}}\)], "Output"] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[ \(\(Composition[dropStrategy, maxUtilityAndBestStrategy]\)[ fateTree["\", 2, 3, 3], \(-10\)\ #1 + Plus @@ #2 &]\)], "Input"], Cell[BoxData[ \(\(-6\)\)], "Output"] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[ \(\(Composition[dropUtility, maxUtilityAndBestStrategy]\)[ fateTree["\", 2, 3, 3], \(-10\)\ #1 + Plus @@ #2 &]\)], "Input"], Cell[BoxData[ \({{0, {{{{}, {{{1, 1}, {{{1, 1}, {5}}}}, {{1, 2}, {{{1, 2}, {6}}}}, {{1, 3}, {{{1, 3}, {7}}}}, {{2, 2}, {{{2, 2}, {8}}}}, {{2, 3}, {{{2, 3}, {9}}}}, {{3, 3}, {{{3, 3}, {10}}}}}}}, {}}}, {1, {{{{}, {{{1, 1}, {{{1, 1}, {5}}}}, {{1, 2}, {{{1, 2}, {6}}}}, {{1, 3}, {{{1, 3}, {7}}}}, {{2, 2}, {{{2, 2}, {8}}}}, {{2, 3}, {{{2, 3}, {9}}}}, {{3, 3}, {{{3, 3}, {10}}}}}}, {{1}, {{{1}, {{{1, 1}, {5}}}}, {{2}, {{{1, 2}, {6}}}}, {{3}, {{{1, 3}, {7}}}}}}, {{2}, {{{1}, {{{1, 2}, {6}}}}, {{2}, {{{2, 2}, {8}}}}, {{3}, {{{2, 3}, {9}}}}}}, {{3}, {{{1}, {{{1, 3}, {7}}}}, {{2}, {{{2, 3}, {9}}}}, {{3}, {{{3, 3}, {10}}}}}}}, {{{1, 1}, {}}, {{1, 2}, {}}, {{1, 3}, {}}, {{2, 2}, {}}, {{2, 3}, {}}, {{3, 3}, {}}}}}, {2, {{{{}, {{{1, 1}, {{{1, 1}, {1}}}}, {{1, 2}, {{{1, 2}, {2}}}}, {{1, 3}, {{{1, 3}, {3}}}}, {{2, 2}, {{{2, 2}, {4}}}}, {{2, 3}, {{{2, 3}, {5}}}}, {{3, 3}, {{{3, 3}, {6}}}}}}, {{1}, {{{1}, {{{1, 1}, {1}}}}, {{2}, {{{1, 2}, {2}}}}, {{3}, {{{1, 3}, {3}}}}}}, {{2}, {{{1}, {{{1, 2}, {2}}}}, {{2}, {{{2, 2}, {4}}}}, {{3}, {{{2, 3}, {5}}}}}}, {{3}, {{{1}, {{{1, 3}, {3}}}}, {{2}, {{{2, 3}, {5}}}}, {{3}, {{{3, 3}, {6}}}}}}}, {{{1, 1}, {}}, {{1, 2}, {}}, {{1, 3}, {}}, {{2, 2}, {}}, {{2, 3}, {}}, {{3, 3}, {}}}}}, {3, {{}, {{{1, 1}, {}}, {{1, 2}, {}}, {{1, 3}, {}}, {{2, 2}, {}}, {{2, 3}, {}}, {{3, 3}, {}}}}}}\)], "Output"] }, Open ]] }, Open ]] }, Open ]], Cell[CellGroupData[{ Cell["Jugement d'une strat\[EAcute]gie (markovienne) quelconque", "Section", CellTags->"c:47"], Cell[CellGroupData[{ Cell["Replier un rameau selon \[LeftGuillemet] mean-mean \[RightGuillemet]", \ "Subsection", CellTags->"c:48"], Cell[CellGroupData[{ Cell[BoxData[ \({d = 2, f = 4, j = 2}; j1 = 0; stateBranch = \(fateTree["\", d, f, j]\)[\([j1 + 1, \(-1\), 1, 1]\)]\)], "Input"], Cell[BoxData[ \({{}, {{{1\/16, {1, 1}}, {{{}, {1}}, {{1}, {2}}, {{1, 1}, {6}}}}, {{1\/8, {1, 2}}, {{{}, {1}}, {{1}, {2}}, {{2}, {3}}, {{1, 2}, {7}}}}, {{1\/8, {1, 3}}, {{{}, {1}}, {{1}, {2}}, {{3}, {4}}, {{1, 3}, {8}}}}, {{1\/8, {1, 4}}, {{{}, {1}}, {{1}, {2}}, {{4}, {5}}, {{1, 4}, {9}}}}, {{1\/16, {2, 2}}, {{{}, {1}}, {{2}, {3}}, {{2, 2}, {10}}}}, {{1\/8, {2, 3}}, {{{}, {1}}, {{2}, {3}}, {{3}, {4}}, {{2, 3}, {11}}}}, {{1\/8, {2, 4}}, {{{}, {1}}, {{2}, {3}}, {{4}, {5}}, {{2, 4}, {12}}}}, {{1\/16, {3, 3}}, {{{}, {1}}, {{3}, {4}}, {{3, 3}, {13}}}}, {{1\/8, {3, 4}}, {{{}, {1}}, {{3}, {4}}, {{4}, {5}}, {{3, 4}, {14}}}}, {{1\/16, {4, 4}}, {{{}, {1}}, {{4}, {5}}, {{4, 4}, {15}}}}}}\)], "Output"] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[ \(nextStates = \({#, {utility[j1 + 1, #]}} &\) /@ Flatten[\(allCombinations[#, f] &\) /@ Range[0, d], 1]\)], "Input"], Cell[BoxData[ \({{{}, {utility[1, {}]}}, {{1}, {utility[1, {1}]}}, {{2}, {utility[ 1, {2}]}}, {{3}, {utility[1, {3}]}}, {{4}, {utility[ 1, {4}]}}, {{1, 1}, {utility[1, {1, 1}]}}, {{1, 2}, {utility[1, {1, 2}]}}, {{1, 3}, {utility[1, {1, 3}]}}, {{1, 4}, {utility[1, {1, 4}]}}, {{2, 2}, {utility[1, {2, 2}]}}, {{2, 3}, {utility[1, {2, 3}]}}, {{2, 4}, {utility[1, {2, 4}]}}, {{3, 3}, {utility[1, {3, 3}]}}, {{3, 4}, {utility[1, {3, 4}]}}, {{4, 4}, {utility[1, {4, 4}]}}}\)], "Output"] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[ \(\(\(Composition[dropUtility, maxUtilityAndBestStrategy]\)[ fateTree["\", d, f, j], \[Delta][ Last@allLagrangeRepresentatives[d, f], #2] &]\)[\([j1 + 1, \(-1\), 1, 1]\)]\)], "Input"], Cell[BoxData[ \({{}, {{{1, 1}, {{{1}, {2}}}}, {{1, 2}, {{{1, 2}, {7}}}}, {{1, 3}, {{{1}, {2}}}}, {{1, 4}, {{{1}, {2}}}}, {{2, 2}, {{{2}, {3}}}}, {{2, 3}, {{{2}, {3}}}}, {{2, 4}, {{{2}, {3}}}}, {{3, 3}, {{{}, {1}}}}, {{3, 4}, {{{}, {1}}}}, {{4, 4}, {{{}, {1}}}}}}\)], "Output"] }, Open ]], Cell["\<\ \[CapitalEAcute]largir le choix d'\[EAcute]tat pour faire appara\ \[IHat]tre une moyenne non triviale.\ \>", "Text"], Cell[BoxData[ RowBox[{ RowBox[{"strategyStateBranch", "=", RowBox[{"{", RowBox[{\({}\), ",", RowBox[{"{", RowBox[{\({{1, 1}, {{{1}, {2}}}}\), ",", \({{1, 2}, {{{1, 2}, {7}}}}\), ",", \({{1, 3}, {{{1}, {2}}}}\), ",", \({{1, 4}, {{{1}, {2}}}}\), ",", \({{2, 2}, {{{2}, {3}}}}\), ",", \({{2, 3}, {{{2}, {3}}}}\), ",", \({{2, 4}, {{{2}, {3}}}}\), ",", \({{3, 3}, {{{}, {1}}}}\), ",", \({{3, 4}, {{{}, {1}}}}\), ",", RowBox[{"{", RowBox[{\({4, 4}\), ",", RowBox[{"{", RowBox[{\({{}, {1}}\), StyleBox[",", FontColor->RGBColor[1, 0, 0]], StyleBox[\({{2}, {3}}\), FontColor->RGBColor[1, 0, 0]]}], "}"}]}], "}"}]}], "}"}]}], "}"}]}], ";"}]], "Input"], Cell[BoxData[ \(\({d =. , f =. , j =. };\)\)], "Input"], Cell[CellGroupData[{ Cell[BoxData[ \(\(myMean[\(#[\([\(-1\), 1]\)] &\) /@ Extract[nextStates, #]] &\) /@ Map[Last, Last /@ Last@strategyStateBranch, {2}]\)], "Input"], Cell[BoxData[ \({utility[1, {1}], utility[1, {1, 2}], utility[1, {1}], utility[1, {1}], utility[1, {2}], utility[1, {2}], utility[1, {2}], utility[1, {}], utility[1, {}], 1\/2\ \((utility[1, {}] + utility[1, {2}])\)}\)], "Output"] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[ \(\(#[\([1, 1]\)] &\) /@ Last@stateBranch\)], "Input"], Cell[BoxData[ \({1\/16, 1\/8, 1\/8, 1\/8, 1\/16, 1\/8, 1\/8, 1\/16, 1\/8, 1\/16}\)], "Output"] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[ \(\((\(#[\([1, 1]\)] &\) /@ Last@stateBranch)\) . \((\(myMean[\(#[\([\(-1\), 1]\)] &\) /@ Extract[nextStates, #]] &\) /@ Map[Last, Last /@ Last@strategyStateBranch, {2}])\)\)], "Input"], Cell[BoxData[ \(3\/16\ utility[1, {}] + 5\/16\ utility[1, {1}] + 5\/16\ utility[1, {2}] + 1\/32\ \((utility[1, {}] + utility[1, {2}])\) + 1\/8\ utility[1, {1, 2}]\)], "Output"] }, Open ]], Cell[BoxData[ \(\({j1, stateBranch, nextStates, strategyStateBranch} =. ;\)\)], "Input"], Cell[BoxData[{ \(\(Clear@meanMean;\)\), "\[IndentingNewLine]", \(meanMean[stateBranch_List, nextStates_List, strategyStateBranch_List] := \((\(#[\([1, 1]\)] &\) /@ Last@stateBranch)\) . \((\(myMean[\(#[\([\(-1\), 1]\)] &\) /@ Extract[nextStates, #]] &\) /@ Map[Last, Last /@ Last@strategyStateBranch, {2}])\)\)}], "Input", InitializationCell->True], Cell[CellGroupData[{ Cell[BoxData[ \(meanMean[{{}, {{{1\/16, {1, 1}}, {{{}, {1}}, {{1}, {2}}, {{1, 1}, {6}}}}, {{1\/8, {1, 2}}, {{{}, {1}}, {{1}, {2}}, {{2}, {3}}, {{1, 2}, {7}}}}, {{1\/8, {1, 3}}, {{{}, {1}}, {{1}, {2}}, {{3}, {4}}, {{1, 3}, {8}}}}, {{1\/8, {1, 4}}, {{{}, {1}}, {{1}, {2}}, {{4}, {5}}, {{1, 4}, {9}}}}, {{1\/16, {2, 2}}, {{{}, {1}}, {{2}, {3}}, {{2, 2}, {10}}}}, {{1\/8, {2, 3}}, {{{}, {1}}, {{2}, {3}}, {{3}, {4}}, {{2, 3}, {11}}}}, {{1\/8, {2, 4}}, {{{}, {1}}, {{2}, {3}}, {{4}, {5}}, {{2, 4}, {12}}}}, {{1\/16, {3, 3}}, {{{}, {1}}, {{3}, {4}}, {{3, 3}, {13}}}}, {{1\/8, {3, 4}}, {{{}, {1}}, {{3}, {4}}, {{4}, {5}}, {{3, 4}, {14}}}}, {{1\/16, {4, 4}}, {{{}, {1}}, {{4}, {5}}, {{4, 4}, {15}}}}}}, {{{}, {utility[1, {}]}}, {{1}, {utility[ 1, {1}]}}, {{2}, {utility[1, {2}]}}, {{3}, {utility[ 1, {3}]}}, {{4}, {utility[1, {4}]}}, {{1, 1}, {utility[1, {1, 1}]}}, {{1, 2}, {utility[1, {1, 2}]}}, {{1, 3}, {utility[1, {1, 3}]}}, {{1, 4}, {utility[1, {1, 4}]}}, {{2, 2}, {utility[1, {2, 2}]}}, {{2, 3}, {utility[1, {2, 3}]}}, {{2, 4}, {utility[1, {2, 4}]}}, {{3, 3}, {utility[1, {3, 3}]}}, {{3, 4}, {utility[1, {3, 4}]}}, {{4, 4}, {utility[1, {4, 4}]}}}, {{}, {{{1, 1}, {{{1}, {2}}}}, {{1, 2}, {{{1, 2}, {7}}}}, {{1, 3}, {{{1}, {2}}}}, {{1, 4}, {{{1}, {2}}}}, {{2, 2}, {{{2}, {3}}}}, {{2, 3}, {{{2}, {3}}}}, {{2, 4}, {{{2}, {3}}}}, {{3, 3}, {{{}, {1}}}}, {{3, 4}, {{{}, {1}}}}, {{4, 4}, {{{}, {1}}, {{2}, {3}}}}}}]\)], "Input"], Cell[BoxData[ \(3\/16\ utility[1, {}] + 5\/16\ utility[1, {1}] + 5\/16\ utility[1, {2}] + 1\/32\ \((utility[1, {}] + utility[1, {2}])\) + 1\/8\ utility[1, {1, 2}]\)], "Output"] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[ \(meanMean[{{1}, {{{1\/2, {1}}, {{{1}, {2}}, {{1, 1}, {4}}}}, {{1\/2, {2}}, {{{1}, {2}}, {{1, 2}, {5}}}}}}, {{{}, {utility[2, {}]}}, {{1}, {utility[ 2, {1}]}}, {{2}, {utility[2, {2}]}}, {{1, 1}, {utility[2, {1, 1}]}}, {{1, 2}, {utility[2, {1, 2}]}}, {{2, 2}, {utility[ 2, {2, 2}]}}}, {{1}, {{{1}, {{{1}, {2}}}}, {{2}, {{{1, 2}, {5}}}}}}]\)], "Input"], Cell[BoxData[ \(1\/2\ utility[2, {1}] + 1\/2\ utility[2, {1, 2}]\)], "Output"] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[ \(meanMean[{{1}, {{{1\/2, {1}}, {{{1, 1}, {1}}}}, {{1\/2, {2}}, {{{1, 2}, {2}}}}}}, {{{1, 1}, {utility[2, {1, 1}]}}, {{1, 2}, {utility[2, {1, 2}]}}, {{2, 2}, {utility[ 2, {2, 2}]}}}, {{1}, {{{1}, {{{1, 1}, {1}}}}, {{2}, {{{1, 2}, {2}}}}}}]\)], "Input"], Cell[BoxData[ \(1\/2\ utility[2, {1, 1}] + 1\/2\ utility[2, {1, 2}]\)], "Output"] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[ \(meanMean[{{1}, {{{1\/3, {1}}, {{{1}, {1}}, {{1, 1}, {2}}}}, {{2\/3, {2}}, {{{1}, {1}}, {{1, 2}, {3}}}}}}, {{{1}, {utility[{1}]}}, \ \[IndentingNewLine]{{1, 1}, {utility[{1, 1}]}}, \[IndentingNewLine]{{1, 2}, {utility[{1, 2}]}}, \[IndentingNewLine]{{2, 2}, {utility[{2, 2}]}}}, \[IndentingNewLine]{{1}, {{{1}, {{{1, 1}, {2}}, {{2, 2}, {4}}}}, {{2}, {{{1, 2}, {3}}}}}}]\)], "Input"], Cell[BoxData[ \(2\/3\ utility[{1, 2}] + 1\/6\ \((utility[{1, 1}] + utility[{2, 2}])\)\)], "Output"] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[ \(meanMean[{{}, {{{1\/4, {1, 1}}, {{{1, 1}, {1}}}}, {{1\/2, {1, 2}}, {{{1, 2}, {2}}}}, {{1\/4, {2, 2}}, {{{2, 2}, {3}}}}}}, {{{1, 1}, {\(-28\), {}}}, {{1, 2}, {\(-27\), {}}}, {{2, 2}, {\(-26\), {}}}}, {{}, {{{1, 1}, {{{1, 1}, {1}}}}, {{1, 2}, {{{1, 2}, {2}}}}, {{2, 2}, {{{2, 2}, {3}}}}}}]\)], "Input"], Cell[BoxData[ \(\(-27\)\)], "Output"] }, Open ]] }, Open ]], Cell[CellGroupData[{ Cell["Replier un niveau", "Subsection", CellTags->"c:49"], Cell[CellGroupData[{ Cell[BoxData[ \({d = 2, f = 4, j = 2}; strategyLevel = \(\(Composition[dropUtility, maxUtilityAndBestStrategy]\)[ fateTree["\", d, f, j], \[Delta][ Last@allLagrangeRepresentatives[d, f], #2] &]\)[\([2]\)]\)], "Input"], Cell[BoxData[ \({1, {{{{}, {{{1, 1}, {{{1, 1}, {1}}}}, {{1, 2}, {{{1, 2}, {2}}}}, {{1, 3}, {{{1, 3}, {3}}}}, {{1, 4}, {{{1, 4}, {4}}}}, {{2, 2}, {{{2, 2}, {5}}}}, {{2, 3}, {{{2, 3}, {6}}}}, {{2, 4}, {{{2, 4}, {7}}}}, {{3, 3}, {{{3, 3}, {8}}}}, {{3, 4}, {{{3, 4}, {9}}}}, {{4, 4}, {{{4, 4}, {10}}}}}}, {{1}, {{{1}, {{{1, 1}, {1}}}}, {{2}, {{{1, 2}, {2}}}}, {{3}, {{{1, 3}, {3}}}}, {{4}, {{{1, 4}, {4}}}}}}, {{2}, {{{1}, {{{1, 2}, {2}}}}, {{2}, {{{2, 2}, {5}}}}, {{3}, {{{2, 3}, {6}}}}, {{4}, {{{2, 4}, {7}}}}}}, {{3}, {{{1}, {{{1, 3}, {3}}}}, {{2}, {{{2, 3}, {6}}}}, {{3}, {{{3, 3}, {8}}}}, {{4}, {{{3, 4}, {9}}}}}}, {{4}, {{{1}, {{{1, 4}, {4}}}}, {{2}, {{{2, 4}, {7}}}}, {{3}, {{{3, 4}, {9}}}}, {{4}, {{{4, 4}, {10}}}}}}}, {{{1, 1}, {}}, {{1, 2}, {}}, {{1, 3}, {}}, {{1, 4}, {}}, {{2, 2}, {}}, {{2, 3}, {}}, {{2, 4}, {}}, {{3, 3}, {}}, {{3, 4}, {}}, {{4, 4}, {}}}}}\)], "Output"] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[ \(fruitCluster = Take[fructify[utility]@fateTree["\", d, f, j], \(-2\)]\)], "Input"], Cell[BoxData[ \({{1, {{{{}, {{{1\/16, {1, 1}}, {{{1, 1}, {1}}}}, {{1\/8, {1, 2}}, {{{1, 2}, {2}}}}, {{1\/8, {1, 3}}, {{{1, 3}, {3}}}}, {{1\/8, {1, 4}}, {{{1, 4}, {4}}}}, {{1\/16, {2, 2}}, {{{2, 2}, {5}}}}, {{1\/8, {2, 3}}, {{{2, 3}, {6}}}}, {{1\/8, {2, 4}}, {{{2, 4}, {7}}}}, {{1\/16, {3, 3}}, {{{3, 3}, {8}}}}, {{1\/8, {3, 4}}, {{{3, 4}, {9}}}}, {{1\/16, {4, 4}}, {{{4, 4}, {10}}}}}}, {{1}, {{{1\/4, {1}}, {{{1, 1}, {1}}}}, {{1\/4, {2}}, {{{1, 2}, {2}}}}, {{1\/4, {3}}, {{{1, 3}, {3}}}}, {{1\/4, {4}}, {{{1, 4}, {4}}}}}}, {{2}, {{{1\/4, {1}}, {{{1, 2}, {2}}}}, {{1\/4, {2}}, {{{2, 2}, {5}}}}, {{1\/4, {3}}, {{{2, 3}, {6}}}}, {{1\/4, {4}}, {{{2, 4}, {7}}}}}}, {{3}, {{{1\/4, {1}}, {{{1, 3}, {3}}}}, {{1\/4, {2}}, {{{2, 3}, {6}}}}, {{1\/4, {3}}, {{{3, 3}, {8}}}}, {{1\/4, {4}}, {{{3, 4}, {9}}}}}}, {{4}, {{{1\/4, {1}}, {{{1, 4}, {4}}}}, {{1\/4, {2}}, {{{2, 4}, {7}}}}, {{1\/4, {3}}, {{{3, 4}, {9}}}}, {{1\/4, {4}}, {{{4, 4}, {10}}}}}}}, {{{1, 1}, {utility[1, {1, 1}], {}}}, {{1, 2}, {utility[1, {1, 2}], {}}}, {{1, 3}, {utility[1, {1, 3}], {}}}, {{1, 4}, {utility[1, {1, 4}], {}}}, {{2, 2}, {utility[1, {2, 2}], {}}}, {{2, 3}, {utility[1, {2, 3}], {}}}, {{2, 4}, {utility[1, {2, 4}], {}}}, {{3, 3}, {utility[1, {3, 3}], {}}}, {{3, 4}, {utility[1, {3, 4}], {}}}, {{4, 4}, {utility[1, {4, 4}], {}}}}}}, {2, {{}, {{{1, 1}, {utility[2, {1, 1}], {}}}, {{1, 2}, {utility[2, {1, 2}], {}}}, {{1, 3}, {utility[2, {1, 3}], {}}}, {{1, 4}, {utility[2, {1, 4}], {}}}, {{2, 2}, {utility[2, {2, 2}], {}}}, {{2, 3}, {utility[2, {2, 3}], {}}}, {{2, 4}, {utility[2, {2, 4}], {}}}, {{3, 3}, {utility[2, {3, 3}], {}}}, {{3, 4}, {utility[2, {3, 4}], {}}}, {{4, 4}, {utility[2, {4, 4}], {}}}}}}}\)], "Output"] }, Open ]], Cell[BoxData[ \(\({d =. , f =. , j =. };\)\)], "Input"], Cell[CellGroupData[{ Cell[BoxData[ \(fruitCluster[\([1, \(-1\), 1]\)]\)], "Input"], Cell[BoxData[ \({{{}, {{{1\/16, {1, 1}}, {{{1, 1}, {1}}}}, {{1\/8, {1, 2}}, {{{1, 2}, {2}}}}, {{1\/8, {1, 3}}, {{{1, 3}, {3}}}}, {{1\/8, {1, 4}}, {{{1, 4}, {4}}}}, {{1\/16, {2, 2}}, {{{2, 2}, {5}}}}, {{1\/8, {2, 3}}, {{{2, 3}, {6}}}}, {{1\/8, {2, 4}}, {{{2, 4}, {7}}}}, {{1\/16, {3, 3}}, {{{3, 3}, {8}}}}, {{1\/8, {3, 4}}, {{{3, 4}, {9}}}}, {{1\/16, {4, 4}}, {{{4, 4}, {10}}}}}}, {{1}, {{{1\/4, {1}}, {{{1, 1}, {1}}}}, {{1\/4, {2}}, {{{1, 2}, {2}}}}, {{1\/4, {3}}, {{{1, 3}, {3}}}}, {{1\/4, {4}}, {{{1, 4}, {4}}}}}}, {{2}, {{{1\/4, {1}}, {{{1, 2}, {2}}}}, {{1\/4, {2}}, {{{2, 2}, {5}}}}, {{1\/4, {3}}, {{{2, 3}, {6}}}}, {{1\/4, {4}}, {{{2, 4}, {7}}}}}}, {{3}, {{{1\/4, {1}}, {{{1, 3}, {3}}}}, {{1\/4, {2}}, {{{2, 3}, {6}}}}, {{1\/4, {3}}, {{{3, 3}, {8}}}}, {{1\/4, {4}}, {{{3, 4}, {9}}}}}}, {{4}, {{{1\/4, {1}}, {{{1, 4}, {4}}}}, {{1\/4, {2}}, {{{2, 4}, {7}}}}, {{1\/4, {3}}, {{{3, 4}, {9}}}}, {{1\/4, {4}}, {{{4, 4}, {10}}}}}}}\)], "Output"] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[ RowBox[{"nextStates", "=", RowBox[{"Flatten", "[", RowBox[{ StyleBox[\(fruitCluster[\([\(-1\), \(-1\)]\)]\), FontColor->GrayLevel[0]], ",", "1"}], "]"}]}]], "Input"], Cell[BoxData[ \({{{1, 1}, {utility[2, {1, 1}], {}}}, {{1, 2}, {utility[2, {1, 2}], {}}}, {{1, 3}, {utility[2, {1, 3}], {}}}, {{1, 4}, {utility[2, {1, 4}], {}}}, {{2, 2}, {utility[2, {2, 2}], {}}}, {{2, 3}, {utility[2, {2, 3}], {}}}, {{2, 4}, {utility[2, {2, 4}], {}}}, {{3, 3}, {utility[2, {3, 3}], {}}}, {{3, 4}, {utility[2, {3, 4}], {}}}, {{4, 4}, {utility[2, {4, 4}], {}}}}\)], "Output"] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[ \(strategyLevel[\([\(-1\), 1]\)]\)], "Input"], Cell[BoxData[ \({{{}, {{{1, 1}, {{{1, 1}, {1}}}}, {{1, 2}, {{{1, 2}, {2}}}}, {{1, 3}, {{{1, 3}, {3}}}}, {{1, 4}, {{{1, 4}, {4}}}}, {{2, 2}, {{{2, 2}, {5}}}}, {{2, 3}, {{{2, 3}, {6}}}}, {{2, 4}, {{{2, 4}, {7}}}}, {{3, 3}, {{{3, 3}, {8}}}}, {{3, 4}, {{{3, 4}, {9}}}}, {{4, 4}, {{{4, 4}, {10}}}}}}, {{1}, {{{1}, {{{1, 1}, {1}}}}, {{2}, {{{1, 2}, {2}}}}, {{3}, {{{1, 3}, {3}}}}, {{4}, {{{1, 4}, {4}}}}}}, {{2}, {{{1}, {{{1, 2}, {2}}}}, {{2}, {{{2, 2}, {5}}}}, {{3}, {{{2, 3}, {6}}}}, {{4}, {{{2, 4}, {7}}}}}}, {{3}, {{{1}, {{{1, 3}, {3}}}}, {{2}, {{{2, 3}, {6}}}}, {{3}, {{{3, 3}, {8}}}}, {{4}, {{{3, 4}, {9}}}}}}, {{4}, {{{1}, {{{1, 4}, {4}}}}, {{2}, {{{2, 4}, {7}}}}, {{3}, {{{3, 4}, {9}}}}, {{4}, {{{4, 4}, {10}}}}}}}\)], "Output"] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[ \(MapThread[ meanMean[#1, nextStates, #2] &, {fruitCluster[\([1, \(-1\), 1]\)], strategyLevel[\([\(-1\), 1]\)]}]\)], "Input"], Cell[BoxData[ \({1\/16\ utility[2, {1, 1}] + 1\/8\ utility[2, {1, 2}] + 1\/8\ utility[2, {1, 3}] + 1\/8\ utility[2, {1, 4}] + 1\/16\ utility[2, {2, 2}] + 1\/8\ utility[2, {2, 3}] + 1\/8\ utility[2, {2, 4}] + 1\/16\ utility[2, {3, 3}] + 1\/8\ utility[2, {3, 4}] + 1\/16\ utility[2, {4, 4}], 1\/4\ utility[2, {1, 1}] + 1\/4\ utility[2, {1, 2}] + 1\/4\ utility[2, {1, 3}] + 1\/4\ utility[2, {1, 4}], 1\/4\ utility[2, {1, 2}] + 1\/4\ utility[2, {2, 2}] + 1\/4\ utility[2, {2, 3}] + 1\/4\ utility[2, {2, 4}], 1\/4\ utility[2, {1, 3}] + 1\/4\ utility[2, {2, 3}] + 1\/4\ utility[2, {3, 3}] + 1\/4\ utility[2, {3, 4}], 1\/4\ utility[2, {1, 4}] + 1\/4\ utility[2, {2, 4}] + 1\/4\ utility[2, {3, 4}] + 1\/4\ utility[2, {4, 4}]}\)], "Output"] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[ \(utility = \[Delta][{3, 4}, #2] &; %\)], "Input"], Cell[BoxData[ \({1\/8, 0, 0, 1\/4, 1\/4}\)], "Output"] }, Open ]], Cell[TextData[{ "Produire toutes les utilit\[EAcute]s en r\[EAcute]p\[EAcute]tant la strat\ \[EAcute]gie, au format de ", StyleBox["maxUtilityAndBestStrategy", "Output"], ". \[WarningSign] R\[EAcute]p\[EAcute]ter la strat\[EAcute]gie en option \ seulement (", Cell[BoxData[ \(TraditionalForm\`repeat \[Rule] True\)]], ")." }], "Text"], Cell[CellGroupData[{ Cell[BoxData[ \(First /@ fruitCluster[\([1, \(-1\), 1]\)]\)], "Input"], Cell[BoxData[ \({{}, {1}, {2}, {3}, {4}}\)], "Output"] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[ \(Transpose@{First /@ fruitCluster[\([1, \(-1\), 1]\)], MapThread[{meanMean[#1, nextStates, #2], Last@#2} &, {fruitCluster[\([1, \(-1\), 1]\)], strategyLevel[\([\(-1\), 1]\)]}]}\)], "Input"], Cell[BoxData[ \({{{}, {1\/8, {{{1, 1}, {{{1, 1}, {1}}}}, {{1, 2}, {{{1, 2}, {2}}}}, {{1, 3}, {{{1, 3}, {3}}}}, {{1, 4}, {{{1, 4}, {4}}}}, {{2, 2}, {{{2, 2}, {5}}}}, {{2, 3}, {{{2, 3}, {6}}}}, {{2, 4}, {{{2, 4}, {7}}}}, {{3, 3}, {{{3, 3}, {8}}}}, {{3, 4}, {{{3, 4}, {9}}}}, {{4, 4}, {{{4, 4}, {10}}}}}}}, {{1}, {0, {{{1}, {{{1, 1}, {1}}}}, {{2}, {{{1, 2}, {2}}}}, {{3}, {{{1, 3}, {3}}}}, {{4}, {{{1, 4}, {4}}}}}}}, {{2}, {0, {{{1}, {{{1, 2}, {2}}}}, {{2}, {{{2, 2}, {5}}}}, {{3}, {{{2, 3}, {6}}}}, {{4}, {{{2, 4}, {7}}}}}}}, {{3}, {1\/4, {{{1}, {{{1, 3}, {3}}}}, {{2}, {{{2, 3}, {6}}}}, {{3}, {{{3, 3}, {8}}}}, {{4}, {{{3, 4}, {9}}}}}}}, {{4}, {1\/4, {{{1}, {{{1, 4}, {4}}}}, {{2}, {{{2, 4}, {7}}}}, {{3}, {{{3, 4}, {9}}}}, {{4}, {{{4, 4}, {10}}}}}}}}\)], "Output"] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[ \(First@fruitCluster\)], "Input"], Cell[BoxData[ \({1, {{{{}, {{{1\/16, {1, 1}}, {{{1, 1}, {1}}}}, {{1\/8, {1, 2}}, {{{1, 2}, {2}}}}, {{1\/8, {1, 3}}, {{{1, 3}, {3}}}}, {{1\/8, {1, 4}}, {{{1, 4}, {4}}}}, {{1\/16, {2, 2}}, {{{2, 2}, {5}}}}, {{1\/8, {2, 3}}, {{{2, 3}, {6}}}}, {{1\/8, {2, 4}}, {{{2, 4}, {7}}}}, {{1\/16, {3, 3}}, {{{3, 3}, {8}}}}, {{1\/8, {3, 4}}, {{{3, 4}, {9}}}}, {{1\/16, {4, 4}}, {{{4, 4}, {10}}}}}}, {{1}, {{{1\/4, {1}}, {{{1, 1}, {1}}}}, {{1\/4, {2}}, {{{1, 2}, {2}}}}, {{1\/4, {3}}, {{{1, 3}, {3}}}}, {{1\/4, {4}}, {{{1, 4}, {4}}}}}}, {{2}, {{{1\/4, {1}}, {{{1, 2}, {2}}}}, {{1\/4, {2}}, {{{2, 2}, {5}}}}, {{1\/4, {3}}, {{{2, 3}, {6}}}}, {{1\/4, {4}}, {{{2, 4}, {7}}}}}}, {{3}, {{{1\/4, {1}}, {{{1, 3}, {3}}}}, {{1\/4, {2}}, {{{2, 3}, {6}}}}, {{1\/4, {3}}, {{{3, 3}, {8}}}}, {{1\/4, {4}}, {{{3, 4}, {9}}}}}}, {{4}, {{{1\/4, {1}}, {{{1, 4}, {4}}}}, {{1\/4, {2}}, {{{2, 4}, {7}}}}, {{1\/4, {3}}, {{{3, 4}, {9}}}}, {{1\/4, {4}}, {{{4, 4}, {10}}}}}}}, {{{1, 1}, {0, {}}}, {{1, 2}, {0, {}}}, {{1, 3}, {0, {}}}, {{1, 4}, {0, {}}}, {{2, 2}, {0, {}}}, {{2, 3}, {0, {}}}, {{2, 4}, {0, {}}}, {{3, 3}, {0, {}}}, {{3, 4}, {1, {}}}, {{4, 4}, {0, {}}}}}}\)], "Output"] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[ \(ReplacePart[\[IndentingNewLine]First@ fruitCluster, \[IndentingNewLine]Transpose@{First /@ fruitCluster[\([1, \(-1\), 1]\)], MapThread[{meanMean[#1, nextStates, #2], Last@#2} &, {fruitCluster[\([1, \(-1\), 1]\)], strategyLevel[\([\(-1\), 1]\)]}]}, {\(-1\), 1}]\)], "Input"], Cell[BoxData[ \({1, {{{{}, {1\/8, {{{1, 1}, {{{1, 1}, {1}}}}, {{1, 2}, {{{1, 2}, {2}}}}, {{1, 3}, {{{1, 3}, {3}}}}, {{1, 4}, {{{1, 4}, {4}}}}, {{2, 2}, {{{2, 2}, {5}}}}, {{2, 3}, {{{2, 3}, {6}}}}, {{2, 4}, {{{2, 4}, {7}}}}, {{3, 3}, {{{3, 3}, {8}}}}, {{3, 4}, {{{3, 4}, {9}}}}, {{4, 4}, {{{4, 4}, {10}}}}}}}, {{1}, {0, {{{1}, {{{1, 1}, {1}}}}, {{2}, {{{1, 2}, {2}}}}, {{3}, {{{1, 3}, {3}}}}, {{4}, {{{1, 4}, {4}}}}}}}, {{2}, {0, {{{1}, {{{1, 2}, {2}}}}, {{2}, {{{2, 2}, {5}}}}, {{3}, {{{2, 3}, {6}}}}, {{4}, {{{2, 4}, {7}}}}}}}, {{3}, {1\/4, {{{1}, {{{1, 3}, {3}}}}, {{2}, {{{2, 3}, {6}}}}, {{3}, {{{3, 3}, {8}}}}, {{4}, {{{3, 4}, {9}}}}}}}, {{4}, {1\/4, {{{1}, {{{1, 4}, {4}}}}, {{2}, {{{2, 4}, {7}}}}, {{3}, {{{3, 4}, {9}}}}, {{4}, {{{4, 4}, {10}}}}}}}}, {{{1, 1}, {0, {}}}, {{1, 2}, {0, {}}}, {{1, 3}, {0, {}}}, {{1, 4}, {0, {}}}, {{2, 2}, {0, {}}}, {{2, 3}, {0, {}}}, {{2, 4}, {0, {}}}, {{3, 3}, {0, {}}}, {{3, 4}, {1, {}}}, {{4, 4}, {0, {}}}}}}\)], "Output"] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[ \(nextStates =. ; With[\[IndentingNewLine]{nextStates = Flatten[fruitCluster[\([\(-1\), \(-1\)]\)], 1]}, \[IndentingNewLine]ReplacePart[\[IndentingNewLine]First@ fruitCluster, \[IndentingNewLine]Transpose@{First /@ fruitCluster[\([1, \(-1\), 1]\)], MapThread[{meanMean[#1, nextStates, #2], Last@#2} &, {fruitCluster[\([1, \(-1\), 1]\)], strategyLevel[\([\(-1\), 1]\)]}]}, {\(-1\), 1}]\[IndentingNewLine]]\)], "Input"], Cell[BoxData[ \({1, {{{{}, {1\/8, {{{1, 1}, {{{1, 1}, {1}}}}, {{1, 2}, {{{1, 2}, {2}}}}, {{1, 3}, {{{1, 3}, {3}}}}, {{1, 4}, {{{1, 4}, {4}}}}, {{2, 2}, {{{2, 2}, {5}}}}, {{2, 3}, {{{2, 3}, {6}}}}, {{2, 4}, {{{2, 4}, {7}}}}, {{3, 3}, {{{3, 3}, {8}}}}, {{3, 4}, {{{3, 4}, {9}}}}, {{4, 4}, {{{4, 4}, {10}}}}}}}, {{1}, {0, {{{1}, {{{1, 1}, {1}}}}, {{2}, {{{1, 2}, {2}}}}, {{3}, {{{1, 3}, {3}}}}, {{4}, {{{1, 4}, {4}}}}}}}, {{2}, {0, {{{1}, {{{1, 2}, {2}}}}, {{2}, {{{2, 2}, {5}}}}, {{3}, {{{2, 3}, {6}}}}, {{4}, {{{2, 4}, {7}}}}}}}, {{3}, {1\/4, {{{1}, {{{1, 3}, {3}}}}, {{2}, {{{2, 3}, {6}}}}, {{3}, {{{3, 3}, {8}}}}, {{4}, {{{3, 4}, {9}}}}}}}, {{4}, {1\/4, {{{1}, {{{1, 4}, {4}}}}, {{2}, {{{2, 4}, {7}}}}, {{3}, {{{3, 4}, {9}}}}, {{4}, {{{4, 4}, {10}}}}}}}}, {{{1, 1}, {0, {}}}, {{1, 2}, {0, {}}}, {{1, 3}, {0, {}}}, {{1, 4}, {0, {}}}, {{2, 2}, {0, {}}}, {{2, 3}, {0, {}}}, {{2, 4}, {0, {}}}, {{3, 3}, {0, {}}}, {{3, 4}, {1, {}}}, {{4, 4}, {0, {}}}}}}\)], "Output"] }, Open ]], Cell[BoxData[ \(\({fruitCluster, strategyLevel, utility} =. ;\)\)], "Input"], Cell[BoxData[{ \(\(Clear@meanMeanLevel;\)\), "\[IndentingNewLine]", \(meanMeanLevel[fruitCluster_List, strategyLevel_List] := \[IndentingNewLine]ReplacePart[\ \[IndentingNewLine]First@ fruitCluster, \[IndentingNewLine]Transpose@{First /@ fruitCluster[\([1, \(-1\), 1]\)], MapThread[{meanMean[#1, Flatten[fruitCluster[\([\(-1\), \(-1\)]\)], 1], #2], Last@#2} &, {fruitCluster[\([1, \(-1\), 1]\)], strategyLevel[\([\(-1\), 1]\)]}]}, {\(-1\), 1}]\)}], "Input", InitializationCell->True], Cell[CellGroupData[{ Cell[BoxData[ \(meanMeanLevel[{{1, {{{{}, {{{1\/16, {1, 1}}, {{{1, 1}, {1}}}}, {{1\/8, {1, 2}}, {{{1, 2}, {2}}}}, {{1\/8, {1, 3}}, {{{1, 3}, {3}}}}, {{1\/8, {1, 4}}, {{{1, 4}, {4}}}}, {{1\/16, {2, 2}}, {{{2, 2}, {5}}}}, {{1\/8, {2, 3}}, {{{2, 3}, {6}}}}, {{1\/8, {2, 4}}, {{{2, 4}, {7}}}}, {{1\/16, {3, 3}}, {{{3, 3}, {8}}}}, {{1\/8, {3, 4}}, {{{3, 4}, {9}}}}, {{1\/16, {4, 4}}, {{{4, 4}, {10}}}}}}, {{1}, {{{1\/4, {1}}, {{{1, 1}, {1}}}}, {{1\/4, {2}}, {{{1, 2}, {2}}}}, {{1\/4, {3}}, {{{1, 3}, {3}}}}, {{1\/4, {4}}, {{{1, 4}, {4}}}}}}, {{2}, {{{1\/4, {1}}, {{{1, 2}, {2}}}}, {{1\/4, {2}}, {{{2, 2}, {5}}}}, {{1\/4, {3}}, {{{2, 3}, {6}}}}, {{1\/4, {4}}, {{{2, 4}, {7}}}}}}, {{3}, {{{1\/4, {1}}, {{{1, 3}, {3}}}}, {{1\/4, {2}}, {{{2, 3}, {6}}}}, {{1\/4, {3}}, {{{3, 3}, {8}}}}, {{1\/4, {4}}, {{{3, 4}, {9}}}}}}, {{4}, {{{1\/4, {1}}, {{{1, 4}, {4}}}}, {{1\/4, {2}}, {{{2, 4}, {7}}}}, {{1\/4, {3}}, {{{3, 4}, {9}}}}, {{1\/4, {4}}, {{{4, 4}, {10}}}}}}}, {{{1, 1}, {0, {}}}, {{1, 2}, {0, {}}}, {{1, 3}, {0, {}}}, {{1, 4}, {0, {}}}, {{2, 2}, {0, {}}}, {{2, 3}, {0, {}}}, {{2, 4}, {0, {}}}, {{3, 3}, {0, {}}}, {{3, 4}, {1, {}}}, {{4, 4}, {0, {}}}}}}, {2, {{}, {{{1, 1}, {0, {}}}, {{1, 2}, {0, {}}}, {{1, 3}, {0, {}}}, {{1, 4}, {0, {}}}, {{2, 2}, {0, {}}}, {{2, 3}, {0, {}}}, {{2, 4}, {0, {}}}, {{3, 3}, {0, {}}}, {{3, 4}, {1, {}}}, {{4, 4}, {0, {}}}}}}}, {1, {{{{}, {{{1, 1}, {{{1, 1}, {1}}}}, {{1, 2}, {{{1, 2}, {2}}}}, {{1, 3}, {{{1, 3}, {3}}}}, {{1, 4}, {{{1, 4}, {4}}}}, {{2, 2}, {{{2, 2}, {5}}}}, {{2, 3}, {{{2, 3}, {6}}}}, {{2, 4}, {{{2, 4}, {7}}}}, {{3, 3}, {{{3, 3}, {8}}}}, {{3, 4}, {{{3, 4}, {9}}}}, {{4, 4}, {{{4, 4}, {10}}}}}}, {{1}, {{{1}, {{{1, 1}, {1}}}}, {{2}, {{{1, 2}, {2}}}}, {{3}, {{{1, 3}, {3}}}}, {{4}, {{{1, 4}, {4}}}}}}, {{2}, {{{1}, {{{1, 2}, {2}}}}, {{2}, {{{2, 2}, {5}}}}, {{3}, {{{2, 3}, {6}}}}, {{4}, {{{2, 4}, {7}}}}}}, {{3}, {{{1}, {{{1, 3}, {3}}}}, {{2}, {{{2, 3}, {6}}}}, {{3}, {{{3, 3}, {8}}}}, {{4}, {{{3, 4}, {9}}}}}}, {{4}, {{{1}, {{{1, 4}, {4}}}}, {{2}, {{{2, 4}, {7}}}}, {{3}, {{{3, 4}, {9}}}}, {{4}, {{{4, 4}, {10}}}}}}}, {{{1, 1}, {}}, {{1, 2}, {}}, {{1, 3}, {}}, {{1, 4}, {}}, {{2, 2}, {}}, {{2, 3}, {}}, {{2, 4}, {}}, {{3, 3}, {}}, {{3, 4}, {}}, {{4, 4}, {}}}}}]\)], "Input"], Cell[BoxData[ \({1, {{{{}, {1\/8, {{{1, 1}, {{{1, 1}, {1}}}}, {{1, 2}, {{{1, 2}, {2}}}}, {{1, 3}, {{{1, 3}, {3}}}}, {{1, 4}, {{{1, 4}, {4}}}}, {{2, 2}, {{{2, 2}, {5}}}}, {{2, 3}, {{{2, 3}, {6}}}}, {{2, 4}, {{{2, 4}, {7}}}}, {{3, 3}, {{{3, 3}, {8}}}}, {{3, 4}, {{{3, 4}, {9}}}}, {{4, 4}, {{{4, 4}, {10}}}}}}}, {{1}, {0, {{{1}, {{{1, 1}, {1}}}}, {{2}, {{{1, 2}, {2}}}}, {{3}, {{{1, 3}, {3}}}}, {{4}, {{{1, 4}, {4}}}}}}}, {{2}, {0, {{{1}, {{{1, 2}, {2}}}}, {{2}, {{{2, 2}, {5}}}}, {{3}, {{{2, 3}, {6}}}}, {{4}, {{{2, 4}, {7}}}}}}}, {{3}, {1\/4, {{{1}, {{{1, 3}, {3}}}}, {{2}, {{{2, 3}, {6}}}}, {{3}, {{{3, 3}, {8}}}}, {{4}, {{{3, 4}, {9}}}}}}}, {{4}, {1\/4, {{{1}, {{{1, 4}, {4}}}}, {{2}, {{{2, 4}, {7}}}}, {{3}, {{{3, 4}, {9}}}}, {{4}, {{{4, 4}, {10}}}}}}}}, {{{1, 1}, {0, {}}}, {{1, 2}, {0, {}}}, {{1, 3}, {0, {}}}, {{1, 4}, {0, {}}}, {{2, 2}, {0, {}}}, {{2, 3}, {0, {}}}, {{2, 4}, {0, {}}}, {{3, 3}, {0, {}}}, {{3, 4}, {1, {}}}, {{4, 4}, {0, {}}}}}}\)], "Output"] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[ \(meanMeanLevel[{{1, {{{{}, {{{1\/4, {1, 1}}, {{{1, 1}, {1}}}}, {{1\/2, {1, 2}}, {{{1, 2}, {2}}}}, {{1\/4, {2, 2}}, {{{2, 2}, {3}}}}}}, {{1}, {{{1\/2, {1}}, {{{1, 1}, {1}}}}, {{1\/2, {2}}, {{{1, 2}, {2}}}}}}, {{2}, {{{1\/2, {1}}, {{{1, 2}, {2}}}}, {{1\/2, {2}}, {{{2, 2}, {3}}}}}}}, {{{1, 1}, {\(-8\), {}}}, {{1, 2}, {\(-7\), {}}}, {{2, 2}, {\(-6\), {}}}}}}, {2, {{}, {{{1, 1}, {\(-18\), {}}}, {{1, 2}, {\(-17\), {}}}, {{2, 2}, {\(-16\), {}}}}}}}, {1, {{{{}, {{{1, 1}, {{{1, 1}, {1}}}}, {{1, 2}, {{{1, 2}, {2}}}}, {{2, 2}, {{{2, 2}, {3}}}}}}, {{1}, {{{1}, {{{1, 1}, {1}}}}, {{2}, {{{1, 2}, {2}}}}}}, {{2}, {{{1}, {{{1, 2}, {2}}}}, {{2}, {{{2, 2}, {3}}}}}}}, {{{1, 1}, {}}, {{1, 2}, {}}, {{2, 2}, {}}}}}]\)], "Input"], Cell[BoxData[ \({1, {{{{}, {\(-17\), {{{1, 1}, {{{1, 1}, {1}}}}, {{1, 2}, {{{1, 2}, {2}}}}, {{2, 2}, {{{2, 2}, {3}}}}}}}, {{1}, {\(-\(35\/2\)\), {{{1}, {{{1, 1}, {1}}}}, {{2}, {{{1, 2}, {2}}}}}}}, {{2}, {\(-\(33\/2\)\), {{{1}, {{{1, 2}, {2}}}}, {{2}, {{{2, 2}, {3}}}}}}}}, {{{1, 1}, {\(-8\), {}}}, {{1, 2}, {\(-7\), {}}}, {{2, 2}, {\(-6\), {}}}}}}\)], "Output"] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[ \(1/16\ 1/8 + 1/8\ 1/8\)], "Input"], Cell[BoxData[ \(3\/128\)], "Output"] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[ \(meanMeanLevel[{{0, {{{{}, {{{1\/16, {1, 1}}, {{{}, {1}}, {{1}, {2}}, {{1, 1}, {6}}}}, {{1\/8, {1, 2}}, {{{}, {1}}, {{1}, {2}}, {{2}, {3}}, {{1, 2}, {7}}}}, {{1\/8, {1, 3}}, {{{}, {1}}, {{1}, {2}}, {{3}, {4}}, {{1, 3}, {8}}}}, {{1\/8, {1, 4}}, {{{}, {1}}, {{1}, {2}}, {{4}, {5}}, {{1, 4}, {9}}}}, {{1\/16, {2, 2}}, {{{}, {1}}, {{2}, {3}}, {{2, 2}, {10}}}}, {{1\/8, {2, 3}}, {{{}, {1}}, {{2}, {3}}, {{3}, {4}}, {{2, 3}, {11}}}}, {{1\/8, {2, 4}}, {{{}, {1}}, {{2}, {3}}, {{4}, {5}}, {{2, 4}, {12}}}}, {{1\/16, {3, 3}}, {{{}, {1}}, {{3}, {4}}, {{3, 3}, {13}}}}, {{1\/8, {3, 4}}, {{{}, {1}}, {{3}, {4}}, {{4}, {5}}, {{3, 4}, {14}}}}, {{1\/16, {4, 4}}, {{{}, {1}}, {{4}, {5}}, {{4, 4}, {15}}}}}}}, {}}}, {1, {{{{}, {1\/8, {{{1, 1}, {{{1, 1}, {1}}}}, {{1, 2}, {{{1, 2}, {2}}}}, {{1, 3}, {{{1, 3}, {3}}}}, {{1, 4}, {{{1, 4}, {4}}}}, {{2, 2}, {{{2, 2}, {5}}}}, {{2, 3}, {{{2, 3}, {6}}}}, {{2, 4}, {{{2, 4}, {7}}}}, {{3, 3}, {{{3, 3}, {8}}}}, {{3, 4}, {{{3, 4}, {9}}}}, {{4, 4}, {{{4, 4}, {10}}}}}}}, {{1}, {0, {{{1}, {{{1, 1}, {1}}}}, {{2}, {{{1, 2}, {2}}}}, {{3}, {{{1, 3}, {3}}}}, {{4}, {{{1, 4}, {4}}}}}}}, {{2}, {0, {{{1}, {{{1, 2}, {2}}}}, {{2}, {{{2, 2}, {5}}}}, {{3}, {{{2, 3}, {6}}}}, {{4}, {{{2, 4}, {7}}}}}}}, {{3}, {1\/4, {{{1}, {{{1, 3}, {3}}}}, {{2}, {{{2, 3}, {6}}}}, {{3}, {{{3, 3}, {8}}}}, {{4}, {{{3, 4}, {9}}}}}}}, {{4}, {1\/4, {{{1}, {{{1, 4}, {4}}}}, {{2}, {{{2, 4}, {7}}}}, {{3}, {{{3, 4}, {9}}}}, {{4}, {{{4, 4}, {10}}}}}}}}, {{{1, 1}, {0, {}}}, {{1, 2}, {0, {}}}, {{1, 3}, {0, {}}}, {{1, 4}, {0, {}}}, {{2, 2}, {0, {}}}, {{2, 3}, {0, {}}}, {{2, 4}, {0, {}}}, {{3, 3}, {0, {}}}, {{3, 4}, {1, {}}}, {{4, 4}, {0, {}}}}}}}, {0, {{{{}, {{{1, 1}, {{{1}, {2}}}}, {{1, 2}, {{{1, 2}, {7}}}}, {{1, 3}, {{{1}, {2}}}}, {{1, 4}, {{{1}, {2}}}}, {{2, 2}, {{{2}, {3}}}}, {{2, 3}, {{{2}, {3}}}}, {{2, 4}, {{{2}, {3}}}}, {{3, 3}, {{{}, {1}}}}, {{3, 4}, {{{}, {1}}}}, {{4, 4}, {{{}, {1}}}}}}}, {}}}]\)], "Input"], Cell[BoxData[ \({0, {{{{}, {1\/32, {{{1, 1}, {{{1}, {2}}}}, {{1, 2}, {{{1, 2}, {7}}}}, {{1, 3}, {{{1}, {2}}}}, {{1, 4}, {{{1}, {2}}}}, {{2, 2}, {{{2}, {3}}}}, {{2, 3}, {{{2}, {3}}}}, {{2, 4}, {{{2}, {3}}}}, {{3, 3}, {{{}, {1}}}}, {{3, 4}, {{{}, {1}}}}, {{4, 4}, {{{}, {1}}}}}}}}, {}}}\)], "Output"] }, Open ]] }, Open ]], Cell[CellGroupData[{ Cell["R\[EAcute]currence \[AGrave] rebours sur les niveaux", "Subsection", CellTags->"c:50"], Cell[CellGroupData[{ Cell[BoxData[{ \({d = 2, f = 2, j = 3}; Clear@t; Clear@s;\), "\[IndentingNewLine]", \(fructifiedFateTree = t /@ Range[0, j]\), "\[IndentingNewLine]", \(strategy = s /@ Range[0, j]\)}], "Input"], Cell[BoxData[ \({t[0], t[1], t[2], t[3]}\)], "Output"], Cell[BoxData[ \({s[0], s[1], s[2], s[3]}\)], "Output"] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[ \(Transpose[dropLast /@ {fructifiedFateTree, strategy}]\)], "Input"], Cell[BoxData[ \({{t[0], s[0]}, {t[1], s[1]}, {t[2], s[2]}}\)], "Output"] }, Open ]], Cell[TextData[{ "\[Wolf] Il faut que ", StyleBox["meanMeanLevel", "Output"], " formatte les utilit\[EAcute]s comme au dernier niveau de l'arbre du \ destin." }], "Text"], Cell[CellGroupData[{ Cell[BoxData[ \(scanPrint@ reverseFoldList[mml[{First@#1, #2}, Last@#1] &, Transpose[dropLast /@ {fructifiedFateTree, strategy}], Last@fructifiedFateTree]\)], "Input"], Cell[BoxData[ \(mml[{t[0], mml[{t[1], mml[{t[2], t[3]}, s[2]]}, s[1]]}, s[0]]\)], "Print"], Cell[BoxData[ \(mml[{t[1], mml[{t[2], t[3]}, s[2]]}, s[1]]\)], "Print"], Cell[BoxData[ \(mml[{t[2], t[3]}, s[2]]\)], "Print"], Cell[BoxData[ \(t[3]\)], "Print"] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[ \(reverseFoldList[function1, {a, b}, x]\)], "Input"], Cell[BoxData[ \({function1[a, function1[b, x]], function1[b, x], x}\)], "Output"] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[ \(scanPrint@ reverseFoldList[ mml[{First@#1, #2}, Last@#1] &, {{t[0], s[0]}, {t[1], s[1]}, {t[2], s[2]}}, t[3]]\)], "Input"], Cell[BoxData[ \(mml[{t[0], mml[{t[1], mml[{t[2], t[3]}, s[2]]}, s[1]]}, s[0]]\)], "Print"], Cell[BoxData[ \(mml[{t[1], mml[{t[2], t[3]}, s[2]]}, s[1]]\)], "Print"], Cell[BoxData[ \(mml[{t[2], t[3]}, s[2]]\)], "Print"], Cell[BoxData[ \(t[3]\)], "Print"] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[{ \({d = 2, f = 4, j = 2}; fructifiedFateTree = t /@ Range[0, j]\), "\[IndentingNewLine]", \(strategy = s /@ Range[0, j]\)}], "Input"], Cell[BoxData[ \({t[0], t[1], t[2]}\)], "Output"], Cell[BoxData[ \({s[0], s[1], s[2]}\)], "Output"] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[ \(scanPrint@ reverseFoldList[mml[{First@#1, #2}, Last@#1] &, Transpose[dropLast /@ {fructifiedFateTree, strategy}], Last@fructifiedFateTree]\)], "Input"], Cell[BoxData[ \(mml[{t[0], mml[{t[1], t[2]}, s[1]]}, s[0]]\)], "Print"], Cell[BoxData[ \(mml[{t[1], t[2]}, s[1]]\)], "Print"], Cell[BoxData[ \(t[2]\)], "Print"] }, Open ]], Cell[BoxData[{ \(\(strategy = \(Composition[dropUtility, maxUtilityAndBestStrategy]\)[ fateTree["\", d, f, j], \[Delta][ Last@allLagrangeRepresentatives[d, f], #2] &];\)\), "\[IndentingNewLine]", \(\(fructifiedFateTree = fructify[\[Delta][{3, 4}, #2] &]@ fateTree["\", d, f, j];\)\)}], "Input"], Cell[BoxData[ \(\({d =. , f =. , j =. };\)\)], "Input"], Cell[CellGroupData[{ Cell[BoxData[ \(reverseFoldList[meanMeanLevel[{First@#1, #2}, Last@#1] &, Transpose[dropLast /@ {fructifiedFateTree, strategy}], Last@fructifiedFateTree]\)], "Input"], Cell[BoxData[ \({{0, {{{{}, {1\/32, {{{1, 1}, {{{1}, {2}}}}, {{1, 2}, {{{1, 2}, {7}}}}, {{1, 3}, {{{1}, {2}}}}, {{1, 4}, {{{1}, {2}}}}, {{2, 2}, {{{2}, {3}}}}, {{2, 3}, {{{2}, {3}}}}, {{2, 4}, {{{2}, {3}}}}, {{3, 3}, {{{}, {1}}}}, {{3, 4}, {{{}, {1}}}}, {{4, 4}, {{{}, {1}}}}}}}}, {}}}, {1, {{{{}, {1\/8, {{{1, 1}, {{{1, 1}, {1}}}}, {{1, 2}, {{{1, 2}, {2}}}}, {{1, 3}, {{{1, 3}, {3}}}}, {{1, 4}, {{{1, 4}, {4}}}}, {{2, 2}, {{{2, 2}, {5}}}}, {{2, 3}, {{{2, 3}, {6}}}}, {{2, 4}, {{{2, 4}, {7}}}}, {{3, 3}, {{{3, 3}, {8}}}}, {{3, 4}, {{{3, 4}, {9}}}}, {{4, 4}, {{{4, 4}, {10}}}}}}}, {{1}, {0, {{{1}, {{{1, 1}, {1}}}}, {{2}, {{{1, 2}, {2}}}}, {{3}, {{{1, 3}, {3}}}}, {{4}, {{{1, 4}, {4}}}}}}}, {{2}, {0, {{{1}, {{{1, 2}, {2}}}}, {{2}, {{{2, 2}, {5}}}}, {{3}, {{{2, 3}, {6}}}}, {{4}, {{{2, 4}, {7}}}}}}}, {{3}, {1\/4, {{{1}, {{{1, 3}, {3}}}}, {{2}, {{{2, 3}, {6}}}}, {{3}, {{{3, 3}, {8}}}}, {{4}, {{{3, 4}, {9}}}}}}}, {{4}, {1\/4, {{{1}, {{{1, 4}, {4}}}}, {{2}, {{{2, 4}, {7}}}}, {{3}, {{{3, 4}, {9}}}}, {{4}, {{{4, 4}, {10}}}}}}}}, {{{1, 1}, {0, {}}}, {{1, 2}, {0, {}}}, {{1, 3}, {0, {}}}, {{1, 4}, {0, {}}}, {{2, 2}, {0, {}}}, {{2, 3}, {0, {}}}, {{2, 4}, {0, {}}}, {{3, 3}, {0, {}}}, {{3, 4}, {1, {}}}, {{4, 4}, {0, {}}}}}}, {2, {{}, {{{1, 1}, {0, {}}}, {{1, 2}, {0, {}}}, {{1, 3}, {0, {}}}, {{1, 4}, {0, {}}}, {{2, 2}, {0, {}}}, {{2, 3}, {0, {}}}, {{2, 4}, {0, {}}}, {{3, 3}, {0, {}}}, {{3, 4}, {1, {}}}, {{4, 4}, {0, {}}}}}}}\)], "Output"] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[ \(meanMeanLevel[{fructifiedFateTree[\([2]\)], fructifiedFateTree[\([3]\)]}, strategy[\([2]\)]]\)], "Input"], Cell[BoxData[ \({1, {{{{}, {1\/8, {{{1, 1}, {{{1, 1}, {1}}}}, {{1, 2}, {{{1, 2}, {2}}}}, {{1, 3}, {{{1, 3}, {3}}}}, {{1, 4}, {{{1, 4}, {4}}}}, {{2, 2}, {{{2, 2}, {5}}}}, {{2, 3}, {{{2, 3}, {6}}}}, {{2, 4}, {{{2, 4}, {7}}}}, {{3, 3}, {{{3, 3}, {8}}}}, {{3, 4}, {{{3, 4}, {9}}}}, {{4, 4}, {{{4, 4}, {10}}}}}}}, {{1}, {0, {{{1}, {{{1, 1}, {1}}}}, {{2}, {{{1, 2}, {2}}}}, {{3}, {{{1, 3}, {3}}}}, {{4}, {{{1, 4}, {4}}}}}}}, {{2}, {0, {{{1}, {{{1, 2}, {2}}}}, {{2}, {{{2, 2}, {5}}}}, {{3}, {{{2, 3}, {6}}}}, {{4}, {{{2, 4}, {7}}}}}}}, {{3}, {1\/4, {{{1}, {{{1, 3}, {3}}}}, {{2}, {{{2, 3}, {6}}}}, {{3}, {{{3, 3}, {8}}}}, {{4}, {{{3, 4}, {9}}}}}}}, {{4}, {1\/4, {{{1}, {{{1, 4}, {4}}}}, {{2}, {{{2, 4}, {7}}}}, {{3}, {{{3, 4}, {9}}}}, {{4}, {{{4, 4}, {10}}}}}}}}, {{{1, 1}, {0, {}}}, {{1, 2}, {0, {}}}, {{1, 3}, {0, {}}}, {{1, 4}, {0, {}}}, {{2, 2}, {0, {}}}, {{2, 3}, {0, {}}}, {{2, 4}, {0, {}}}, {{3, 3}, {0, {}}}, {{3, 4}, {1, {}}}, {{4, 4}, {0, {}}}}}}\)], "Output"] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[ \(meanMeanLevel[{fructifiedFateTree[\([1]\)], %}, strategy[\([1]\)]]\)], "Input"], Cell[BoxData[ \({0, {{{{}, {1\/32, {{{1, 1}, {{{1}, {2}}}}, {{1, 2}, {{{1, 2}, {7}}}}, {{1, 3}, {{{1}, {2}}}}, {{1, 4}, {{{1}, {2}}}}, {{2, 2}, {{{2}, {3}}}}, {{2, 3}, {{{2}, {3}}}}, {{2, 4}, {{{2}, {3}}}}, {{3, 3}, {{{}, {1}}}}, {{3, 4}, {{{}, {1}}}}, {{4, 4}, {{{}, {1}}}}}}}}, {}}}\)], "Output"] }, Open ]], Cell["\<\ En visant {1, 2}, pour finir sur {3, 4}, il faut au dernier jet \ obtenir {3, 4} et au premier jet obtenir {3, 4} ou {3, 3} ou {4, 4}.\ \>", \ "Text"], Cell[CellGroupData[{ Cell[BoxData[ \(2\ \(1\/16\) 1\/8 + \(1\/8\) 1\/8 \[Equal] 1\/32\)], "Input"], Cell[BoxData[ \(True\)], "Output"] }, Open ]], Cell[BoxData[ \(\({fructifiedFateTree, strategy} =. ;\)\)], "Input"], Cell[TextData[{ "\[WarningSign] Reprendre l'option ", StyleBox["repeat", "Output"], " de ", StyleBox["meanMeanLevel", "Output"], "." }], "Text"], Cell[BoxData[ \(Clear@utilityAndStrategy; utilityAndStrategy[fateTree1_, utility_]@strategy_List := With[{fructifiedFateTree = fructify[utility]@fateTree1}, \[IndentingNewLine]reverseFoldList[ meanMeanLevel[{First@#1, #2}, Last@#1] &, Transpose[dropLast /@ {fructifiedFateTree, strategy}], Last@fructifiedFateTree]\[IndentingNewLine]];\)], "Input", InitializationCell->True], Cell[CellGroupData[{ Cell[BoxData[ \(With[{d = 2, f = 2, j = 3}, \[IndentingNewLine]With[{fateTree1 = fateTree["\", d, f, j]}, \[IndentingNewLine]utilityAndStrategy[ fateTree1, \(-10\) #1 + Plus @@ #2 &]@\(Composition[dropUtility, maxUtilityAndBestStrategy]\)[ fateTree1, \[Delta][ Last@allLagrangeRepresentatives[d, f], #2] &]\[IndentingNewLine]]\[IndentingNewLine]]\)], \ "Input"], Cell[BoxData[ \({{0, {{{{}, {\(-\(29\/2\)\), {{{1, 1}, {{{}, {1}}, {{1}, {2}}}}, {{1, 2}, {{{1, 2}, {5}}}}, {{2, 2}, {{{}, {1}}, {{2}, {3}}}}}}}}, {}}}, {1, {{{{}, \ {\(-22\), {{{1, 1}, {{{}, {1}}, {{1}, {2}}}}, {{1, 2}, {{{1, 2}, {5}}}}, {{2, 2}, {{{}, {1}}, {{2}, {3}}}}}}}, {{1}, {\(-\(89\/4\)\), \ {{{1}, {{{1}, {2}}}}, {{2}, {{{1, 2}, {5}}}}}}}, {{2}, {\(-\(87\/4\)\), {{{1}, {{{1, 2}, {5}}}}, {{2}, {{{2}, {3}}}}}}}}, {{{1, 1}, {\(-8\), {}}}, {{1, 2}, {\(-7\), {}}}, {{2, 2}, {\(-6\), {}}}}}}, {2, {{{{}, {\(-27\), {{{1, 1}, {{{1, 1}, {1}}}}, {{1, 2}, {{{1, 2}, {2}}}}, {{2, 2}, {{{2, 2}, {3}}}}}}}, {{1}, {\(-\(55\/2\)\), {{{1}, {{{1, 1}, {1}}}}, {{2}, {{{1, 2}, {2}}}}}}}, {{2}, {\(-\(53\/2\)\), {{{1}, {{{1, 2}, {2}}}}, {{2}, {{{2, 2}, {3}}}}}}}}, {{{1, 1}, {\(-18\), {}}}, {{1, 2}, {\(-17\), {}}}, {{2, 2}, {\(-16\), {}}}}}}, {3, {{}, {{{1, 1}, {\(-28\), {}}}, {{1, 2}, {\(-27\), {}}}, {{2, 2}, {\(-26\), {}}}}}}}\)], "Output"] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[ \(With[{d = 2, f = 2, j = 3}, \[IndentingNewLine]With[{fateTree1 = fateTree["\", d, f, j]}, \[IndentingNewLine]dropStrategy@\(utilityAndStrategy[ fateTree1, \(-10\) #1 + Plus @@ #2 &]@\(Composition[ dropUtility, maxUtilityAndBestStrategy]\)[ fateTree1, \[Delta][ Last@allLagrangeRepresentatives[d, f], #2] \ &]\)\[IndentingNewLine]]\[IndentingNewLine]]\)], "Input"], Cell[BoxData[ \(\(-\(29\/2\)\)\)], "Output"] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[ \(With[{d = 2, f = 4, j = 2}, \[IndentingNewLine]With[{fateTree1 = fateTree["\", d, f, j]}, \[IndentingNewLine]dropStrategy@\(utilityAndStrategy[ fateTree1, \[Delta][{3, 4}, #2] &]@\(Composition[dropUtility, maxUtilityAndBestStrategy]\)[ fateTree1, \[Delta][ Last@allLagrangeRepresentatives[d, f], #2] \ &]\)\[IndentingNewLine]]\[IndentingNewLine]]\)], "Input"], Cell[BoxData[ \(1\/32\)], "Output"] }, Open ]] }, Open ]], Cell[CellGroupData[{ Cell["V\[EAcute]rification du jugement avec la politique \ r\[EAcute]trospective", "Subsection", CellTags->{"section9", "c:51"}], Cell[CellGroupData[{ Cell["Plus utile strat\[EAcute]gie (m\[EHat]me non pure)", "Subsubsection", CellTags->"c:52"], Cell[BoxData[ \({d = 2, f = 2, j = 3}; utility = \[Delta][{2, 2}, #2] &; strategy = \(Composition[dropUtility, maxUtilityAndBestStrategy]\)[ fateTree["\", d, f, j], utility];\)], "Input"], Cell[CellGroupData[{ Cell[BoxData[{ \(\(Composition[dropStrategy, maxUtilityAndBestStrategy]\)[ fateTree["\", d, f, j], utility]\), "\[IndentingNewLine]", \(dropStrategy@\(utilityAndStrategy[fateTree["\", d, f, j], utility]@ strategy\)\)}], "Input"], Cell[BoxData[ \(49\/64\)], "Output"], Cell[BoxData[ \(49\/64\)], "Output"] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[ \(% \[Equal] %%\)], "Input"], Cell[BoxData[ \(True\)], "Output"] }, Open ]], Cell[BoxData[ \({d =. , f =. , j =. }; utility =. ; strategy =. ;\)], "Input"] }, Open ]], Cell[CellGroupData[{ Cell["Strat\[EAcute]gie pure (m\[EHat]me non plus utile)", "Subsubsection", CellTags->"c:53"], Cell[CellGroupData[{ Cell[BoxData[ \({d = 2, f = 2, j = 3}; strategy = \(Composition[dropUtility, maxUtilityAndBestStrategy]\)[ fateTree["\", d, f, j], \[Delta][Last@allLagrangeRepresentatives[d, f], #2] &]; strategy \[Equal] purify@strategy\)], "Input"], Cell[BoxData[ \(False\)], "Output"] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[ RowBox[{ RowBox[{ RowBox[{"With", "[", RowBox[{\({utility = #}\), ",", RowBox[{ RowBox[{\(Composition[dropStrategy, maxUtilityAndBestStrategy]\), "[", RowBox[{ RowBox[{ RowBox[{"force", "[", RowBox[{ StyleBox["purify", FontColor->RGBColor[1, 0, 0]], StyleBox["@", FontColor->RGBColor[1, 0, 0]], "strategy"}], "]"}], "@", \(fateTree["\", d, f, j]\)}], ",", "utility"}], "]"}], "\[Equal]", \(dropStrategy@\(utilityAndStrategy[ fateTree["\", d, f, j], utility]@\(purify@ strategy\)\)\)}]}], "]"}], "&"}], "/@", \({\[Delta][ Last@allLagrangeRepresentatives[d, f], #2] &, \(-10\) #1 + Plus @@ #2 &, Plus @@ #2 &, \(-#1\) + Times @@ #2 &, 10 #1 + Times @@ #2 &}\)}]], "Input"], Cell[BoxData[ \({True, True, True, True, True}\)], "Output"] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[ \(\(With[{utility = #}, \(Composition[dropStrategy, maxUtilityAndBestStrategy]\)[ force[strategy]@fateTree["\", d, f, j], utility] \[Equal] dropStrategy@\(utilityAndStrategy[fateTree["\", d, f, j], utility]@strategy\)] &\) /@ {\[Delta][ Last@allLagrangeRepresentatives[d, f], #2] &, \(-10\) #1 + Plus @@ #2 &, Plus @@ #2 &, \(-#1\) + Times @@ #2 &, 10 #1 + Times @@ #2 &}\)], "Input"], Cell[BoxData[ \({True, False, False, False, False}\)], "Output"] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[ RowBox[{ RowBox[{ RowBox[{"1.", RowBox[{"With", "[", RowBox[{\({utility = #}\), ",", RowBox[{\({\(Composition[dropStrategy, maxUtilityAndBestStrategy]\)[ force[strategy]@fateTree["\", d, f, j], utility], dropStrategy@\(utilityAndStrategy[ fateTree["\", d, f, j], utility]@strategy\)}\), Cell[""], Cell[""]}]}], "]"}]}], "&"}], "/@", \({\[Delta][ Last@allLagrangeRepresentatives[d, f], #2] &, \(-10\) #1 + Plus @@ #2 &, Plus @@ #2 &, \(-#1\) + Times @@ #2 &, 10 #1 + Times @@ #2 &}\)}]], "Input"], Cell[BoxData[ \({{0.875`, 0.875`}, {\(-14.40625`\), \(-14.5`\)}, {3.09375`, 3.`}, {0.453125`, 0.3125`}, {19.703125`, 19.5625`}}\)], "Output"] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[ \({d = 2, f = 3, j = 3}; strategy = \(Composition[dropUtility, maxUtilityAndBestStrategy]\)[ fateTree["\", d, f, j], \[Delta][ Last@allLagrangeRepresentatives[d, f], #2] &]\)], "Input"], Cell[BoxData[ \({{0, {{{{}, {{{1, 1}, {{{1}, {2}}}}, {{1, 2}, {{{1, 2}, {6}}}}, {{1, 3}, {{{1}, {2}}}}, {{2, 2}, {{{2}, {3}}}}, {{2, 3}, {{{2}, {3}}}}, {{3, 3}, {{{}, {1}}}}}}}, {}}}, {1, {{{{}, {{{1, 1}, {{{1}, {2}}}}, {{1, 2}, {{{1, 2}, {6}}}}, {{1, 3}, {{{1}, {2}}}}, {{2, 2}, {{{2}, {3}}}}, {{2, 3}, {{{2}, {3}}}}, {{3, 3}, {{{}, {1}}}}}}, {{1}, {{{1}, {{{1}, {2}}}}, {{2}, \ {{{1, 2}, {6}}}}, {{3}, {{{1}, {2}}}}}}, {{2}, {{{1}, {{{1, 2}, {6}}}}, {{2}, {{{2}, {3}}}}, {{3}, {{{2}, \ {3}}}}}}, {{3}, {{{1}, {{{3}, {4}}, {{1, 3}, {7}}}}, {{2}, {{{3}, {4}}, {{2, 3}, {9}}}}, {{3}, {{{3}, {4}}, {{3, 3}, {10}}}}}}}, {{{1, 1}, {}}, {{1, 2}, {}}, {{1, 3}, {}}, {{2, 2}, {}}, {{2, 3}, {}}, {{3, 3}, {}}}}}, {2, {{{{}, {{{1, 1}, {{{1, 1}, {1}}}}, {{1, 2}, {{{1, 2}, {2}}}}, {{1, 3}, {{{1, 3}, {3}}}}, {{2, 2}, {{{2, 2}, {4}}}}, {{2, 3}, {{{2, 3}, {5}}}}, {{3, 3}, {{{3, 3}, {6}}}}}}, {{1}, {{{1}, {{{1, 1}, {1}}}}, {{2}, {{{1, 2}, {2}}}}, {{3}, {{{1, 3}, {3}}}}}}, {{2}, {{{1}, {{{1, 2}, {2}}}}, {{2}, {{{2, 2}, {4}}}}, {{3}, {{{2, 3}, {5}}}}}}, {{3}, {{{1}, {{{1, 3}, {3}}}}, {{2}, {{{2, 3}, {5}}}}, {{3}, {{{3, 3}, {6}}}}}}}, {{{1, 1}, {}}, {{1, 2}, {}}, {{1, 3}, {}}, {{2, 2}, {}}, {{2, 3}, {}}, {{3, 3}, {}}}}}, {3, {{}, {{{1, 1}, {}}, {{1, 2}, {}}, {{1, 3}, {}}, {{2, 2}, {}}, {{2, 3}, {}}, {{3, 3}, {}}}}}}\)], "Output"] }, Open ]], Cell["\<\ Strat\[EAcute]gie non pure, mais seulement \[AGrave] cause des \ \[EAcute]tats vains, qui ne contribuent pas \[AGrave] l'utilit\[EAcute] strat\ \[EAcute]gique.\ \>", "Text"], Cell[CellGroupData[{ Cell[BoxData[{ \(strategy \[Equal] purify@strategy\), "\n", \(\(With[{utility = #}, \(Composition[dropStrategy, maxUtilityAndBestStrategy]\)[ force[strategy]@fateTree["\", d, f, j], utility] \[Equal] dropStrategy@\(utilityAndStrategy[fateTree["\", d, f, j], utility]@strategy\)] &\) /@ utilityList[d, f, j]\)}], "Input"], Cell[BoxData[ \(False\)], "Output"], Cell[BoxData[ \({True, True, True, True, True, True, True, True, True, True, True, True, True, True, True}\)], "Output"] }, Open ]], Cell[BoxData[ \({d =. , f =. , j =. }; utility =. ; strategy =. ;\)], "Input"] }, Open ]] }, Open ]], Cell[CellGroupData[{ Cell["Application : probabilit\[EAcute] du nombre de lancers", "Subsection", CellTags->"c:54"], Cell[TextData[{ "Avec une fonction d'utilit\[EAcute] binaire valant ", Cell[BoxData[ \(TraditionalForm\`1\)]], StyleBox[" ", FontWeight->"Bold"], "uniform\[EAcute]ment ssi le tour s'arr\[EHat]te \[AGrave] la date ", Cell[BoxData[ \(TraditionalForm\`j1\)]], ", l'utilit\[EAcute] strat\[EAcute]gique est la probabilit\[EAcute] que le \ nombre de lancers soit ", Cell[BoxData[ \(TraditionalForm\`\(\(\ \)\(j1\)\)\)]], ". Essayer avec toutes les strat\[EAcute]gies \[AGrave] but unique (modulo \ une permutation de faces)." }], "Text"], Cell[CellGroupData[{ Cell[BoxData[{ \(\({d = 3, f = 6, j = 3};\)\), "\n", \(Timing@ With[{fateTree1 = fateTree["\", d, f, j]}, Outer[With[{goal = #1, j1 = #2}, \ \[IndentingNewLine]dropStrategy@\(utilityAndStrategy[ fateTree1, \[Delta][j1, #1] &]@\(Composition[dropUtility, maxUtilityAndBestStrategy]\)[ fateTree1, \[Delta][ goal, #2] &]\)\[IndentingNewLine]] &, \ \[IndentingNewLine]allLagrangeRepresentatives[d, f], Range@j, 1\[IndentingNewLine]]]\)}], "Input"], Cell[BoxData[ \({5.609999999999999`\ Second, {{1\/216, 1115\/46656, 45325\/46656}, {1\/72, 143\/2592, 2413\/2592}, {1\/36, 227\/2592, 2293\/2592}}}\)], "Output"] }, Open ]], Cell["\<\ Nombre de lancers moyen pour brelan, paire, suite. La redondance \ permet d'obtenir plus vite une suite.\ \>", "Text"], Cell[CellGroupData[{ Cell[BoxData[ \(\(\((# . Range@j)\) &\) /@ Last@%\)], "Input"], Cell[BoxData[ \({138421\/46656, 7561\/2592, 7405\/2592}\)], "Output"] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[ \(1. %\)], "Input"], Cell[BoxData[ \({2.9668424211248285`, 2.9170524691358026`, 2.856867283950617`}\)], "Output"] }, Open ]], Cell[TextData[{ Cell[BoxData[ \(\((1 - 1\/f)\)\^j1\)]], "probabilit\[EAcute] d'un d\[EAcute] soit mis de c\[OHat]t\[EAcute] apr\ \[EGrave]s ", Cell[BoxData[ \(TraditionalForm\`j1\)]], " jet." }], "Text"], Cell[TextData[{ "V\[EAcute]rification : si le but est", StyleBox[" un brelan", FontSlant->"Italic"], ", alors la somme des probabilit\[EAcute]s pr\[EAcute]c\[EAcute]dentes \ jusqu'\[AGrave] ", Cell[BoxData[ FormBox[ RowBox[{" ", FormBox[\(j1 < j\), "TraditionalForm"]}], TraditionalForm]]], " est aussi la probabilit\[EAcute] pour que le nombre de d\[EAcute]s mis de \ c\[OHat]t\[EAcute] apr\[EGrave]s ", Cell[BoxData[ \(TraditionalForm\`j1\)]], "lancers soit ", Cell[BoxData[ \(TraditionalForm\`d\)]], ", donn\[EAcute]e par une loi bin\[OHat]miale (c. f. article compagnon). " }], "Text"], Cell[CellGroupData[{ Cell[BoxData[ \(\(\((1 - \((1 - 1\/f)\)\^#)\)\^d &\)@Range[0, j - 1]\)], "Input"], Cell[BoxData[ \({0, 1\/216, 1331\/46656}\)], "Output"] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[ \(1\/216 \[Equal] \((1 - \((1 - 1\/f)\)\^1)\)\^d \[Equal] \ \((1\/f)\)\^d\)], "Input"], Cell[BoxData[ \(True\)], "Output"] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[ \(1\/216 + 1115\/46656 \[Equal] \((1 - \((1 - 1\/f)\)\^\(j - 1\))\)\^d\)], \ "Input"], Cell[BoxData[ \(True\)], "Output"] }, Open ]], Cell["V\[EAcute]rifier qu'un joueur suivant doit lancer 3 fois exactement.", \ "Text"], Cell[CellGroupData[{ Cell[BoxData[ \(With[{fateTree1 = fateTree["\", d, f, j]}, \[IndentingNewLine]Outer[ With[{goal = #1, j1 = #2}, \[IndentingNewLine]dropStrategy@\(utilityAndStrategy[ fateTree1, \[Delta][j1, #1] &]@\(Composition[dropUtility, maxUtilityAndBestStrategy]\)[ fateTree1, \[Delta][ goal, #2] &]\)\[IndentingNewLine]] &, \ \[IndentingNewLine]allLagrangeRepresentatives[d, f], Range@j, 1\[IndentingNewLine]]]\)], "Input"], Cell[BoxData[ \({{0, 0, 1}, {0, 0, 1}, {0, 0, 1}}\)], "Output"] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[ \(\(\((# . Range@j)\) &\) /@ %\)], "Input"], Cell[BoxData[ \({3, 3, 3}\)], "Output"] }, Open ]], Cell[BoxData[ \(\({d =. , f =. , j =. };\)\)], "Input"] }, Open ]] }, Open ]], Cell[CellGroupData[{ Cell["Strat\[EAcute]gies \[AGrave] but unique", "Section", CellTags->"c:55"], Cell[CellGroupData[{ Cell["Cliquet", "Subsection", CellTags->{"section7", "c:56"}], Cell[CellGroupData[{ Cell["Premier joueur", "Subsubsection", CellTags->"c:57"], Cell["Strat\[EAcute]gie non pure \[AGrave] cause des \[EAcute]tats vains.", \ "Text"], Cell[CellGroupData[{ Cell[BoxData[{ \(\({d = 2, f = 3, j = 3};\)\), "\[IndentingNewLine]", \(\(Composition[dropUtility, maxUtilityAndBestStrategy]\)[ fateTree["\", d, f, j], \[Delta][ Last@allLagrangeRepresentatives[d, f], #2] &]\), "\[IndentingNewLine]", \(% \[Equal] purify@%\)}], "Input"], Cell[BoxData[ \({{0, {{{{}, {{{1, 1}, {{{1}, {2}}}}, {{1, 2}, {{{1, 2}, {6}}}}, {{1, 3}, {{{1}, {2}}}}, {{2, 2}, {{{2}, {3}}}}, {{2, 3}, {{{2}, {3}}}}, {{3, 3}, {{{}, {1}}}}}}}, {}}}, {1, {{{{}, {{{1, 1}, {{{1}, {2}}}}, {{1, 2}, {{{1, 2}, {6}}}}, {{1, 3}, {{{1}, {2}}}}, {{2, 2}, {{{2}, {3}}}}, {{2, 3}, {{{2}, {3}}}}, {{3, 3}, {{{}, {1}}}}}}, {{1}, {{{1}, {{{1}, {2}}}}, {{2}, \ {{{1, 2}, {6}}}}, {{3}, {{{1}, {2}}}}}}, {{2}, {{{1}, {{{1, 2}, {6}}}}, {{2}, {{{2}, {3}}}}, {{3}, {{{2}, \ {3}}}}}}, {{3}, {{{1}, {{{3}, {4}}, {{1, 3}, {7}}}}, {{2}, {{{3}, {4}}, {{2, 3}, {9}}}}, {{3}, {{{3}, {4}}, {{3, 3}, {10}}}}}}}, {{{1, 1}, {}}, {{1, 2}, {}}, {{1, 3}, {}}, {{2, 2}, {}}, {{2, 3}, {}}, {{3, 3}, {}}}}}, {2, {{{{}, {{{1, 1}, {{{1, 1}, {1}}}}, {{1, 2}, {{{1, 2}, {2}}}}, {{1, 3}, {{{1, 3}, {3}}}}, {{2, 2}, {{{2, 2}, {4}}}}, {{2, 3}, {{{2, 3}, {5}}}}, {{3, 3}, {{{3, 3}, {6}}}}}}, {{1}, {{{1}, {{{1, 1}, {1}}}}, {{2}, {{{1, 2}, {2}}}}, {{3}, {{{1, 3}, {3}}}}}}, {{2}, {{{1}, {{{1, 2}, {2}}}}, {{2}, {{{2, 2}, {4}}}}, {{3}, {{{2, 3}, {5}}}}}}, {{3}, {{{1}, {{{1, 3}, {3}}}}, {{2}, {{{2, 3}, {5}}}}, {{3}, {{{3, 3}, {6}}}}}}}, {{{1, 1}, {}}, {{1, 2}, {}}, {{1, 3}, {}}, {{2, 2}, {}}, {{2, 3}, {}}, {{3, 3}, {}}}}}, {3, {{}, {{{1, 1}, {}}, {{1, 2}, {}}, {{1, 3}, {}}, {{2, 2}, {}}, {{2, 3}, {}}, {{3, 3}, {}}}}}}\)], "Output"], Cell[BoxData[ \(False\)], "Output"] }, Open ]], Cell["\[CapitalEAcute]laguer suffit \[AGrave] purifier.", "Text"], Cell[CellGroupData[{ Cell[BoxData[{ \(\(Composition[dropUtility, maxUtilityAndBestStrategy]\)[ fateTree["\", d, f, j, \[Delta][Last@allLagrangeRepresentatives[d, f], #2] &], \[Delta][ Last@allLagrangeRepresentatives[d, f], #2] &]\), "\[IndentingNewLine]", \(% \[Equal] purify@%\)}], "Input"], Cell[BoxData[ \({{0, {{{{}, {{{1, 1}, {{{1}, {2}}}}, {{1, 2}, {{{1, 2}, {4}}}}, {{1, 3}, {{{1}, {2}}}}, {{2, 2}, {{{2}, {3}}}}, {{2, 3}, {{{2}, {3}}}}, {{3, 3}, {{{}, {1}}}}}}}, {}}}, {1, {{{{}, {{{1, 1}, {{{1}, {2}}}}, {{1, 2}, {{{1, 2}, {4}}}}, {{1, 3}, {{{1}, {2}}}}, {{2, 2}, {{{2}, {3}}}}, {{2, 3}, {{{2}, {3}}}}, {{3, 3}, {{{}, {1}}}}}}, {{1}, {{{1}, {{{1}, {2}}}}, {{2}, \ {{{1, 2}, {4}}}}, {{3}, {{{1}, {2}}}}}}, {{2}, {{{1}, {{{1, 2}, {4}}}}, {{2}, {{{2}, {3}}}}, {{3}, {{{2}, \ {3}}}}}}}, {{{1, 2}, {}}}}}, {2, {{{{}, {{{1, 1}, {{{1, 1}, {1}}}}, {{1, 2}, {{{1, 2}, {2}}}}, {{1, 3}, {{{1, 3}, {3}}}}, {{2, 2}, {{{2, 2}, {4}}}}, {{2, 3}, {{{2, 3}, {5}}}}, {{3, 3}, {{{3, 3}, {6}}}}}}, {{1}, {{{1}, {{{1, 1}, {1}}}}, {{2}, {{{1, 2}, {2}}}}, {{3}, {{{1, 3}, {3}}}}}}, {{2}, {{{1}, {{{1, 2}, {2}}}}, {{2}, {{{2, 2}, {4}}}}, {{3}, {{{2, 3}, {5}}}}}}}, {{{1, 2}, {}}}}}, {3, {{}, {{{1, 1}, {}}, {{1, 2}, {}}, {{1, 3}, {}}, {{2, 2}, {}}, {{2, 3}, {}}, {{3, 3}, {}}}}}}\)], "Output"], Cell[BoxData[ \(True\)], "Output"] }, Open ]], Cell[TextData[{ "D\[EAcute]f. : ", StyleBox["cliquet", FontSlant->"Italic"], " : apr\[EGrave]s chaque lancer, mettre de c\[OHat]t\[EAcute] \ l'intersection (plus grande sous-combinaison) des combinaisons but et \ \[EAcute]v\[EAcute]nement. " }], "Text"], Cell[TextData[{ "Pour une fonction d'utilit\[EAcute] \[AGrave] but unique, \ d\[EAcute]croissante par rapport \[AGrave] la premi\[EGrave]re variable de \ temps (inflation), la strat\[EAcute]gie calculable par cliquet est la plus \ utile ssi ", Cell[BoxData[ \(TraditionalForm\`d < f\)]], " (c. f. article compagnon). \[WarningSign] V\[EAcute]rifier." }], "Text"], Cell[BoxData[ \(\({d = 2, f = 4, j = 2};\)\)], "Input"], Cell[CellGroupData[{ Cell[BoxData[ \(\(fateTree["\", d, f, j]\)[\([1]\)]\)], "Input"], Cell[BoxData[ \({0, {{{{}, {{{1\/16, {1, 1}}, {{{}, {1}}, {{1}, {2}}, {{1, 1}, {6}}}}, {{1\/8, {1, 2}}, {{{}, {1}}, {{1}, {2}}, {{2}, {3}}, {{1, 2}, {7}}}}, {{1\/8, {1, 3}}, {{{}, {1}}, {{1}, {2}}, {{3}, {4}}, {{1, 3}, {8}}}}, {{1\/8, {1, 4}}, {{{}, {1}}, {{1}, {2}}, {{4}, {5}}, {{1, 4}, {9}}}}, {{1\/16, {2, 2}}, {{{}, {1}}, {{2}, {3}}, {{2, 2}, {10}}}}, {{1\/8, {2, 3}}, {{{}, {1}}, {{2}, {3}}, {{3}, {4}}, {{2, 3}, {11}}}}, {{1\/8, {2, 4}}, {{{}, {1}}, {{2}, {3}}, {{4}, {5}}, {{2, 4}, {12}}}}, {{1\/16, {3, 3}}, {{{}, {1}}, {{3}, {4}}, {{3, 3}, {13}}}}, {{1\/8, {3, 4}}, {{{}, {1}}, {{3}, {4}}, {{4}, {5}}, {{3, 4}, {14}}}}, {{1\/16, {4, 4}}, {{{}, {1}}, {{4}, {5}}, {{4, 4}, {15}}}}}}}, {}}}\)], "Output"] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[ \(\(\(Composition[dropUtility, maxUtilityAndBestStrategy]\)[ fateTree["\", d, f, j], \[Delta][ Last@allLagrangeRepresentatives[d, f], #2] &]\)[\([1]\)]\)], "Input"], Cell[BoxData[ \({0, {{{{}, {{{1, 1}, {{{1}, {2}}}}, {{1, 2}, {{{1, 2}, {7}}}}, {{1, 3}, {{{1}, {2}}}}, {{1, 4}, {{{1}, {2}}}}, {{2, 2}, {{{2}, {3}}}}, {{2, 3}, {{{2}, {3}}}}, {{2, 4}, {{{2}, {3}}}}, {{3, 3}, {{{}, {1}}}}, {{3, 4}, {{{}, {1}}}}, {{4, 4}, {{{}, {1}}}}}}}, {}}}\)], "Output"] }, Open ]], Cell[BoxData[ \(\({d =. , f =. , j =. };\)\)], "Input"] }, Open ]], Cell[CellGroupData[{ Cell["Joueur suivant : dilemme de succ\[EGrave]s pr\[EAcute]matur\[EAcute]", \ "Subsubsection", CellTags->"c:58"], Cell[TextData[{ "Le nombre de lancers est impos\[EAcute]. Pour ", Cell[BoxData[ \(TraditionalForm\`d < f\)]], ", la plus utile strat\[EAcute]gie est encore calculable par cliquet, sauf \ que, si le but est trop t\[OHat]t atteint, alors il faut rejouer un seul d\ \[EAcute], ce qui peut se faire en g\[EAcute]n\[EAcute]ral de plusieurs mani\ \[EGrave]res. Plus pr\[EAcute]cis\[EAcute]ment, le nombre de plus utiles \ strat\[EAcute]gies pures est le nombre de faces distinctes du but \[AGrave] \ la puissance ", Cell[BoxData[ \(TraditionalForm\`j - 1\)]], ". \[WarningSign] V\[EAcute]rification extensive." }], "Text"], Cell[CellGroupData[{ Cell[BoxData[{ \({d = 2, f = 3, j = 3}; goal = {1, 2};\), "\n", \(\((\(Composition[dropUtility, maxUtilityAndBestStrategy]\)[ fateTree["\", d, f, j], \[Delta][goal, #2] &])\)[\([2]\)]\)}], "Input"], Cell[BoxData[ \({1, {{{{}, {{{1, 1}, {{{1}, {2}}}}, {{1, 2}, {{{1}, {2}}, {{2}, {3}}}}, {{1, 3}, {{{1}, {2}}}}, {{2, 2}, {{{2}, {3}}}}, {{2, 3}, {{{2}, {3}}}}, {{3, 3}, {{{}, {1}}}}}}, {{1}, {{{1}, {{{1}, {2}}}}, {{2}, \ {{{1}, {2}}}}, {{3}, {{{1}, {2}}}}}}, {{2}, {{{1}, {{{2}, {3}}}}, {{2}, \ {{{2}, {3}}}}, {{3}, {{{2}, {3}}}}}}, {{3}, {{{1}, {{{3}, {4}}}}, {{2}, \ {{{3}, {4}}}}, {{3}, {{{3}, {4}}}}}}}, {}}}\)], "Output"] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[ \(\((\(Composition[dropUtility, maxUtilityAndBestStrategy]\)[ fateTree["\", d, f, j], \[Delta][goal, #2] &])\)[\([2, \(-1\), 1, 1, \(-1\), 2]\)]\)], "Input"], Cell[BoxData[ \({{1, 2}, {{{1}, {2}}, {{2}, {3}}}}\)], "Output"] }, Open ]], Cell[BoxData[ \({d =. , f =. , j =. }; goal =. ;\)], "Input"] }, Open ]] }, Open ]], Cell[CellGroupData[{ Cell["Probabilit\[EAcute]s de passage", "Subsection", CellTags->"c:59"], Cell["\<\ La probabilit\[EAcute] qu'un joueur visant un but passe par \ \[AGrave] une certaine date par un certain \ \[EAcute]tat-r\[EAcute]sultat,\ \>", "Text"], Cell[BoxData[ \(probability[player, f, j, goal, j1, result] /; 1 \[LessEqual] j1 \[LessEqual] j\)], "Input", Evaluatable->False], Cell["\<\ est calcul\[EAcute]e comme l'utilit\[EAcute] en vue de la fonction \ d'utilit\[EAcute] instationnaire\ \>", "Text"], Cell[BoxData[ \(\[Delta][{j1, result}, {#1, #2}] &\)], "Input", Evaluatable->False], Cell[TextData[{ "Plus pr\[EAcute]cis\[EAcute]ment, la probabilit\[EAcute], partant de ", Cell[BoxData[ \(TraditionalForm\`{j2, state}\)]], ", visant en moins de ", Cell[BoxData[ \(TraditionalForm\`j\)]], " lancers ", Cell[BoxData[ \(TraditionalForm\`goal\)]], ", de passer par ", Cell[BoxData[ \(TraditionalForm\`{j1, result}\)]], ", ", Cell[BoxData[ \(TraditionalForm\`j2 \[LessEqual] j1 \[LessEqual] j\)]], ", \[EAcute]gale la probabilit\[EAcute], partant de ", Cell[BoxData[ \(TraditionalForm\`{0, {}}\)]], ", visant en moins de ", Cell[BoxData[ \(TraditionalForm\`j - j2\)]], " lancers ", Cell[BoxData[ \(TraditionalForm\`goal\[Backslash]state\)]], ", de passer par ", Cell[BoxData[ \(TraditionalForm\`{j1 - j2, result\[Backslash]state}\)]], ", et ces deux probabilit\[EAcute]s sont l'utilit\[EAcute] de ", Cell[BoxData[ \(TraditionalForm\`{j2, state}\)]], " pour la fonction d'utilit\[EAcute] pr\[EAcute]c\[EAcute]dente." }], "Text"], Cell["\<\ Si l'\[EAcute]tat-r\[EAcute]sultat est de m\[EHat]me longueur que \ le but, alors la probabilit\[EAcute] de passage est aussi une probabilit\ \[EAcute] d'arr\[EHat]t ; si le r\[EAcute]sultat est identique au but, alors \ la probabilit\[EAcute] d'arr\[EHat]t est aussi une probabilit\[EAcute] de \ succ\[EGrave]s, sinon une probabilit\[EAcute] d'\[EAcute]chec.\ \>", "Text"], Cell[CellGroupData[{ Cell["Probabilit\[EAcute]s de succ\[EGrave]s ind\[EAcute]pendamment du \ temps", "Subsubsection", CellTags->"c:60"], Cell[BoxData[ \(Clear@successProbability; successProbability[fateTree1_, goal_] := \(Composition[dropStrategy, maxUtilityAndBestStrategy]\)[ fateTree1, \[Delta][goal, #2] &]\)], "Input", InitializationCell->True], Cell[CellGroupData[{ Cell[BoxData[{ \(\({d = 3, f = 6, j = 3};\)\), "\[IndentingNewLine]", \(\(successProbability[fateTree["\", d, f, j], #] &\) /@ allLagrangeRepresentatives[d, f]\)}], "Input"], Cell[BoxData[ \({753571\/10077696, 43013\/279936, 42571\/186624}\)], "Output"] }, Open ]], Cell["\<\ Pour un joueur suivant, la probabilit\[EAcute] de succ\[EGrave]s se \ d\[EAcute]cline selon le nombre de lancers :\ \>", "Text"], Cell[CellGroupData[{ Cell[BoxData[ \(Outer[successProbability[fateTree["\", d, f, #1], #2] &, Range@j, allLagrangeRepresentatives[d, f], 1]\)], "Input"], Cell[BoxData[ \({{1\/216, 1\/72, 1\/36}, {1151\/46656, 149\/2592, 239\/2592}, {513991\/10077696, 26903\/279936, 24631\/186624}}\)], "Output"] }, Open ]], Cell[BoxData[ \(\({d =. , f =. , j =. };\)\)], "Input"] }, Open ]], Cell[CellGroupData[{ Cell["Probabilit\[EAcute]s d'arr\[EHat]t, un but et un r\[EAcute]sultat \ \[EAcute]tant donn\[EAcute]s", "Subsubsection", CellTags->"c:61"], Cell[CellGroupData[{ Cell[BoxData[{ \(\({d = 2, f = 3, j = 3};\)\), "\n", \(\(fateTree1 = fateTree["\", d, f, j];\)\), "\n", \(goal = Last@allCombinations[d, f]\), "\n", \(result = First@allCombinations[d, f]\)}], "Input"], Cell[BoxData[ \({3, 3}\)], "Output"], Cell[BoxData[ \({1, 1}\)], "Output"] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[ \(strategy = \(Composition[dropUtility, maxUtilityAndBestStrategy]\)[ fateTree1, \[Delta][goal, #2] &]\)], "Input"], Cell[BoxData[ \({{0, {{{{}, {{{1, 1}, {{{}, {1}}}}, {{1, 2}, {{{}, {1}}}}, {{1, 3}, {{{3}, {4}}}}, {{2, 2}, {{{}, {1}}}}, {{2, 3}, {{{3}, {4}}}}, {{3, 3}, {{{3, 3}, {10}}}}}}}, {}}}, {1, {{{{}, {{{1, 1}, {{{}, {1}}}}, {{1, 2}, {{{}, {1}}}}, {{1, 3}, {{{3}, {4}}}}, {{2, 2}, {{{}, {1}}}}, {{2, 3}, {{{3}, {4}}}}, {{3, 3}, {{{3, 3}, {10}}}}}}, {{1}, {{{1}, {{{1}, {2}}, {{1, 1}, {5}}}}, {{2}, {{{1}, {2}}, {{1, 2}, {6}}}}, {{3}, {{{1}, {2}}, {{1, 3}, {7}}}}}}, {{2}, {{{1}, {{{2}, {3}}, {{1, 2}, {6}}}}, {{2}, {{{2}, {3}}, {{2, 2}, {8}}}}, {{3}, {{{2}, {3}}, {{2, 3}, {9}}}}}}, {{3}, {{{1}, {{{3}, {4}}}}, {{2}, \ {{{3}, {4}}}}, {{3}, {{{3, 3}, {10}}}}}}}, {{{1, 1}, {}}, {{1, 2}, {}}, {{1, 3}, {}}, {{2, 2}, {}}, {{2, 3}, {}}, {{3, 3}, {}}}}}, {2, {{{{}, {{{1, 1}, {{{1, 1}, {1}}}}, {{1, 2}, {{{1, 2}, {2}}}}, {{1, 3}, {{{1, 3}, {3}}}}, {{2, 2}, {{{2, 2}, {4}}}}, {{2, 3}, {{{2, 3}, {5}}}}, {{3, 3}, {{{3, 3}, {6}}}}}}, {{1}, {{{1}, {{{1, 1}, {1}}}}, {{2}, {{{1, 2}, {2}}}}, {{3}, {{{1, 3}, {3}}}}}}, {{2}, {{{1}, {{{1, 2}, {2}}}}, {{2}, {{{2, 2}, {4}}}}, {{3}, {{{2, 3}, {5}}}}}}, {{3}, {{{1}, {{{1, 3}, {3}}}}, {{2}, {{{2, 3}, {5}}}}, {{3}, {{{3, 3}, {6}}}}}}}, {{{1, 1}, {}}, {{1, 2}, {}}, {{1, 3}, {}}, {{2, 2}, {}}, {{2, 3}, {}}, {{3, 3}, {}}}}}, {3, {{}, {{{1, 1}, {}}, {{1, 2}, {}}, {{1, 3}, {}}, {{2, 2}, {}}, {{2, 3}, {}}, {{3, 3}, {}}}}}}\)], "Output"] }, Open ]], Cell["\<\ Les z\[EAcute]ros au d\[EAcute]but signifient qu'un premier joueur \ continue \[AGrave] lancer tant qu'il ne r\[EAcute]ussit pas.\ \>", "Text"], Cell[CellGroupData[{ Cell[BoxData[ \(\(With[{j1 = #}, \[IndentingNewLine]dropStrategy@\(utilityAndStrategy[ fateTree1, \[Delta][{j1, result}, {#1, #2}] &]@ strategy\)\[IndentingNewLine]] &\) /@ Range@j\)], "Input"], Cell[BoxData[ \({0, 0, 16\/729}\)], "Output"] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[{ \(j1 = j - 1\), "\[IndentingNewLine]", \(result = goal\), "\[IndentingNewLine]", \(\(utilityAndStrategy1 = utilityAndStrategy[fateTree1, \[Delta][{j1, result}, {#1, #2}] &]@ strategy;\)\)}], "Input"], Cell[BoxData[ \(2\)], "Output"], Cell[BoxData[ \({3, 3}\)], "Output"] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[{ \(j2 = j1 - 1\), "\[IndentingNewLine]", \(utilityAndStrategy1[\([j2 + 1, \(-1\), 1]\)]\)}], "Input"], Cell[BoxData[ \(1\)], "Output"], Cell[BoxData[ \({{{}, {1\/9, {{{1, 1}, {{{}, {1}}}}, {{1, 2}, {{{}, {1}}}}, {{1, 3}, {{{3}, {4}}}}, {{2, 2}, {{{}, {1}}}}, {{2, 3}, {{{3}, {4}}}}, {{3, 3}, {{{3, 3}, {10}}}}}}}, {{1}, {0, {{{1}, {{{1}, {2}}, {{1, 1}, {5}}}}, {{2}, {{{1}, {2}}, {{1, 2}, {6}}}}, {{3}, {{{1}, {2}}, {{1, 3}, {7}}}}}}}, {{2}, {0, {{{1}, {{{2}, {3}}, {{1, 2}, {6}}}}, {{2}, {{{2}, {3}}, {{2, 2}, {8}}}}, {{3}, {{{2}, {3}}, {{2, 3}, {9}}}}}}}, {{3}, {1\/3, {{{1}, {{{3}, {4}}}}, {{2}, \ {{{3}, {4}}}}, {{3}, {{{3, 3}, {10}}}}}}}}\)], "Output"] }, Open ]], Cell["\<\ Garder seulement les \[EAcute]tats sous-combinaisons du but et du r\ \[EAcute]sultat.\ \>", "Text"], Cell[CellGroupData[{ Cell[BoxData[ \(Select[utilityAndStrategy1[\([1 + j2, \(-1\), 1]\)], subcombinationQ[First@#, goal] && subcombinationQ[First@#, result] &]\)], "Input"], Cell[BoxData[ \({{{}, {1\/9, {{{1, 1}, {{{}, {1}}}}, {{1, 2}, {{{}, {1}}}}, {{1, 3}, {{{3}, {4}}}}, {{2, 2}, {{{}, {1}}}}, {{2, 3}, {{{3}, {4}}}}, {{3, 3}, {{{3, 3}, {10}}}}}}}, {{3}, {1\/3, {{{1}, {{{3}, {4}}}}, {{2}, \ {{{3}, {4}}}}, {{3}, {{{3, 3}, {10}}}}}}}}\)], "Output"] }, Open ]], Cell["\<\ {{{plus grand nombre de lancers restants, but relatif, date \ relative, r\[EAcute]sultat relatif}, utilit\[EAcute] = probabilit\[EAcute]}\ \[Ellipsis]}\ \>", "Text", TextAlignment->Left], Cell[CellGroupData[{ Cell[BoxData[ \(\(\(({{j - j2, goal\[Backslash]First@#, j1 - j2, result\[Backslash]First@#}, #[\([\(-1\), 1]\)]})\) &\) /@ %\)], "Input"], Cell[BoxData[ \({{{2, {3, 3}, 1, {3, 3}}, 1\/9}, {{2, {3}, 1, {3}}, 1\/3}}\)], "Output"] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[{ \(\(j2 =. ;\)\), "\[IndentingNewLine]", \(\(With[{j2 = #}, \[IndentingNewLine]\({{j - j2, goal\[Backslash]First@#, j1 - j2, result\[Backslash]First@#}, #[\([\(-1\), 1]\)]} &\) /@ \[IndentingNewLine]Select[ utilityAndStrategy1[\([1 + j2, 2, 1]\)], subcombinationQ[First@#, goal] && subcombinationQ[First@#, result] &]] &\) /@ \[IndentingNewLine]Range[0, j1 - 1]\)}], "Input"], Cell[BoxData[ \({{{{3, {3, 3}, 2, {3, 3}}, 16\/81}}, {{{2, {3, 3}, 1, {3, 3}}, 1\/9}, {{2, {3}, 1, {3}}, 1\/3}}}\)], "Output"] }, Open ]], Cell[BoxData[ \(\({d, f, j, j1, result, goal, fateTree1, strategy, utilityAndStrategy1} =. ;\)\)], "Input"], Cell[TextData[{ StyleBox["E", "Output"], "ntorse au style fonctionnel. On peut impliciter des param\[EGrave]tres \ trop gros et qu'on n'a pas le temps de reproduire \[AGrave] partir d'une \ forme plus compacte ou des constantes. \[Wolf] Si ", StyleBox["what", "Output"], " a d\[EAcute]j\[AGrave] une valeur, alors il n'est pas \ refabriqu\[EAcute]." }], "Text"], Cell[BoxData[ \(make[implicit___]@what /. what \[Rule] function1[explicit__]\)], "Input",\ Evaluatable->False], Cell[BoxData[ \(ClearAll@make; make[fateTree1_List, strategy_]@ probability[_, _, _, goal_List, j1_Integer, result_List] := \[IndentingNewLine]With[\[IndentingNewLine]{\ \[IndentingNewLine]player = Switch[Length@fateTree1[\([\(-2\), \(-1\), \(-1\)]\)], 0, "\", _, "\"], \[IndentingNewLine]f = fateTree1[\([\(-1\), \(-1\), \(-1\), \(-1\), \(-1\)]\)], \ \[IndentingNewLine]j = Length@fateTree1 - 1, \[IndentingNewLine]utilityAndStrategy1 = utilityAndStrategy[\[IndentingNewLine]fateTree1, \[Delta][{j1, result}, {#1, #2}] &]@ strategy\[IndentingNewLine]}, \[IndentingNewLine]\(With[{j2 = \ #}, \(\((probability[player, f, j - j2, goal\[Backslash]First@#, j1 - j2, result\[Backslash]First@#] = #[\([\(-1\), 1]\)])\) &\) /@ \[IndentingNewLine]Select[ utilityAndStrategy1[\([1 + j2, \(-1\), 1]\)], subcombinationQ[First@#, goal] && subcombinationQ[First@#, result] &]] &\) /@ \[IndentingNewLine]Range[0, j1 - 1]\[IndentingNewLine]]\)], "Input", InitializationCell->True], Cell["Probabilit\[EAcute]s de succ\[EGrave]s.", "Text"], Cell[CellGroupData[{ Cell[BoxData[ \(With[{d = 2, f = 3, j = 3}, \[IndentingNewLine]Block[{probability}, \ \[IndentingNewLine]With[{\[IndentingNewLine]fateTree1 = fateTree["\", d, f, j], \[IndentingNewLine]goal = Last@allLagrangeRepresentatives[d, f]}, \[IndentingNewLine]make[ fateTree1, \(Composition[dropUtility, maxUtilityAndBestStrategy]\)[ fateTree1, \[Delta][goal, #2] &]]@ probability[_, _, _, goal, j - 1, goal]\[IndentingNewLine]]; DownValues@ probability\[IndentingNewLine]]\[IndentingNewLine]]\)], "Input"], Cell[BoxData[ \({HoldPattern[probability["p1", 3, 2, {1}, 1, {1}]] \[RuleDelayed] 1\/3, HoldPattern[probability["p1", 3, 2, {2}, 1, {2}]] \[RuleDelayed] 1\/3, HoldPattern[probability["p1", 3, 2, {1, 2}, 1, {1, 2}]] \[RuleDelayed] 2\/9, HoldPattern[ probability["p1", 3, 3, {1, 2}, 2, {1, 2}]] \[RuleDelayed] 20\/81}\)], "Output"] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[ \(With[{d = 2, f = 3, j = 3}, \[IndentingNewLine]Block[{probability}, \ \[IndentingNewLine]With[{\[IndentingNewLine]fateTree1 = fateTree["\", d, f, j], \[IndentingNewLine]goal = Last@allLagrangeRepresentatives[d, f]}, \[IndentingNewLine]zoomTiming[\[IndentingNewLine]make[ fateTree1, \(Composition[dropUtility, maxUtilityAndBestStrategy]\)[ fateTree1, \[Delta][goal, #2] &]]@ probability[_, _, _, goal, j - 1, goal], 100]\[IndentingNewLine]]\[IndentingNewLine]]\[IndentingNewLine]]\)\ ], "Input"], Cell[BoxData[ \(1.7299999999999898`\ Second\)], "Output"] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[ \(With[{d = 3, f = 6, j = 3}, \[IndentingNewLine]Block[{probability}, \ \[IndentingNewLine]With[\[IndentingNewLine]{fateTree1 = fateTree["\", d, f, j], \[IndentingNewLine]goal = Last@allLagrangeRepresentatives[d, f]}, \[IndentingNewLine]Print@\(Timing@\(make[ fateTree1, \(Composition[dropUtility, maxUtilityAndBestStrategy]\)[ fateTree1, \[Delta][goal, #2] &]]@ probability[_, _, _, goal, j, goal]\)\)\[IndentingNewLine]]; DownValues@ probability\[IndentingNewLine]]\[IndentingNewLine]]\)], "Input"], Cell[BoxData[ \({0.4399999999999977`\ Second, {{24631\/186624}, {239\/2592, 19\/162, 19\/162, 19\/162, 1\/6, 1\/6, 1\/6}, {1\/36, 1\/18, 1\/18, 1\/18, 1\/6, 1\/6, 1\/6}}}\)], "Print"], Cell[BoxData[ \({HoldPattern[probability["p2", 6, 1, {1}, 1, {1}]] \[RuleDelayed] 1\/6, HoldPattern[probability["p2", 6, 1, {2}, 1, {2}]] \[RuleDelayed] 1\/6, HoldPattern[probability["p2", 6, 1, {3}, 1, {3}]] \[RuleDelayed] 1\/6, HoldPattern[probability["p2", 6, 1, {1, 2}, 1, {1, 2}]] \[RuleDelayed] 1\/18, HoldPattern[ probability["p2", 6, 1, {1, 3}, 1, {1, 3}]] \[RuleDelayed] 1\/18, HoldPattern[probability["p2", 6, 1, {2, 3}, 1, {2, 3}]] \[RuleDelayed] 1\/18, HoldPattern[ probability["p2", 6, 1, {1, 2, 3}, 1, {1, 2, 3}]] \[RuleDelayed] 1\/36, HoldPattern[ probability["p2", 6, 2, {1}, 2, {1}]] \[RuleDelayed] 1\/6, HoldPattern[probability["p2", 6, 2, {2}, 2, {2}]] \[RuleDelayed] 1\/6, HoldPattern[probability["p2", 6, 2, {3}, 2, {3}]] \[RuleDelayed] 1\/6, HoldPattern[probability["p2", 6, 2, {1, 2}, 2, {1, 2}]] \[RuleDelayed] 19\/162, HoldPattern[probability["p2", 6, 2, {1, 3}, 2, {1, 3}]] \[RuleDelayed] 19\/162, HoldPattern[probability["p2", 6, 2, {2, 3}, 2, {2, 3}]] \[RuleDelayed] 19\/162, HoldPattern[ probability["p2", 6, 2, {1, 2, 3}, 2, {1, 2, 3}]] \[RuleDelayed] 239\/2592, HoldPattern[ probability["p2", 6, 3, {1, 2, 3}, 3, {1, 2, 3}]] \[RuleDelayed] 24631\/186624}\)], "Output"] }, Open ]] }, Open ]], Cell[CellGroupData[{ Cell["Probabilit\[EAcute]s d'arr\[EHat]t, un but \[EAcute]tant \ donn\[EAcute]", "Subsubsection", TextAlignment->Left, CellTags->"c:62"], Cell["\<\ Un premier joueur ne contente pas d'un r\[EAcute]sultat autre que \ son but,\ \>", "Text", TextAlignment->Left], Cell[BoxData[ StyleBox[\(probability["\", f_, j1_, goal_, j2_, result_] /; j2 < j1 && result \[NotEqual] goal := 0\), FontWeight->"Bold"]], "Input", Evaluatable->False], Cell["\<\ Les joueurs suivants lancent exactement autant de fois que le \ premier,\ \>", "Text"], Cell[BoxData[ RowBox[{ RowBox[{ StyleBox[\(probability["\", f_, j1_, goal_, j2_, result_]\), FontWeight->"Bold"], StyleBox["/;", FontWeight->"Bold"], \(j2 < j1\)}], StyleBox[ RowBox[{":", StyleBox["=", FontWeight->"Bold"]}]], "0"}]], "Input", Evaluatable->False], Cell[TextData[{ "Le support de la probabilit\[EAcute] d'arr\[EHat]t dans le plan ", Cell[BoxData[ \(TraditionalForm\`{j1, result}\)]], " a la forme de ", "\[LeftTee]", " pour un premier joueur, de ", "I", " pour un joueur suivant. \[WarningSign] Dessin." }], "Text"], Cell["\<\ Seules les probabilit\[EAcute]s d'arr\[EHat]t (succ\[EGrave]s ou \ \[EAcute]chec) non trivialement nulles seront utilis\[EAcute]es (\ \[LeftGuillemet] matrice creuse \[RightGuillemet]). \[Wolf] Conserver les \ strat\[EAcute]gies comme variables pour \[EAcute]tudier l'effet d'un choix \ non indiff\[EAcute]rent.\ \>", "Text"], Cell[BoxData[ \(make[fateTree1_List, fateTree2_List, strategy1_, strategy2_, resultList_]@probability[_, _, _, goal_, __] /; Length@fateTree1 \[Equal] Length@fateTree2 := \[IndentingNewLine]With[{j = Length@fateTree1 - 1}, \[IndentingNewLine]{\(make[fateTree1, strategy1]@ probability[_, _, _, goal, #, goal] &\) /@ Range[j - 1], \[IndentingNewLine]\(make[fateTree1, strategy1]@ probability[_, _, _, goal, j, #] &\) /@ resultList, \[IndentingNewLine]\(make[fateTree2, strategy2]@ probability[_, _, _, goal, j, #] &\) /@ resultList}\[IndentingNewLine]]\)], "Input", InitializationCell->True], Cell["En se limitant aux seuls repr\[EAcute]sentants des \[EAcute]tats finaux \ :", "Text"], Cell[CellGroupData[{ Cell[BoxData[ \(With[{d = 2, f = 3, j = 3}, \[IndentingNewLine]Block[{probability}, \ \[IndentingNewLine]With[{\[IndentingNewLine]fateTree1 = fateTree["\", d, f, j], \[IndentingNewLine]fateTree2 = fateTree["\", d, f, j], \[IndentingNewLine]goal = Last@allLagrangeRepresentatives[d, f]}, \[IndentingNewLine]With[{\[IndentingNewLine]strategy1 \ = \(Composition[dropUtility, maxUtilityAndBestStrategy]\)[ fateTree1, \[Delta][goal, #2] &], strategy2 = \(Composition[dropUtility, maxUtilityAndBestStrategy]\)[ fateTree2, \[Delta][ goal, #2] &]\[IndentingNewLine]}, \ \[IndentingNewLine]make[fateTree1, fateTree2, strategy1, strategy2, allLagrangeRepresentatives[d, f]]@ probability[_, _, _, goal, __]\[IndentingNewLine]]\[IndentingNewLine]]; DownValues@ probability\[IndentingNewLine]]\[IndentingNewLine]]\)], "Input"], Cell[BoxData[ \({HoldPattern[probability["p1", 3, 1, {1}, 1, {1}]] \[RuleDelayed] 1\/3, HoldPattern[probability["p1", 3, 1, {2}, 1, {1}]] \[RuleDelayed] 1\/3, HoldPattern[probability["p1", 3, 1, {2}, 1, {2}]] \[RuleDelayed] 1\/3, HoldPattern[probability["p1", 3, 1, {1, 2}, 1, {1, 1}]] \[RuleDelayed] 1\/9, HoldPattern[ probability["p1", 3, 1, {1, 2}, 1, {1, 2}]] \[RuleDelayed] 2\/9, HoldPattern[probability["p1", 3, 2, {1}, 1, {1}]] \[RuleDelayed] 1\/3, HoldPattern[probability["p1", 3, 2, {1}, 2, {1}]] \[RuleDelayed] 2\/9, HoldPattern[probability["p1", 3, 2, {2}, 1, {2}]] \[RuleDelayed] 1\/3, HoldPattern[probability["p1", 3, 2, {2}, 2, {1}]] \[RuleDelayed] 2\/9, HoldPattern[probability["p1", 3, 2, {2}, 2, {2}]] \[RuleDelayed] 2\/9, HoldPattern[probability["p1", 3, 2, {1, 2}, 1, {1, 2}]] \[RuleDelayed] 2\/9, HoldPattern[ probability["p1", 3, 2, {1, 2}, 2, {1, 1}]] \[RuleDelayed] 10\/81, HoldPattern[probability["p1", 3, 2, {1, 2}, 2, {1, 2}]] \[RuleDelayed] 20\/81, HoldPattern[ probability["p1", 3, 3, {1, 2}, 1, {1, 2}]] \[RuleDelayed] 2\/9, HoldPattern[probability["p1", 3, 3, {1, 2}, 2, {1, 2}]] \[RuleDelayed] 20\/81, HoldPattern[ probability["p1", 3, 3, {1, 2}, 3, {1, 1}]] \[RuleDelayed] 64\/729, HoldPattern[probability["p1", 3, 3, {1, 2}, 3, {1, 2}]] \[RuleDelayed] 128\/729, HoldPattern[probability["p2", 3, 1, {1}, 1, {1}]] \[RuleDelayed] 1\/3, HoldPattern[probability["p2", 3, 1, {2}, 1, {1}]] \[RuleDelayed] 1\/3, HoldPattern[probability["p2", 3, 1, {2}, 1, {2}]] \[RuleDelayed] 1\/3, HoldPattern[probability["p2", 3, 1, {1, 2}, 1, {1, 1}]] \[RuleDelayed] 1\/9, HoldPattern[ probability["p2", 3, 1, {1, 2}, 1, {1, 2}]] \[RuleDelayed] 2\/9, HoldPattern[probability["p2", 3, 2, {1}, 2, {1}]] \[RuleDelayed] 1\/3, HoldPattern[probability["p2", 3, 2, {2}, 2, {1}]] \[RuleDelayed] 1\/3, HoldPattern[probability["p2", 3, 2, {2}, 2, {2}]] \[RuleDelayed] 1\/3, HoldPattern[probability["p2", 3, 2, {1, 2}, 2, {1, 1}]] \[RuleDelayed] 13\/81, HoldPattern[ probability["p2", 3, 2, {1, 2}, 2, {1, 2}]] \[RuleDelayed] 26\/81, HoldPattern[probability["p2", 3, 3, {1, 2}, 3, {1, 1}]] \[RuleDelayed] 121\/729, HoldPattern[probability["p2", 3, 3, {1, 2}, 3, {1, 2}]] \[RuleDelayed] 242\/729}\)], "Output"] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[ \(With[{d = 3, f = 6, j = 3}, \[IndentingNewLine]Block[{probability}, \ \[IndentingNewLine]With[{\[IndentingNewLine]fateTree1 = fateTree["\", d, f, j], \[IndentingNewLine]fateTree2 = fateTree["\", d, f, j], \[IndentingNewLine]goal = Last@allLagrangeRepresentatives[d, f]}, \[IndentingNewLine]With[{\[IndentingNewLine]strategy1 \ = \(Composition[dropUtility, maxUtilityAndBestStrategy]\)[ fateTree1, \[Delta][goal, #2] &], strategy2 = \(Composition[dropUtility, maxUtilityAndBestStrategy]\)[ fateTree2, \[Delta][ goal, #2] &]\[IndentingNewLine]}, \ \[IndentingNewLine]Timing@\(make[fateTree1, fateTree2, strategy1, strategy2, allLagrangeRepresentatives[d, f]]@ probability[_, _, _, goal, __]\)\[IndentingNewLine]]\[IndentingNewLine]]\ \[IndentingNewLine]]\[IndentingNewLine]]\)], "Input"], Cell[BoxData[ \({0.4099999999999966`\ Second, {{{{1\/36}}, {{227\/2592}, {1\/36, 1\/18, 1\/18, 1\/18, 1\/6, 1\/6, 1\/6}}}, {{{3115\/1119744}, {83\/15552, 1\/81}, {1\/216, 1\/36}}, {{15067\/373248}, {179\/5184, 43\/648, 35\/648, 5\/36}, {1\/72, 1\/18, 1\/36, 1\/6}}, {{21043\/186624}, {227\/2592, 35\/324, 35\/324, 35\/324, 5\/36, 5\/36, 5\/36}, {1\/36, 1\/18, 1\/18, 1\/18, 1\/6, 1\/6, 1\/6}}}, {{{3115\/1119744}, {83\/15552, 1\/81}, {1\/216, 1\/36}}, {{17459\/373248}, {187\/5184, 23\/324, 19\/324, 1\/6}, {1\/72, 1\/18, 1\/36, 1\/6}}, {{24631\/186624}, {239\/2592, 19\/162, 19\/162, 19\/162, 1\/6, 1\/6, 1\/6}, {1\/36, 1\/18, 1\/18, 1\/18, 1\/6, 1\/6, 1\/6}}}}}\)], "Output"] }, Open ]] }, Open ]], Cell[CellGroupData[{ Cell["Ensemble des probabilit\[EAcute]s d'arr\[EHat]t non trivialement \ nulles", "Subsubsection", CellTags->"c:63"], Cell[TextData[{ "En utilisant l'invariance par permutation de faces, on peut restreindre le \ but \[AGrave] l'ensemble des repr\[EAcute]sentants ou restreindre le r\ \[EAcute]sultat \[AGrave] l'ensemble des repr\[EAcute]sentants conditionn\ \[EAcute]s par le but. Pense-b\[EHat]te : ", StyleBox["True", "Output"], " dans les options r\[EAcute]duit le domaine." }], "Text", TextAlignment->Left], Cell[BoxData[{\(Options@probability = {restrictGoal \[Rule] False, restrictResult \[Rule] False};\), "\[IndentingNewLine]", RowBox[{ RowBox[{ RowBox[{"make", "[", StyleBox[\(d_, j_, options1___\), FontWeight->"Bold"], StyleBox["]", FontWeight->"Bold"]}], StyleBox["@", FontWeight->"Bold"], \(probability[_, f_, __]\)}], ":=", "\[IndentingNewLine]", \(With[{\[IndentingNewLine]fateTree1 = fateTree["\", d, f, j], \[IndentingNewLine]fateTree2 = fateTree["\", d, f, j]\[IndentingNewLine]}, \[IndentingNewLine]\(With[{goal = #}, \ \[IndentingNewLine]With[{\[IndentingNewLine]strategy1 = \(Composition[ dropUtility, maxUtilityAndBestStrategy]\)[ fateTree1, \[Delta][ goal, #2] &], \[IndentingNewLine]strategy2 = \ \(Composition[dropUtility, maxUtilityAndBestStrategy]\)[ fateTree2, \[Delta][goal, #2] &], resultList = \[IndentingNewLine]If[\(restrictResult /. \ {options1}\) /. Options@probability, \(allConditionalLagrangeRepresentatives[ goal]\)[d, f], allCombinations[d, f]]}, make[fateTree1, fateTree2, strategy1, strategy2, resultList]@ probability[_, _, _, goal, __]\[IndentingNewLine]]\[IndentingNewLine]] &\) \ /@ \[IndentingNewLine]If[\(restrictGoal /. {options1}\) /. Options@probability, allLagrangeRepresentatives[d, f], allCombinations[d, f]]]\)}]}], "Input", InitializationCell->True], Cell["\<\ V\[EAcute]rifier, selon les options, ce qui est m\[EAcute]moris\ \[EAcute] et ce qui ne l'est pas, ainsi que la dur\[EAcute]e.\ \>", "Text"], Cell[BoxData[ \(probability1 := {\[IndentingNewLine]probability["\", f, j, {1, 2}, j, {1, 3}], \[IndentingNewLine]probability["\", f, j, {1, 2}, j, {2, 3}], \[IndentingNewLine]probability["\", f, j, {2, 2}, j, {1, 1}]}\)], "Input"], Cell["1000 MHz 0.18 Second", "Text"], Cell[CellGroupData[{ Cell[BoxData[ RowBox[{\({d = 2, f = 3, j = 3}\), ";", RowBox[{"First", "@", RowBox[{"Timing", "@", RowBox[{"Block", "[", RowBox[{\({probability}\), ",", RowBox[{ RowBox[{ RowBox[{"make", "[", StyleBox[\(d, j, restrictGoal \[Rule] True, restrictResult \[Rule] True\), FontWeight->"Bold"], StyleBox["]", FontWeight->"Bold"]}], StyleBox["@", FontWeight->"Bold"], \(probability[_, f, __]\)}], StyleBox[";", FontWeight->"Bold"], "\[IndentingNewLine]", RowBox[{"scanPrint", "@", StyleBox["probability1", FontWeight->"Bold"]}]}]}], StyleBox["]", FontWeight->"Bold"]}]}]}]}]], "Input"], Cell[BoxData[ \(65\/729\)], "Print"], Cell[BoxData[ \(probability["p1", 3, 3, {1, 2}, 3, {2, 3}]\)], "Print"], Cell[BoxData[ \(probability["p1", 3, 3, {2, 2}, 3, {1, 1}]\)], "Print"], Cell[BoxData[ \(0.16999999999999993`\ Second\)], "Output"] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[ RowBox[{"First", "@", RowBox[{"Timing", "@", RowBox[{"Block", "[", RowBox[{\({probability}\), ",", RowBox[{ RowBox[{ RowBox[{"make", "[", StyleBox[\(d, j, restrictGoal \[Rule] True, restrictResult \[Rule] False\), FontWeight->"Bold"], StyleBox["]", FontWeight->"Bold"]}], StyleBox["@", FontWeight->"Bold"], \(probability[_, f, __]\)}], StyleBox[";", FontWeight->"Bold"], "\[IndentingNewLine]", RowBox[{"scanPrint", "@", StyleBox["probability1", FontWeight->"Bold"]}]}]}], StyleBox["]", FontWeight->"Bold"]}]}]}]], "Input"], Cell[BoxData[ \(65\/729\)], "Print"], Cell[BoxData[ \(65\/729\)], "Print"], Cell[BoxData[ \(probability["p1", 3, 3, {2, 2}, 3, {1, 1}]\)], "Print"], Cell[BoxData[ \(0.2099999999999973`\ Second\)], "Output"] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[ RowBox[{"First", "@", RowBox[{"Timing", "@", RowBox[{"Block", "[", RowBox[{\({probability}\), ",", RowBox[{ RowBox[{ RowBox[{"make", "[", StyleBox[\(d, j, restrictGoal \[Rule] False, restrictResult \[Rule] True\), FontWeight->"Bold"], StyleBox["]", FontWeight->"Bold"]}], StyleBox["@", FontWeight->"Bold"], \(probability[_, f, __]\)}], StyleBox[";", FontWeight->"Bold"], "\[IndentingNewLine]", RowBox[{"scanPrint", "@", StyleBox["probability1", FontWeight->"Bold"]}]}]}], StyleBox["]", FontWeight->"Bold"]}]}]}]], "Input"], Cell[BoxData[ \(65\/729\)], "Print"], Cell[BoxData[ \(probability["p1", 3, 3, {1, 2}, 3, {2, 3}]\)], "Print"], Cell[BoxData[ \(16\/729\)], "Print"], Cell[BoxData[ \(0.46000000000000085`\ Second\)], "Output"] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[ RowBox[{"First", "@", RowBox[{"Timing", "@", RowBox[{"Block", "[", RowBox[{\({probability}\), ",", RowBox[{ RowBox[{ RowBox[{"make", "[", StyleBox[\(d, j, restrictGoal \[Rule] False, restrictResult \[Rule] False\), FontWeight->"Bold"], StyleBox["]", FontWeight->"Bold"]}], StyleBox["@", FontWeight->"Bold"], \(probability[_, f, __]\)}], ";", "\[IndentingNewLine]", RowBox[{"scanPrint", "@", StyleBox["probability1", FontWeight->"Bold"]}]}]}], StyleBox["]", FontWeight->"Bold"]}]}]}]], "Input"], Cell[BoxData[ \(65\/729\)], "Print"], Cell[BoxData[ \(65\/729\)], "Print"], Cell[BoxData[ \(16\/729\)], "Print"], Cell[BoxData[ \(0.5800000000000018`\ Second\)], "Output"] }, Open ]], Cell[BoxData[ \({d =. , f =. , j =. }; probability1 =. \)], "Input"], Cell["Co\[UHat]t de calcul et de m\[EAcute]morisation des \ probabilit\[EAcute]s d'arr\[EHat]t.", "Text"], Cell[BoxData[{ \(Clear@cost; Attributes@cost = {HoldFirst};\), "\[IndentingNewLine]", \(cost@\(make[d_, j_, options1___]@ probability[_, f_, __]\) := \[IndentingNewLine]With[{probabilityOptions = Options@probability}, \[IndentingNewLine]Block[{probability}, \ \[IndentingNewLine]\(Length@ allCombinations[d, f] # &\) /@ \ {\[IndentingNewLine]With[{\[IndentingNewLine]fateTree1 = fateTree["\", d, f, j], \[IndentingNewLine]fateTree2 = fateTree["\", d, f, j], \[IndentingNewLine]goal = Last@allLagrangeRepresentatives[d, f]}, \[IndentingNewLine]First@\(Timing@\ \[IndentingNewLine]With[{\[IndentingNewLine]strategy1 = \(Composition[ dropUtility, maxUtilityAndBestStrategy]\)[ fateTree1, \[Delta][goal, #2] &], strategy2 = \(Composition[dropUtility, maxUtilityAndBestStrategy]\)[ fateTree2, \[Delta][goal, #2] &], resultList = \[IndentingNewLine]If[\(restrictResult /. \ {options1}\) /. probabilityOptions, \(allConditionalLagrangeRepresentatives[ goal]\)[d, f], allCombinations[d, f]]}, \[IndentingNewLine]make[ fateTree1, fateTree2, strategy1, strategy2, resultList]@ probability[_, f, _, goal, __]\[IndentingNewLine]]\)\[IndentingNewLine]],\ \[IndentingNewLine]ByteCount@\(DownValues@ probability\)\[IndentingNewLine]}\[IndentingNewLine]]\ \[IndentingNewLine]]\)}], "Input", InitializationCell->True], Cell[CellGroupData[{ Cell[BoxData[ \(cost@\(make[2, 3]@probability[_, 3, __]\)\)], "Input"], Cell[BoxData[ \({0.5400000000000205`\ Second, 105888}\)], "Output"] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[ \(Block[{probability}, First@\(Timing@\(make[2, 3, restrictGoal \[Rule] False, restrictResult \[Rule] False]@ probability[_, 3, __]\)\)]\)], "Input"], Cell[BoxData[ \(0.5599999999999952`\ Second\)], "Output"] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[ \(cost@\(make[3, 3, restrictResult \[Rule] True]@ probability[_, 6, __]\)\)], "Input"], Cell[BoxData[ \({114.79999999999984`\ Second, 2188032}\)], "Output"] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[ \(Block[{probability}, First@\(Timing@\(make[3, 3, restrictGoal \[Rule] False, restrictResult \[Rule] True]@ probability[_, 6, __]\)\)]\)], "Input"], Cell[BoxData[ \(129.23000000000002`\ Second\)], "Output"] }, Open ]], Cell["1000 MHz 399 Second", "Text"], Cell[CellGroupData[{ Cell[BoxData[ \(cost@\(make[3, 3]@probability[_, 6, __]\)\)], "Input"], Cell[BoxData[ \({399.27999999999975`\ Second, 11113984}\)], "Output"] }, Open ]], Cell["\<\ Je ne r\[EAcute]duis pas le domaine. Avantages : acc\[EGrave]s \ instantan\[EAcute] (sans passer par les repr\[EAcute]sentants), possibilit\ \[EAcute] de v\[EAcute]rifier l'invariance.\ \>", "Text", TextAlignment->Left] }, Open ]], Cell[CellGroupData[{ Cell["Sauver et relire", "Subsubsection", CellTags->"c:64"], Cell[TextData[{ "Un fichier pour chaque ", Cell[BoxData[ \(TraditionalForm\`{d, f, j}\)]], ". S\[EAcute]parateur ", StyleBox["_", FontWeight->"Bold"], " pour le cas o\[UGrave] un param\[EGrave]tre serait ", Cell[BoxData[ \(TraditionalForm\`\(\(>\)\(9\)\)\)]], "." }], "Text"], Cell[BoxData[ \(Clear@dfj; dfj[name_String, d_, f_, j_] := StringJoin[name, ToString /@ {d, "\<_\>", f, "\<_\>", j, "\<.txt\>"}]\)], "Input", InitializationCell->True], Cell[CellGroupData[{ Cell[BoxData[ \(dfj["\", 2, 3, 4]\)], "Input"], Cell[BoxData[ \("toto2_3_4.txt"\)], "Output"] }, Open ]], Cell[TextData[{ "Sauver une fonction, plut\[OHat]t qu'une liste. Avantage : donn\[EAcute]es \ d\[EAcute]structur\[EAcute]es, moindre risque de corruption. \ Inconv\[EAcute]nient : un nom de fonction est r\[EAcute]p\[EAcute]t\[EAcute] \ un grand nombre de fois. \[Wolf] ", StyleBox["Block", "Output"], " bloque la valeur amont ", Cell[BoxData[ \(TraditionalForm\`Options@probability\)]], "." }], "Text"], Cell[BoxData[ \(call[d_, j_]@probability[_, f_, __] := With[{dfj1 = dfj["\", d, f, j]}, \(If[\[IndentingNewLine]dfj1~ myElement~FileNames[], \[IndentingNewLine]Print["\", dfj1]; Get@ dfj1, \[IndentingNewLine]Block[{probability}, \ \[IndentingNewLine]make[d, j, restrictGoal \[Rule] False, restrictResult \[Rule] False]@probability[_, f, __]; Print["\", dfj1]; \[IndentingNewLine]Save[dfj1, probability]\[IndentingNewLine]]; Print["\", dfj1]; Get@dfj1];\)]\)], "Input", InitializationCell->True], Cell[CellGroupData[{ Cell[BoxData[ \(Timing@\(call[3, 3]@probability[_, 6, __]\)\)], "Input", Evaluatable->False], Cell[BoxData[ InterpretationBox[\("Save "\[InvisibleSpace]"probability3_6_3"\), SequenceForm[ "Save ", "probability3_6_3"], Editable->False]], "Print"], Cell[BoxData[ \({499.28000000000003`\ Second, Null}\)], "Output"] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[{ \(call[2, 3]@probability[_, 3, __]\), "\[IndentingNewLine]", \(call[3, 3]@probability[_, 6, __]\)}], "Input", InitializationCell->True], Cell[BoxData[ InterpretationBox[\("Get "\[InvisibleSpace]"probability2_3_3.txt"\), SequenceForm[ "Get ", "probability2_3_3.txt"], Editable->False]], "Print"], Cell[BoxData[ InterpretationBox[\("Get "\[InvisibleSpace]"probability3_6_3.txt"\), SequenceForm[ "Get ", "probability3_6_3.txt"], Editable->False]], "Print"] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[ \(call[2, 3]@probability[_, 4, __]\)], "Input"], Cell[BoxData[ InterpretationBox[\("Save "\[InvisibleSpace]"probability2_4_3.txt"\), SequenceForm[ "Save ", "probability2_4_3.txt"], Editable->False]], "Print"], Cell[BoxData[ InterpretationBox[\("Get "\[InvisibleSpace]"probability2_4_3.txt"\), SequenceForm[ "Get ", "probability2_4_3.txt"], Editable->False]], "Print"] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[ \(call[1, 3]@probability[_, 2, __]\)], "Input"], Cell[BoxData[ InterpretationBox[\("Save "\[InvisibleSpace]"probability1_2_3.txt"\), SequenceForm[ "Save ", "probability1_2_3.txt"], Editable->False]], "Print"], Cell[BoxData[ InterpretationBox[\("Get "\[InvisibleSpace]"probability1_2_3.txt"\), SequenceForm[ "Get ", "probability1_2_3.txt"], Editable->False]], "Print"] }, Open ]] }, Open ]], Cell[CellGroupData[{ Cell["Approximation Monte Carlo des probabilit\[EAcute]s de succ\[EGrave]s", \ "Subsubsection", CellTags->{"section3", "c:65"}], Cell["Suite al\[EAcute]atoire de faces.", "Text"], Cell[BoxData[ \(Clear@drawDice; drawDice[f_Integer, drawNumber_Integer] := Table[Ceiling[f\ Random[]], {drawNumber}]\)], "Input", InitializationCell->True], Cell[CellGroupData[{ Cell[BoxData[ \(f = 6; seed = 1; SeedRandom[seed]; drawDice[f, 50]\)], "Input"], Cell[BoxData[ \({5, 5, 5, 1, 6, 4, 5, 6, 1, 4, 5, 5, 4, 2, 4, 4, 6, 1, 6, 6, 6, 2, 5, 2, 2, 3, 6, 1, 3, 5, 2, 2, 2, 2, 3, 3, 4, 1, 5, 5, 5, 6, 6, 6, 5, 4, 2, 4, 4, 2}\)], "Output"] }, Open ]], Cell[TextData[{ "Politique \[AGrave] cliquet. L'\[EAcute]l\[EAcute]ment en position ", Cell[BoxData[ \(TraditionalForm\`j1\)]], " est la combinaison-but relatif apr\[EGrave]s ", Cell[BoxData[ \(TraditionalForm\`j1\)]], " lancers (vide apr\[EGrave]s un succ\[EGrave]s)." }], "Text"], Cell[CellGroupData[{ Cell[BoxData[ \(goal = {1, 5, 1}; SeedRandom[seed]; Rest[NestList[#\[Backslash]drawDice[f, Length@#] &, goal, 6]]\)], "Input"], Cell[BoxData[ \({{1, 1}, {1}, {1}, {1}, {1}, {}}\)], "Output"] }, Open ]], Cell["Le succ\[EGrave]s n'est pas encore achev\[EAcute] apr\[EGrave]s 3 \ lancers.", "Text"], Cell[CellGroupData[{ Cell[BoxData[{ \(\(SeedRandom[seed];\)\), "\[IndentingNewLine]", \(Nest[#\[Backslash]drawDice[f, Length@#] &, goal, 3] \[Equal] {}\)}], "Input"], Cell[BoxData[ \(False\)], "Output"] }, Open ]], Cell[BoxData[ \(\({f, seed, goal} =. ;\)\)], "Input"], Cell[TextData[{ "Succ\[EGrave]s achev\[EAcute] apr\[EGrave]s au plus ", Cell[BoxData[ \(TraditionalForm\`j\)]], " lancers ?" }], "Text"], Cell[BoxData[ \(Clear@monteCarloSuccessQ; monteCarloSuccessQ[f_, j_Integer, goal_] := Nest[#\[Backslash]drawDice[f, Length@#] &, goal, j] \[Equal] {}\)], "Input", InitializationCell->True], Cell[CellGroupData[{ Cell[BoxData[ \(seed = 1; SeedRandom[seed]; monteCarloSuccessQ[6, 1, {5, 5, 5}]\)], "Input"], Cell[BoxData[ \(True\)], "Output"] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[ \(SeedRandom[seed]; monteCarloSuccessQ[6, 1, {5, 5, 1}]\)], "Input"], Cell[BoxData[ \(False\)], "Output"] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[ \(SeedRandom[seed]; monteCarloSuccessQ[6, 2, {5, 5, 1}]\)], "Input"], Cell[BoxData[ \(True\)], "Output"] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[ \(SeedRandom[seed]; monteCarloSuccessQ[6, 2, {5, 5, 6}]\)], "Input"], Cell[BoxData[ \(False\)], "Output"] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[ \(SeedRandom[seed]; monteCarloSuccessQ[6, 3, {5, 5, 6}]\)], "Input"], Cell[BoxData[ \(True\)], "Output"] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[ \(SeedRandom[seed]; monteCarloSuccessQ[6, 3, {1, 1, 1}]\)], "Input"], Cell[BoxData[ \(False\)], "Output"] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[ \(SeedRandom[seed]; Table[monteCarloSuccessQ[6, 3, {2, 3, 3}], {4}]\)], "Input"], Cell[BoxData[ \({False, False, False, True}\)], "Output"] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[ \(j = 3; trialNumber = 4; SeedRandom[seed]; 1. Count[Table[monteCarloSuccessQ[6, j, {1, 2, 3}], {trialNumber}], True]/trialNumber\)], "Input"], Cell[BoxData[ \(0.25`\)], "Output"] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[ \(trialNumber = 1000; SeedRandom[seed]; 1. Count[Table[monteCarloSuccessQ[6, j, {1, 2, 3}], {trialNumber}], True]/trialNumber\)], "Input"], Cell[BoxData[ \(0.228`\)], "Output"] }, Open ]], Cell[BoxData[ \(\({j, seed, trialNumber} =. ;\)\)], "Input"], Cell[BoxData[ \(Clear@monteCarloSuccessProbability; monteCarloSuccessProbability[f_, j_, goal_, trialNumber_Integer] := \[IndentingNewLine]1. Count[Table[monteCarloSuccessQ[f, j, goal], {trialNumber}], True]/ trialNumber\)], "Input", InitializationCell->True], Cell[CellGroupData[{ Cell[BoxData[ \(SeedRandom[1]; monteCarloSuccessProbability[6, 3, {1, 1, 2}, 1000]\)], "Input"], Cell[BoxData[ \(0.163`\)], "Output"] }, Open ]], Cell["\<\ R\[EAcute]p\[EAcute]ter pour se faire une id\[EAcute]e de la \ dispersion statistique. \ \>", "Text"], Cell[CellGroupData[{ Cell[BoxData[ \({d = 3, f = 6, j = 3}; allLagrangeRepresentatives[d, f]\)], "Input"], Cell[BoxData[ \({{1, 1, 1}, {1, 1, 2}, {1, 2, 3}}\)], "Output"] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[ \(SeedRandom[1]; Timing[monteCarloSuccessProbabilityListSample = Table[\(monteCarloSuccessProbability[f, j, #, 400] &\) /@ allLagrangeRepresentatives[d, f], {6}]]\)], "Input"], Cell[BoxData[ \({3.4100000000000037`\ Second, {{0.085`, 0.1625`, 0.235`}, {0.08`, 0.18`, 0.2075`}, {0.0575`, 0.1575`, 0.2425`}, {0.06`, 0.1625`, 0.2175`}, {0.06`, 0.1175`, 0.2175`}, {0.065`, 0.1475`, 0.24`}}}\)], "Output"] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[ \(myDispersionReport /@ Transpose@monteCarloSuccessProbabilityListSample\)], "Input"], Cell[BoxData[ \({{0.06791666666666667`, 0.010647443615983866`}, {0.15458333333333332`, 0.019171195117212235`}, {0.22666666666666668`, 0.01312334645668635`}}\)], "Output"] }, Open ]], Cell[CellGroupData[{ Cell["V\[EAcute]rifier l'accord entre valeurs exactes et approch\[EAcute]es", \ "Outline2"], Cell["\<\ Il y a plus de fluctuation pour la plus petite probabilit\[EAcute], \ celle du brelan. \ \>", "Text"], Cell[CellGroupData[{ Cell[BoxData[ \(successProbabilityList = \(successProbability[ fateTree["\", d, f, j], #] &\) /@ allLagrangeRepresentatives[d, f]\)], "Input"], Cell[BoxData[ \({753571\/10077696, 43013\/279936, 42571\/186624}\)], "Output"] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[ \(1. %\)], "Input"], Cell[BoxData[ \({0.07477611946222629`, 0.1536529778235025`, 0.2281110682441701`}\)], "Output"] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[ \(MapThread[\((#1/#2)\) &, {myDispersionReport /@ Transpose@monteCarloSuccessProbabilityListSample, successProbabilityList}]\)], "Input"], Cell[BoxData[ \({{0.9082667990142933`, 0.14239096241631663`}, {1.0060549136307626`, 0.12476943427177654`}, {0.9936679899462075`, 0.057530511595514165`}}\)], "Output"] }, Open ]], Cell[BoxData[ \(\({d, f, j, monteCarloSuccessProbabilityListSample, successProbabilityList} =. ;\)\)], "Input"], Cell[TextData[{ StyleBox["trialNumber1", "Output"], " et ", StyleBox["trialNumber2", "Output"], " r\[EAcute]duisent respectivement l'incertitude sur la moyenne et \ l'incertitude empiriques.\n\[WarningSign] \[CapitalEAcute]tendre aux autres \ probabilit\[EAcute]s." }], "Text"], Cell[BoxData[ \(Clear@monteCarloSuccessProbabilityTest; monteCarloSuccessProbabilityTest[d_, f_, j_, trialNumber1_, trialNumber2_Integer] := With[\[IndentingNewLine]{\[IndentingNewLine]\ monteCarloSuccessProbabilityListSample = Table[\(monteCarloSuccessProbability[f, j, #, trialNumber1] &\) /@ allLagrangeRepresentatives[d, f], {trialNumber2}], \ \[IndentingNewLine]successProbabilityList = \(successProbability[ fateTree["\", d, f, j], #] &\) /@ allLagrangeRepresentatives[d, f]\[IndentingNewLine]}, \ \[IndentingNewLine]MapThread[\((#1/#2)\) &, {myDispersionReport /@ Transpose@monteCarloSuccessProbabilityListSample, successProbabilityList}]]\)], "Input", InitializationCell->True], Cell[BoxData[ \(\(SeedRandom[1];\)\)], "Input"], Cell[CellGroupData[{ Cell[BoxData[ \(monteCarloSuccessProbabilityTest[3, 6, 3, 1000, 6]\)], "Input"], Cell[BoxData[ \({{0.922754490286914`, 0.097358754929214`}, {0.9827339641503731`, 0.06519009877168602`}, {0.9936679899462074`, 0.050026047692116334`}}\)], "Output"] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[ \(monteCarloSuccessProbabilityTest[3, 6, 3, 10000, 10]\)], "Input"], Cell[BoxData[ \({{1.0247924143577714`, 0.04034668687047404`}, {0.9915199962801944`, 0.026369342682473634`}, {0.9977157257287826`, 0.021291560178093385`}}\)], "Output"] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[ \(Timing@monteCarloSuccessProbabilityTest[3, 6, 3, 50000, 10]\)], "Input"], Cell[BoxData[ \({717.69`\ Second, {{1.004358083036635`, 0.013958730109874796`}, {0.9966484357752305`, 0.009035527419914051`}, {1.0009071535082568`, 0.0057599514251491695`}}}\)], "Output", Editable->False] }, Open ]] }, Open ]] }, Open ]] }, Open ]], Cell[CellGroupData[{ Cell["V\[EAcute]rification des probabilit\[EAcute]s d'arr\[EHat]t", \ "Subsection", CellTags->"c:66"], Cell[CellGroupData[{ Cell["Param\[EGrave]tres dynamiques", "Subsubsection", CellTags->"c:67"], Cell[BoxData[ \(Clear@dynamicParameters; dynamicParameters[d_Integer, j_Integer] := Join[Distribute[{Range[d - 1], Range[j - 1]}, List], Distribute[{d, Range@j}, List]]\)], "Input", InitializationCell->True], Cell[CellGroupData[{ Cell[BoxData[ \({d = 2, f = 3, j = 4}; dynamicParameters[d, j]\)], "Input"], Cell[BoxData[ \({{1, 1}, {1, 2}, {1, 3}, {2, 1}, {2, 2}, {2, 3}, {2, 4}}\)], "Output"] }, Open ]], Cell[TextData[{ "V\[EAcute]rifier que l'ensemble pr\[EAcute]c\[EAcute]dent correspond au \ domaine des probabilit\[EAcute]s utiles. Si ", Cell[BoxData[ \(TraditionalForm\`d1 < d\)]], ", alors le tour est d\[EAcute]j\[AGrave] commenc\[EAcute] donc ", Cell[BoxData[ \(TraditionalForm\`j1 < j\)]], "." }], "Text"], Cell[CellGroupData[{ Cell[BoxData[ \(Block[{probability}, \[IndentingNewLine]call[d, j]@ probability[_, f, __]; \[IndentingNewLine]Select[\[IndentingNewLine]Distribute[{\ Range@d, Range@j}, List], NumberQ@\[IndentingNewLine]probability["\", f, Last@#, Table[1, {First@#}], Last@#, Table[1, {First@#}]]\[IndentingNewLine] &]]\)], "Input"], Cell[BoxData[ InterpretationBox[\("Get "\[InvisibleSpace]"probability2_3_4.txt"\), SequenceForm[ "Get ", "probability2_3_4.txt"], Editable->False]], "Print"], Cell[BoxData[ \({{1, 1}, {1, 2}, {1, 3}, {2, 1}, {2, 2}, {2, 3}, {2, 4}}\)], "Output"] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[ \(% \[Equal] dynamicParameters[d, j]\)], "Input"], Cell[BoxData[ \(True\)], "Output"] }, Open ]], Cell[BoxData[ \(\({d =. , f =. , j =. };\)\)], "Input"] }, Open ]], Cell[CellGroupData[{ Cell["\<\ Au dernier lancer, les probabilit\[EAcute]s sont \ ind\[EAcute]pendantes du but\ \>", "Subsubsection", CellTags->"c:68"], Cell["\[CapitalEAcute]vident\[Ellipsis]", "Text"] }, Open ]], Cell[CellGroupData[{ Cell["\<\ Les probabilit\[EAcute]s d'un premier joueur ne d\[EAcute]pendent \ pas du nombre de lancers restants\ \>", "Subsubsection", CellTags->"c:69"], Cell[CellGroupData[{ Cell[BoxData[{ \(\({d = 3, f = 6, j = 3};\)\), "\n", \(With[{goal = Table[1, {d}]}, \[IndentingNewLine]\(probability["\", f, #, goal, 1, goal] &\) /@ Range@j]\)}], "Input"], Cell[BoxData[ \({1\/216, 1\/216, 1\/216}\)], "Output"] }, Open ]], Cell[BoxData[ \(And @@ \(constantQ /@ Flatten[\[IndentingNewLine]\(With[{goal = #}, \ \[IndentingNewLine]Table[ probability["\", f, j1, goal, j2, goal], {j2, j - 1}, {j1, j2, j}]\[IndentingNewLine]] &\) /@ allCombinations[d, f], 1]\)\)], "Input"], Cell[CellGroupData[{ Cell[BoxData[ \(\((\(With[{d1 = First@#, j1 = Last@#}, \[IndentingNewLine]allCombinations[d1, f]] &\) /@ dynamicParameters[d, j])\)[\([\(-1\)]\)]\)], "Input"], Cell[BoxData[ \({{1, 1, 1}, {1, 1, 2}, {1, 1, 3}, {1, 1, 4}, {1, 1, 5}, {1, 1, 6}, {1, 2, 2}, {1, 2, 3}, {1, 2, 4}, {1, 2, 5}, {1, 2, 6}, {1, 3, 3}, {1, 3, 4}, {1, 3, 5}, {1, 3, 6}, {1, 4, 4}, {1, 4, 5}, {1, 4, 6}, {1, 5, 5}, {1, 5, 6}, {1, 6, 6}, {2, 2, 2}, {2, 2, 3}, {2, 2, 4}, {2, 2, 5}, {2, 2, 6}, {2, 3, 3}, {2, 3, 4}, {2, 3, 5}, {2, 3, 6}, {2, 4, 4}, {2, 4, 5}, {2, 4, 6}, {2, 5, 5}, {2, 5, 6}, {2, 6, 6}, {3, 3, 3}, {3, 3, 4}, {3, 3, 5}, {3, 3, 6}, {3, 4, 4}, {3, 4, 5}, {3, 4, 6}, {3, 5, 5}, {3, 5, 6}, {3, 6, 6}, {4, 4, 4}, {4, 4, 5}, {4, 4, 6}, {4, 5, 5}, {4, 5, 6}, {4, 6, 6}, {5, 5, 5}, {5, 5, 6}, {5, 6, 6}, {6, 6, 6}}\)], "Output"] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[ \(\((\(With[{d1 = First@#, j1 = Last@#}, \[IndentingNewLine]\(With[{goal = #}, \ \[IndentingNewLine]Table[ probability["\", f, j3, goal, j2, goal], {j2, j1 - 1}, {j3, j2, j1}]\[IndentingNewLine]] &\) \ /@ \[IndentingNewLine]allCombinations[d1, f]\[IndentingNewLine]] &\) /@ dynamicParameters[d, j])\)[\([\(-1\), 1]\)]\)], "Input"], Cell[BoxData[ \({{1\/216, 1\/216, 1\/216}, {1115\/46656, 1115\/46656}}\)], "Output"] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[ \(Apply[And, constantQ /@ Flatten[\[IndentingNewLine]\(With[{d1 = First@#, j1 = Last@#}, \[IndentingNewLine]\(With[{goal = #}, \ \[IndentingNewLine]Table[ probability["\", f, j3, goal, j2, goal], {j2, j1 - 1}, {j3, j2, j1}]\[IndentingNewLine]] &\) \ /@ \[IndentingNewLine]allCombinations[d1, f]\[IndentingNewLine]] &\) /@ dynamicParameters[d, j], 2]]\)], "Input"], Cell[BoxData[ \(True\)], "Output"] }, Open ]], Cell[BoxData[ \(\({d =. , f =. , j =. };\)\)], "Input"] }, Open ]], Cell[CellGroupData[{ Cell["Somme unitaire", "Subsubsection", CellTags->"c:70"], Cell["Somme sur \[LeftTee].", "Text"], Cell[CellGroupData[{ Cell[BoxData[{ \(\({d = 2, f = 3, j = 3};\)\), "\[IndentingNewLine]", \(Sum[ probability["\", f, j1, goal, j2, goal], {j2, j1 - 1}] + \[IndentingNewLine]Apply[ Plus, \(probability["\", f, j1, goal, j1, #] &\) /@ allCombinations[d, f]]\)}], "Input"], Cell[BoxData[ \(probability["p1", 3, j1, goal, j1, {1, 1}] + probability["p1", 3, j1, goal, j1, {1, 2}] + probability["p1", 3, j1, goal, j1, {1, 3}] + probability["p1", 3, j1, goal, j1, {2, 2}] + probability["p1", 3, j1, goal, j1, {2, 3}] + probability["p1", 3, j1, goal, j1, {3, 3}] + \[Sum]\+\(j2 = 1\)\%\(j1 - 1\)probability["p1", f, j1, goal, j2, goal]\)], "Output"] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[ \(% /. {j1 \[Rule] j - 1, goal \[Rule] \ \(allCombinations[d, f]\)[\([\(-2\)]\)]}\)], "Input"], Cell[BoxData[ \(1\)], "Output"] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[ \(\((\(With[{goal = #}, \[IndentingNewLine]Sum[ probability["\", f, j1, goal, j2, goal], {j2, j1 - 1}] + \[IndentingNewLine]Apply[ Plus, \(probability["\", f, j1, goal, j1, #] &\) /@ allCombinations[d, f]]\[IndentingNewLine]] &\) /@ allCombinations[d, f])\) /. j1 \[Rule] \ j - 1\)], "Input"], Cell[BoxData[ \({1, 1, 1, 1, 1, 1}\)], "Output"] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[ \(Apply[ And, \(# \[Equal] 1 &\) /@ Flatten[\[IndentingNewLine]\(With[{player = #}, \ \[IndentingNewLine]\(With[{d1 = First@#, j1 = Last@#}, \[IndentingNewLine]\(With[{goal = #}, \ \[IndentingNewLine]If[player \[Equal] "\", \[IndentingNewLine]Sum[ probability[player, f, j1, goal, j2, goal], {j2, j1 - 1}], \[IndentingNewLine]0]\ \[IndentingNewLine] + Plus @@ \[IndentingNewLine]\((\(probability[player, f, j1, goal, j1, #] &\) /@ allCombinations[d1, f])\)\[IndentingNewLine]] &\) /@ allCombinations[d1, f]\[IndentingNewLine]] &\) /@ dynamicParameters[d, j]\[IndentingNewLine]] &\) /@ {"\", "\"}]]\)], \ "Input"], Cell[BoxData[ \(True\)], "Output"] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[{ \(\({d = 3, f = 6, j = 3};\)\), "\[IndentingNewLine]", \(Apply[ And, \(# \[Equal] 1 &\) /@ Flatten[\[IndentingNewLine]\(With[{player = #}, \ \[IndentingNewLine]\(With[{d1 = First@#, j1 = Last@#}, \[IndentingNewLine]\(With[{goal = #}, \ \[IndentingNewLine]If[player \[Equal] "\", \[IndentingNewLine]Sum[ probability[player, f, j1, goal, j2, goal], {j2, j1 - 1}], \[IndentingNewLine]0]\ \[IndentingNewLine] + Plus @@ \[IndentingNewLine]\((\(probability[player, f, j1, goal, j1, #] &\) /@ allCombinations[d1, f])\)\[IndentingNewLine]] &\) /@ allCombinations[d1, f]\[IndentingNewLine]] &\) /@ dynamicParameters[d, j]\[IndentingNewLine]] &\) /@ {"\", "\"}]]\)}], \ "Input"], Cell[BoxData[ \(True\)], "Output"] }, Open ]], Cell[BoxData[ \(\({d =. , f =. , j =. };\)\)], "Input"] }, Open ]], Cell[CellGroupData[{ Cell["R\[EAcute]partition temporelle de la probabilit\[EAcute] de succ\ \[EGrave]s", "Subsubsection", CellTags->"c:71"], Cell[CellGroupData[{ Cell[BoxData[{ \(\({d = 3, f = 6, j = 3};\)\), "\[IndentingNewLine]", \(\(successProbability[fateTree["\", d, f, j], #] &\) /@ allLagrangeRepresentatives[d, f]\)}], "Input"], Cell[BoxData[ \({753571\/10077696, 43013\/279936, 42571\/186624}\)], "Output"] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[ \(\(Sum[probability["\", f, j, #, j1, #], {j1, j}] &\) /@ allLagrangeRepresentatives[d, f]\)], "Input"], Cell[BoxData[ \({753571\/10077696, 43013\/279936, 42571\/186624}\)], "Output"] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[ \(% \[Equal] %%\)], "Input"], Cell[BoxData[ \(True\)], "Output"] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[ \(\(successProbability[fateTree["\", d, f, j], #] &\) /@ allLagrangeRepresentatives[d, f]\)], "Input"], Cell[BoxData[ \({513991\/10077696, 26903\/279936, 24631\/186624}\)], "Output"] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[ \(\(probability["\", f, j, #, j, #] &\) /@ allLagrangeRepresentatives[d, f]\)], "Input"], Cell[BoxData[ \({513991\/10077696, 26903\/279936, 24631\/186624}\)], "Output"] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[ \(% \[Equal] %%\)], "Input"], Cell[BoxData[ \(True\)], "Output"] }, Open ]], Cell[BoxData[ \(\({d =. , f =. , j =. };\)\)], "Input"] }, Open ]], Cell[CellGroupData[{ Cell["In\[EAcute]galit\[EAcute]s entre probabilit\[EAcute]s de \ succ\[EGrave]s", "Subsubsection", CellTags->"c:72"], Cell[TextData[{ "Le but-r\[EAcute]sultat \[EAcute]tant donn\[EAcute], la \ probabilit\[EAcute] de succ\[EGrave]s d'un premier joueur est \ sup\[EAcute]rieure (ou \[EAcute]gale si ", Cell[BoxData[ \(TraditionalForm\`j = 1\)]], ") \[AGrave] la probabilit\[EAcute] de succ\[EGrave]s d'un joueur suivant, \ parce qu'un premier joueur a plus de possibilit\[EAcute]s qu'un joueur \ suivant." }], "Text"], Cell[CellGroupData[{ Cell[BoxData[{ \(\({d = 3, f = 6, j = 3};\)\), "\[IndentingNewLine]", \(Apply[ And, \[IndentingNewLine]\(With[{goal = #}, \[IndentingNewLine]Sum[ probability["\", f, j1, goal, j2, goal], {j2, j1}] > probability["\", f, j1, goal, j1, goal]\[IndentingNewLine]] &\) /@ allCombinations[d, f] /. j1 \[Rule] j - 1]\)}], "Input"], Cell[BoxData[ \(True\)], "Output"] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[ RowBox[{"And", "@@", RowBox[{"Flatten", "[", "\[IndentingNewLine]", RowBox[{ RowBox[{ RowBox[{"With", "[", RowBox[{\({d1 = First@#, j1 = Last@#}\), ",", "\[IndentingNewLine]", RowBox[{ RowBox[{ RowBox[{"With", "[", RowBox[{\({goal = #}\), ",", "\[IndentingNewLine]", RowBox[{\(Sum[ probability["\", f, j1, goal, j2, goal], {j2, j1}]\), StyleBox["\[GreaterEqual]", FontColor->RGBColor[1, 0, 0]], \(probability["\", f, j1, goal, j1, goal]\)}]}], "\[IndentingNewLine]", "]"}], "&"}], "/@", \(allCombinations[d1, f]\)}]}], "\[IndentingNewLine]", "]"}], "&"}], "/@", \(dynamicParameters[d, j]\)}], "]"}]}]], "Input"], Cell[BoxData[ \(True\)], "Output"] }, Open ]], Cell[TextData[{ "La probabilit\[EAcute] de succ\[EGrave]s ", StyleBox["\[AGrave] date fixe", FontSlant->"Italic"], " est plus petite pour un premier joueur, qui ne b\[EAcute]n\[EAcute]ficie \ pas de report de succ\[EGrave]s pr\[EAcute]matur\[EAcute]." }], "Text"], Cell[CellGroupData[{ Cell[BoxData[ \(And @@ Flatten[\[IndentingNewLine]\(With[{d1 = First@#, j1 = Last@#}, \[IndentingNewLine]\(With[{goal = #}, \ \[IndentingNewLine]Table[ probability["\", f, j1, goal, j2, goal] \[LessEqual] probability["\", f, j2, goal, j2, goal], {j2, j1}]\[IndentingNewLine]] &\) /@ allCombinations[d1, f]\[IndentingNewLine]] &\) /@ dynamicParameters[d, j]]\)], "Input"], Cell[BoxData[ \(True\)], "Output"] }, Open ]], Cell[BoxData[ \(\({d =. , f =. , j =. };\)\)], "Input"] }, Open ]], Cell[CellGroupData[{ Cell["Invariance par permutation de faces", "Subsubsection", CellTags->"c:73"], Cell["\<\ Probabilit\[EAcute]s de succ\[EGrave]s \[AGrave] date fixe. Pour un \ joueur suivant, elles ne sont utiles qu'au dernier lancer.\ \>", "Text"], Cell[CellGroupData[{ Cell[BoxData[{ \(\({d = 3, f = 6, j = 3};\)\), "\[IndentingNewLine]", \(And @@ Flatten[\[IndentingNewLine]\(With[{player = #}, \ \[IndentingNewLine]\(With[{d1 = First@#, j1 = Last@#}, \[IndentingNewLine]\(With[{goal = #}, \ \[IndentingNewLine]Table[\(probability[player, f, j1, goal, j2, goal] \[Equal] probability[player, f, j1, #1, j2, #2] &\) @@ lagrangeBirepresentative@{goal, goal}, \[IndentingNewLine]{j2, If[player \[Equal] "\", 1, j1], j1}]\[IndentingNewLine]] &\) /@ allCombinations[d1, f]\[IndentingNewLine]] &\) /@ dynamicParameters[d, j]\[IndentingNewLine]] &\) /@ {"\", "\"}]\)}], \ "Input"], Cell[BoxData[ \(True\)], "Output"] }, Open ]], Cell["\<\ Probabilit\[EAcute]s d'\[EAcute]chec, non nulles au dernier lancer \ seulement.\ \>", "Text"], Cell[CellGroupData[{ Cell[BoxData[ \(Timing[ And @@ Flatten[\[IndentingNewLine]\(With[{player = #}, \ \[IndentingNewLine]\(With[{d1 = First@#, j1 = Last@#}, \[IndentingNewLine]\(With[{goal = #}, \ \[IndentingNewLine]\(With[{result = #}, \ \[IndentingNewLine]\(probability["\", f, j1, goal, j1, result] \[Equal] probability["\", f, j1, #1, j1, #2] &\) @@ lagrangeBirepresentative@{goal, result}\[IndentingNewLine]] &\) /@ DeleteCases[allCombinations[d1, f], goal]\[IndentingNewLine]] &\) /@ allCombinations[d1, f]\[IndentingNewLine]] &\) /@ dynamicParameters[d, j]\[IndentingNewLine]] &\) /@ {"\", "\"}]]\)], \ "Input"], Cell[BoxData[ \({85.63`\ Second, True}\)], "Output"] }, Open ]], Cell[CellGroupData[{ Cell["Brisure d'invariance par purification lexicographique", "Outline2"], Cell["\<\ Recalculer les probabilit\[EAcute]s en purifiant les \ strat\[EAcute]gies selon l'ordre lexicographique. Brisure de l'invariance des \ probabilit\[EAcute]s d'\[EAcute]chec, seulement pour un joueur suivant.\ \>", \ "Text"], Cell[CellGroupData[{ Cell[BoxData[ RowBox[{"With", "[", RowBox[{\({d = 2, f = 3, j = 3}\), ",", "\[IndentingNewLine]", RowBox[{"Block", "[", RowBox[{\({probability}\), ",", "\[IndentingNewLine]", RowBox[{ RowBox[{"With", "[", RowBox[{\({\[IndentingNewLine]fateTree1 = fateTree["\", d, f, j], \[IndentingNewLine]fateTree2 = fateTree["\", d, f, j]\[IndentingNewLine]}\), ",", "\[IndentingNewLine]", RowBox[{ RowBox[{ RowBox[{"With", "[", RowBox[{\({goal = #}\), ",", RowBox[{"With", "[", RowBox[{ RowBox[{"{", RowBox[{ RowBox[{"strategy1", "=", RowBox[{ StyleBox["purify", FontColor->RGBColor[1, 0, 0]], StyleBox["@", FontColor->RGBColor[1, 0, 0]], \(\(Composition[dropUtility, maxUtilityAndBestStrategy]\)[ fateTree1, \[Delta][ goal, #2] &]\)}]}], ",", RowBox[{"strategy2", "=", RowBox[{ StyleBox["purify", FontColor->RGBColor[1, 0, 0]], StyleBox["@", FontColor->RGBColor[1, 0, 0]], \(\(Composition[dropUtility, maxUtilityAndBestStrategy]\)[ fateTree2, \[Delta][ goal, #2] &]\)}]}], ",", "\[IndentingNewLine]", \(resultList = allCombinations[d, f]\)}], "}"}], ",", \(make[fateTree1, fateTree2, strategy1, strategy2, resultList]@ probability[_, _, _, goal, __]\)}], "]"}]}], "]"}], "&"}], "/@", \(allCombinations[d, f]\)}]}], "]"}], ";", "\[IndentingNewLine]", "\[IndentingNewLine]", \(\(With[{player = #}, \ \[IndentingNewLine]\(With[{d1 = First@#, j1 = Last@#}, \[IndentingNewLine]\(With[{goal = \ #}, \[IndentingNewLine]\(With[{result = #}, \[IndentingNewLine]If[\ \[IndentingNewLine]\(probability[player, f, j1, goal, j1, result] \[Equal] \ \[IndentingNewLine]probability[player, f, j1, #1, j1, #2] &\) @@ lagrangeBirepresentative@{goal, result}, \[IndentingNewLine]True, \ \[IndentingNewLine]Print@\[IndentingNewLine]{player, j1, {goal, result}, probability[player, f, j1, goal, j1, result], lagrangeBirepresentative@{goal, result}, \(probability[player, f, j1, #1, j1, #2] &\) @@ lagrangeBirepresentative@{goal, result}}; False\[IndentingNewLine]]\ \[IndentingNewLine]] &\) /@ DeleteCases[allCombinations[d1, f], goal]\[IndentingNewLine]] &\) /@ allCombinations[d1, f]\[IndentingNewLine]] &\) /@ dynamicParameters[d, j]\[IndentingNewLine]] &\) /@ {"\", \ "\"}\)}]}], "\[IndentingNewLine]", "]"}]}], "\[IndentingNewLine]", "]"}]], "Input"], Cell[BoxData[ \({"p2", 2, {{1, 2}, {2, 2}}, 10\/81, {{1, 2}, {1, 1}}, 16\/81}\)], "Print"], Cell[BoxData[ \({"p2", 2, {{1, 2}, {2, 3}}, 11\/81, {{1, 2}, {1, 3}}, 17\/81}\)], "Print"], Cell[BoxData[ \({"p2", 2, {{1, 3}, {2, 3}}, 11\/81, {{1, 2}, {1, 3}}, 17\/81}\)], "Print"], Cell[BoxData[ \({"p2", 2, {{1, 3}, {3, 3}}, 10\/81, {{1, 2}, {1, 1}}, 16\/81}\)], "Print"], Cell[BoxData[ \({"p2", 2, {{2, 3}, {1, 3}}, 11\/81, {{1, 2}, {1, 3}}, 17\/81}\)], "Print"], Cell[BoxData[ \({"p2", 2, {{2, 3}, {3, 3}}, 10\/81, {{1, 2}, {1, 1}}, 16\/81}\)], "Print"], Cell[BoxData[ \({"p2", 3, {{1, 2}, {2, 2}}, 91\/729, {{1, 2}, {1, 1}}, 151\/729}\)], "Print"], Cell[BoxData[ \({"p2", 3, {{1, 2}, {2, 3}}, 92\/729, {{1, 2}, {1, 3}}, 152\/729}\)], "Print"], Cell[BoxData[ \({"p2", 3, {{1, 3}, {2, 3}}, 92\/729, {{1, 2}, {1, 3}}, 152\/729}\)], "Print"], Cell[BoxData[ \({"p2", 3, {{1, 3}, {3, 3}}, 91\/729, {{1, 2}, {1, 1}}, 151\/729}\)], "Print"], Cell[BoxData[ \({"p2", 3, {{2, 3}, {1, 3}}, 92\/729, {{1, 2}, {1, 3}}, 152\/729}\)], "Print"], Cell[BoxData[ \({"p2", 3, {{2, 3}, {3, 3}}, 91\/729, {{1, 2}, {1, 1}}, 151\/729}\)], "Print"], Cell[BoxData[ \({{{{True, True}, {True, True}, {True, True}}, {{True, True}, {True, True}, {True, True}}, {{True, True, True, True, True}, {True, True, True, True, True}, {True, True, True, True, True}, {True, True, True, True, True}, {True, True, True, True, True}, {True, True, True, True, True}}, {{True, True, True, True, True}, {True, True, True, True, True}, {True, True, True, True, True}, {True, True, True, True, True}, {True, True, True, True, True}, {True, True, True, True, True}}, {{True, True, True, True, True}, {True, True, True, True, True}, {True, True, True, True, True}, {True, True, True, True, True}, {True, True, True, True, True}, {True, True, True, True, True}}}, {{{True, True}, {True, True}, {True, True}}, {{True, True}, {True, True}, {True, True}}, {{True, True, True, True, True}, {True, True, True, True, True}, {True, True, True, True, True}, {True, True, True, True, True}, {True, True, True, True, True}, {True, True, True, True, True}}, {{True, True, True, True, True}, {True, True, False, False, True}, {True, True, True, False, False}, {True, True, True, True, True}, {True, True, False, True, False}, {True, True, True, True, True}}, {{True, True, True, True, True}, {True, True, False, False, True}, {True, True, True, False, False}, {True, True, True, True, True}, {True, True, False, True, False}, {True, True, True, True, True}}}}\)], "Output"] }, Open ]] }, Open ]] }, Open ]] }, Open ]], Cell[CellGroupData[{ Cell["Tables de probabilit\[EAcute]s d'arr\[EHat]t", "Subsection", CellTags->"c:74"], Cell[CellGroupData[{ Cell["Probabilit\[EAcute]s de succ\[EGrave]s", "Subsubsection", CellTags->"c:75"], Cell["\<\ La loi de probabilit\[EAcute] est m\[EAcute]moris\[EAcute]e sur un \ domaine r\[EAcute]duit. \[Wolf] La somme des probabilit\[EAcute]s sur le \ temps ne donne une probabilit\[EAcute] de succ\[EGrave]s que pour un premier \ joueur.\ \>", "Text"], Cell[CellGroupData[{ Cell[BoxData[{ \(\({d = 2, f = 3, j = 3};\)\), "\[IndentingNewLine]", \(TableForm[\[IndentingNewLine]With[{goal = Table[1, {d}]}, \[IndentingNewLine]{\[IndentingNewLine]\({#, Plus @@ #} &\)@\((\(probability["\", f, j, goal, #, goal] &\) /@ Range@j)\), \[IndentingNewLine]{\(probability["\", f, #, goal, #, goal] &\) /@ Range@j}\[IndentingNewLine]}\[IndentingNewLine]], \ \[IndentingNewLine]TableDirections \[Rule] {Row, Row, Column}, \[IndentingNewLine]TableHeadings \[Rule] {{"\", "\"}}]\)}], "Input"], Cell[BoxData[ InterpretationBox[GridBox[{ {"\<\"First player\"\>", "\<\"Next player\"\>"}, {GridBox[{ {GridBox[{ {\(probability["p1", 3, 3, {1, 1}, 1, {1, 1}]\)}, {\(probability["p1", 3, 3, {1, 1}, 2, {1, 1}]\)}, {\(probability["p1", 3, 3, {1, 1}, 3, {1, 1}]\)} }, RowSpacings->0.25, ColumnSpacings->1, RowAlignments->Baseline, ColumnAlignments->{Left}], \(probability["p1", 3, 3, {1, 1}, 1, {1, 1}] + probability["p1", 3, 3, {1, 1}, 2, {1, 1}] + probability["p1", 3, 3, {1, 1}, 3, {1, 1}]\)} }, RowSpacings->1, ColumnSpacings->3, RowAlignments->Baseline, ColumnAlignments->{Left}], GridBox[{ {GridBox[{ {\(probability["p2", 3, 1, {1, 1}, 1, {1, 1}]\)}, {\(probability["p2", 3, 2, {1, 1}, 2, {1, 1}]\)}, {\(probability["p2", 3, 3, {1, 1}, 3, {1, 1}]\)} }, RowSpacings->0.25, ColumnSpacings->1, RowAlignments->Baseline, ColumnAlignments->{Left}]} }, RowSpacings->1, ColumnSpacings->3, RowAlignments->Baseline, ColumnAlignments->{Left}]} }, RowSpacings->1, ColumnSpacings->1, RowAlignments->Baseline, ColumnAlignments->{Center}], TableForm[ {{{ probability[ "p1", 3, 3, {1, 1}, 1, {1, 1}], probability[ "p1", 3, 3, {1, 1}, 2, {1, 1}], probability[ "p1", 3, 3, {1, 1}, 3, {1, 1}]}, Plus[ probability[ "p1", 3, 3, {1, 1}, 1, {1, 1}], probability[ "p1", 3, 3, {1, 1}, 2, {1, 1}], probability[ "p1", 3, 3, {1, 1}, 3, {1, 1}]]}, {{ probability[ "p2", 3, 1, {1, 1}, 1, {1, 1}], probability[ "p2", 3, 2, {1, 1}, 2, {1, 1}], probability[ "p2", 3, 3, {1, 1}, 3, {1, 1}]}}}, TableDirections -> { Row, Row, Column}, TableHeadings -> {{"First player", "Next player"}}]]], "Output"] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[ \(TableForm[\[IndentingNewLine]\(With[{goal = #}, \ \[IndentingNewLine]\(With[{player = #}, \ \[IndentingNewLine]With[{probabilityList = \(probability[player, f, #, goal, #, goal] &\) /@ Range@j}, Switch[player, \[IndentingNewLine]"\", \({#, \(Plus @@ \ # &\) /@ \((Rest@\(history@#\))\)} &\)@ probabilityList\ , \[IndentingNewLine]"\", \({#} \ &\)@probabilityList]\[IndentingNewLine]]\[IndentingNewLine]] &\) /@ \ {"\", "\"}] &\) /@ allLagrangeRepresentatives[d, f], \[IndentingNewLine]TableDepth \[Rule] 4, \[IndentingNewLine]TableDirections \[Rule] {Column, Row, Row, Column}, TableHeadings \[Rule] {allLagrangeRepresentatives[d, f], {"\", "\"}}]\)], "Input"], Cell[BoxData[ InterpretationBox[GridBox[{ {"\<\"\"\>", "\<\"First player\"\>", "\<\"Next player\"\>"}, {\({1, 1}\), GridBox[{ {\(1\/9\), \(1\/9\)}, {\(16\/81\), \(25\/81\)}, {\(136\/729\), \(361\/729\)} }, RowSpacings->1, ColumnSpacings->0.25, RowAlignments->Baseline, ColumnAlignments->{Left}], GridBox[{ {\(1\/9\)}, {\(19\/81\)}, {\(211\/729\)} }, RowSpacings->1, ColumnSpacings->0.25, RowAlignments->Baseline, ColumnAlignments->{Left}]}, {\({1, 2}\), GridBox[{ {\(2\/9\), \(2\/9\)}, {\(20\/81\), \(38\/81\)}, {\(128\/729\), \(470\/729\)} }, RowSpacings->1, ColumnSpacings->0.25, RowAlignments->Baseline, ColumnAlignments->{Left}], GridBox[{ {\(2\/9\)}, {\(26\/81\)}, {\(242\/729\)} }, RowSpacings->1, ColumnSpacings->0.25, RowAlignments->Baseline, ColumnAlignments->{Left}]} }, RowSpacings->1, ColumnSpacings->3, RowAlignments->Baseline, ColumnAlignments->{Center}], TableForm[ {{{{ Rational[ 1, 9], Rational[ 16, 81], Rational[ 136, 729]}, { Rational[ 1, 9], Rational[ 25, 81], Rational[ 361, 729]}}, {{ Rational[ 1, 9], Rational[ 19, 81], Rational[ 211, 729]}}}, {{{ Rational[ 2, 9], Rational[ 20, 81], Rational[ 128, 729]}, { Rational[ 2, 9], Rational[ 38, 81], Rational[ 470, 729]}}, {{ Rational[ 2, 9], Rational[ 26, 81], Rational[ 242, 729]}}}}, TableDepth -> 4, TableDirections -> {Column, Row, Row, Column}, TableHeadings -> {{{1, 1}, {1, 2}}, { "First player", "Next player"}}]]], "Output"] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[ \(TableForm[\[IndentingNewLine]\(With[{goal = #}, \ \[IndentingNewLine]\(With[{player = #}, \ \[IndentingNewLine]With[{probabilityList = \(probability[player, f, #, goal, #, goal] &\) /@ Range@j}, Switch[player, \[IndentingNewLine]"\", \({#, \(Plus @@ \ # &\) /@ \((Rest@\(history@#\))\)} &\)@ probabilityList\ , \[IndentingNewLine]"\", \({#} \ &\)@probabilityList]\[IndentingNewLine]]\[IndentingNewLine]] &\) /@ \ {"\", "\"}] &\) /@ allLagrangeRepresentatives[d, f], \[IndentingNewLine]TableDepth \[Rule] 4, \[IndentingNewLine]TableDirections \[Rule] {Column, Row, Row, Column}, TableHeadings \[Rule] {allLagrangeRepresentatives[d, f], {"\", "\"}}]\)], "Input"], Cell[BoxData[ InterpretationBox[GridBox[{ {"\<\"\"\>", "\<\"First player\"\>", "\<\"Next player\"\>"}, {\({1, 1}\), GridBox[{ {\(1\/9\), \(1\/9\)}, {\(16\/81\), \(25\/81\)}, {\(136\/729\), \(361\/729\)} }, RowSpacings->1, ColumnSpacings->0.25, RowAlignments->Baseline, ColumnAlignments->{Left}], GridBox[{ {\(1\/9\)}, {\(19\/81\)}, {\(211\/729\)} }, RowSpacings->1, ColumnSpacings->0.25, RowAlignments->Baseline, ColumnAlignments->{Left}]}, {\({1, 2}\), GridBox[{ {\(2\/9\), \(2\/9\)}, {\(20\/81\), \(38\/81\)}, {\(128\/729\), \(470\/729\)} }, RowSpacings->1, ColumnSpacings->0.25, RowAlignments->Baseline, ColumnAlignments->{Left}], GridBox[{ {\(2\/9\)}, {\(26\/81\)}, {\(242\/729\)} }, RowSpacings->1, ColumnSpacings->0.25, RowAlignments->Baseline, ColumnAlignments->{Left}]} }, RowSpacings->1, ColumnSpacings->3, RowAlignments->Baseline, ColumnAlignments->{Center}], TableForm[ {{{{ Rational[ 1, 9], Rational[ 16, 81], Rational[ 136, 729]}, { Rational[ 1, 9], Rational[ 25, 81], Rational[ 361, 729]}}, {{ Rational[ 1, 9], Rational[ 19, 81], Rational[ 211, 729]}}}, {{{ Rational[ 2, 9], Rational[ 20, 81], Rational[ 128, 729]}, { Rational[ 2, 9], Rational[ 38, 81], Rational[ 470, 729]}}, {{ Rational[ 2, 9], Rational[ 26, 81], Rational[ 242, 729]}}}}, TableDepth -> 4, TableDirections -> {Column, Row, Row, Column}, TableHeadings -> {{{1, 1}, {1, 2}}, { "First player", "Next player"}}]]], "Output"] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[ \(\(With[{d1 = First@#, j1 = Last@#}, \ \[IndentingNewLine]TableForm[\[IndentingNewLine]\(With[{goal = #}, \ \[IndentingNewLine]\(With[{player = #}, \ \[IndentingNewLine]With[{probabilityList = \(probability[player, f, #, goal, #, goal] &\) /@ Range@j1}, \[IndentingNewLine]Switch[ player, \[IndentingNewLine]"\", \({#, \ \(Plus @@ # &\) /@ \((Rest@\(history@#\))\)} &\)@ probabilityList\ , \ \[IndentingNewLine]"\", \({#} &\)@ probabilityList]\[IndentingNewLine]]\ \[IndentingNewLine]] &\) /@ {"\", "\"}\[IndentingNewLine]] &\) /@ allLagrangeRepresentatives[d1, f], \[IndentingNewLine]TableDepth \[Rule] 4, \[IndentingNewLine]TableDirections \[Rule] {Column, Row, Row, Column}, TableHeadings \[Rule] {allLagrangeRepresentatives[d1, f], {"\", "\"}}]\ \[IndentingNewLine]] &\) /@ \((Append[\({#, j - 1} &\) /@ Range[d - 1], {d, j}])\) // scanPrint\)], "Input"], Cell[BoxData[ InterpretationBox[GridBox[{ {"\<\"\"\>", "\<\"First player\"\>", "\<\"Next player\"\>"}, {\({1}\), GridBox[{ {\(1\/3\), \(1\/3\)}, {\(2\/9\), \(5\/9\)} }, RowSpacings->1, ColumnSpacings->0.25, RowAlignments->Baseline, ColumnAlignments->{Left}], GridBox[{ {\(1\/3\)}, {\(1\/3\)} }, RowSpacings->1, ColumnSpacings->0.25, RowAlignments->Baseline, ColumnAlignments->{Left}]} }, RowSpacings->1, ColumnSpacings->3, RowAlignments->Baseline, ColumnAlignments->{Center}], TableForm[ {{{{ Rational[ 1, 3], Rational[ 2, 9]}, { Rational[ 1, 3], Rational[ 5, 9]}}, {{ Rational[ 1, 3], Rational[ 1, 3]}}}}, TableDepth -> 4, TableDirections -> {Column, Row, Row, Column}, TableHeadings -> {{{1}}, {"First player", "Next player"}}]]], "Print"], Cell[BoxData[ InterpretationBox[GridBox[{ {"\<\"\"\>", "\<\"First player\"\>", "\<\"Next player\"\>"}, {\({1, 1}\), GridBox[{ {\(1\/9\), \(1\/9\)}, {\(16\/81\), \(25\/81\)}, {\(136\/729\), \(361\/729\)} }, RowSpacings->1, ColumnSpacings->0.25, RowAlignments->Baseline, ColumnAlignments->{Left}], GridBox[{ {\(1\/9\)}, {\(19\/81\)}, {\(211\/729\)} }, RowSpacings->1, ColumnSpacings->0.25, RowAlignments->Baseline, ColumnAlignments->{Left}]}, {\({1, 2}\), GridBox[{ {\(2\/9\), \(2\/9\)}, {\(20\/81\), \(38\/81\)}, {\(128\/729\), \(470\/729\)} }, RowSpacings->1, ColumnSpacings->0.25, RowAlignments->Baseline, ColumnAlignments->{Left}], GridBox[{ {\(2\/9\)}, {\(26\/81\)}, {\(242\/729\)} }, RowSpacings->1, ColumnSpacings->0.25, RowAlignments->Baseline, ColumnAlignments->{Left}]} }, RowSpacings->1, ColumnSpacings->3, RowAlignments->Baseline, ColumnAlignments->{Center}], TableForm[ {{{{ Rational[ 1, 9], Rational[ 16, 81], Rational[ 136, 729]}, { Rational[ 1, 9], Rational[ 25, 81], Rational[ 361, 729]}}, {{ Rational[ 1, 9], Rational[ 19, 81], Rational[ 211, 729]}}}, {{{ Rational[ 2, 9], Rational[ 20, 81], Rational[ 128, 729]}, { Rational[ 2, 9], Rational[ 38, 81], Rational[ 470, 729]}}, {{ Rational[ 2, 9], Rational[ 26, 81], Rational[ 242, 729]}}}}, TableDepth -> 4, TableDirections -> {Column, Row, Row, Column}, TableHeadings -> {{{1, 1}, {1, 2}}, { "First player", "Next player"}}]]], "Print"] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[ \(\(With[{d1 = First@#, j1 = Last@#}, \ \[IndentingNewLine]TableForm[\[IndentingNewLine]\(With[{goal = #}, \ \[IndentingNewLine]\(With[{player = #}, \ \[IndentingNewLine]With[{probabilityList = \(probability[player, f, #, goal, #, goal] &\) /@ Range@j1}, \[IndentingNewLine]Switch[ player, \[IndentingNewLine]"\", ReplacePart[ Map[numberForm1, \({#, \(Plus @@ # &\) /@ \ \((Rest@\(history@#\))\)} &\)@probabilityList, {2}], "\<\>", {\(-1\), 1}], \[IndentingNewLine]"\", Map[numberForm1, \({#} &\)@ probabilityList, {2}]]\[IndentingNewLine]]\ \[IndentingNewLine]] &\) /@ {"\", "\"}] &\) /@ allLagrangeRepresentatives[d1, f], \[IndentingNewLine]TableDepth \[Rule] 4, \[IndentingNewLine]TableDirections \[Rule] {Column, Row, Row, Column}, TableHeadings \[Rule] {allLagrangeRepresentatives[d1, f], {"\", "\"}}]\ \[IndentingNewLine]] &\) /@ \((Append[\({#, j - 1} &\) /@ Range[d - 1], {d, j}])\) // scanPrint\)], "Input"], Cell[BoxData[ InterpretationBox[GridBox[{ {"\<\"\"\>", "\<\"First player\"\>", "\<\"Next player\"\>"}, {\({1}\), GridBox[{ {\(wrapper[1\/3]\), "\<\"\"\>"}, {\(wrapper[2\/9]\), \(wrapper[5\/9]\)} }, RowSpacings->1, ColumnSpacings->0.25, RowAlignments->Baseline, ColumnAlignments->{Left}], GridBox[{ {\(wrapper[1\/3]\)}, {\(wrapper[1\/3]\)} }, RowSpacings->1, ColumnSpacings->0.25, RowAlignments->Baseline, ColumnAlignments->{Left}]} }, RowSpacings->1, ColumnSpacings->3, RowAlignments->Baseline, ColumnAlignments->{Center}], TableForm[ {{{{ wrapper[ Rational[ 1, 3]], wrapper[ Rational[ 2, 9]]}, {"", wrapper[ Rational[ 5, 9]]}}, {{ wrapper[ Rational[ 1, 3]], wrapper[ Rational[ 1, 3]]}}}}, TableDepth -> 4, TableDirections -> {Column, Row, Row, Column}, TableHeadings -> {{{1}}, {"First player", "Next player"}}]]], "Print"], Cell[BoxData[ InterpretationBox[GridBox[{ {"\<\"\"\>", "\<\"First player\"\>", "\<\"Next player\"\>"}, {\({1, 1}\), GridBox[{ {\(wrapper[1\/9]\), "\<\"\"\>"}, {\(wrapper[16\/81]\), \(wrapper[25\/81]\)}, {\(wrapper[136\/729]\), \(wrapper[361\/729]\)} }, RowSpacings->1, ColumnSpacings->0.25, RowAlignments->Baseline, ColumnAlignments->{Left}], GridBox[{ {\(wrapper[1\/9]\)}, {\(wrapper[19\/81]\)}, {\(wrapper[211\/729]\)} }, RowSpacings->1, ColumnSpacings->0.25, RowAlignments->Baseline, ColumnAlignments->{Left}]}, {\({1, 2}\), GridBox[{ {\(wrapper[2\/9]\), "\<\"\"\>"}, {\(wrapper[20\/81]\), \(wrapper[38\/81]\)}, {\(wrapper[128\/729]\), \(wrapper[470\/729]\)} }, RowSpacings->1, ColumnSpacings->0.25, RowAlignments->Baseline, ColumnAlignments->{Left}], GridBox[{ {\(wrapper[2\/9]\)}, {\(wrapper[26\/81]\)}, {\(wrapper[242\/729]\)} }, RowSpacings->1, ColumnSpacings->0.25, RowAlignments->Baseline, ColumnAlignments->{Left}]} }, RowSpacings->1, ColumnSpacings->3, RowAlignments->Baseline, ColumnAlignments->{Center}], TableForm[ {{{{ wrapper[ Rational[ 1, 9]], wrapper[ Rational[ 16, 81]], wrapper[ Rational[ 136, 729]]}, {"", wrapper[ Rational[ 25, 81]], wrapper[ Rational[ 361, 729]]}}, {{ wrapper[ Rational[ 1, 9]], wrapper[ Rational[ 19, 81]], wrapper[ Rational[ 211, 729]]}}}, {{{ wrapper[ Rational[ 2, 9]], wrapper[ Rational[ 20, 81]], wrapper[ Rational[ 128, 729]]}, {"", wrapper[ Rational[ 38, 81]], wrapper[ Rational[ 470, 729]]}}, {{ wrapper[ Rational[ 2, 9]], wrapper[ Rational[ 26, 81]], wrapper[ Rational[ 242, 729]]}}}}, TableDepth -> 4, TableDirections -> { Column, Row, Row, Column}, TableHeadings -> {{{1, 1}, {1, 2}}, { "First player", "Next player"}}]]], "Print"] }, Open ]], Cell["Meilleure pr\[EAcute]sentation, m\[EHat]me dans le cas normal.", "Text"], Cell[CellGroupData[{ Cell[BoxData[ \(TableForm[ Flatten[\[IndentingNewLine]\(With[{d1 = First@#, j1 = Last@#}, \[IndentingNewLine]\(With[{goal = #}, \ \[IndentingNewLine]\(With[{player = #}, \ \[IndentingNewLine]With[{probabilityList = \(probability[player, f, #, goal, #, goal] &\) /@ Range@j1}, \[IndentingNewLine]Switch[ player, \[IndentingNewLine]"\", ReplacePart[ Map[numberForm1, \({#, \(Plus @@ # &\) /@ \ \((Rest@\(history@#\))\)} &\)@probabilityList, {2}], "\<\>", {\(-1\), 1}], \[IndentingNewLine]"\", Map[numberForm1, \({#} &\)@ probabilityList, {2}]]\[IndentingNewLine]]\ \[IndentingNewLine]] &\) /@ {"\", "\"}\[IndentingNewLine]] &\) /@ allLagrangeRepresentatives[d1, f]\[IndentingNewLine]] &\) /@ \((Append[\({#, j - 1} &\) /@ Range[d - 1], {d, j}])\), 1], \[IndentingNewLine]TableDirections \[Rule] {Column, Row, Row, Column}, \[IndentingNewLine]TableHeadings \[Rule] {Composition[ DisplayForm, RowBox, Reverse] /@ Flatten[\(With[{d1 = First@#, j1 = Last@#}, allLagrangeRepresentatives[d1, f]\[IndentingNewLine]] &\) /@ \((Append[\({#, j - 1} &\) /@ Range[d - 1], {d, j}])\), 1], {"\", "\"}}\[IndentingNewLine]]\)], "Input"], Cell[BoxData[ InterpretationBox[GridBox[{ {"\<\"\"\>", "\<\"First player\"\>", "\<\"Next player\"\>"}, { TagBox["1", DisplayForm], GridBox[{ {\(wrapper[1\/3]\), "\<\"\"\>"}, {\(wrapper[2\/9]\), \(wrapper[5\/9]\)} }, RowSpacings->1, ColumnSpacings->0.25, RowAlignments->Baseline, ColumnAlignments->{Left}], GridBox[{ {\(wrapper[1\/3]\)}, {\(wrapper[1\/3]\)} }, RowSpacings->1, ColumnSpacings->0.25, RowAlignments->Baseline, ColumnAlignments->{Left}]}, { TagBox[\(1 1\), DisplayForm], GridBox[{ {\(wrapper[1\/9]\), "\<\"\"\>"}, {\(wrapper[16\/81]\), \(wrapper[25\/81]\)}, {\(wrapper[136\/729]\), \(wrapper[361\/729]\)} }, RowSpacings->1, ColumnSpacings->0.25, RowAlignments->Baseline, ColumnAlignments->{Left}], GridBox[{ {\(wrapper[1\/9]\)}, {\(wrapper[19\/81]\)}, {\(wrapper[211\/729]\)} }, RowSpacings->1, ColumnSpacings->0.25, RowAlignments->Baseline, ColumnAlignments->{Left}]}, { TagBox[\(2 1\), DisplayForm], GridBox[{ {\(wrapper[2\/9]\), "\<\"\"\>"}, {\(wrapper[20\/81]\), \(wrapper[38\/81]\)}, {\(wrapper[128\/729]\), \(wrapper[470\/729]\)} }, RowSpacings->1, ColumnSpacings->0.25, RowAlignments->Baseline, ColumnAlignments->{Left}], GridBox[{ {\(wrapper[2\/9]\)}, {\(wrapper[26\/81]\)}, {\(wrapper[242\/729]\)} }, RowSpacings->1, ColumnSpacings->0.25, RowAlignments->Baseline, ColumnAlignments->{Left}]} }, RowSpacings->1, ColumnSpacings->3, RowAlignments->Baseline, ColumnAlignments->{Center}], TableForm[ {{{{ wrapper[ Rational[ 1, 3]], wrapper[ Rational[ 2, 9]]}, {"", wrapper[ Rational[ 5, 9]]}}, {{ wrapper[ Rational[ 1, 3]], wrapper[ Rational[ 1, 3]]}}}, {{{ wrapper[ Rational[ 1, 9]], wrapper[ Rational[ 16, 81]], wrapper[ Rational[ 136, 729]]}, {"", wrapper[ Rational[ 25, 81]], wrapper[ Rational[ 361, 729]]}}, {{ wrapper[ Rational[ 1, 9]], wrapper[ Rational[ 19, 81]], wrapper[ Rational[ 211, 729]]}}}, {{{ wrapper[ Rational[ 2, 9]], wrapper[ Rational[ 20, 81]], wrapper[ Rational[ 128, 729]]}, {"", wrapper[ Rational[ 38, 81]], wrapper[ Rational[ 470, 729]]}}, {{ wrapper[ Rational[ 2, 9]], wrapper[ Rational[ 26, 81]], wrapper[ Rational[ 242, 729]]}}}}, TableDirections -> {Column, Row, Row, Column}, TableHeadings -> {{ DisplayForm[ RowBox[ {1}]], DisplayForm[ RowBox[ {1, 1}]], DisplayForm[ RowBox[ {2, 1}]]}, {"First player", "Next player"}}]]], "Output"] }, Open ]], Cell[BoxData[ \(\({d =. , f =. , j =. };\)\)], "Input"], Cell[BoxData[{ \(\(Clear@successProbabilityChart;\)\), "\[IndentingNewLine]", \(\(Options@ successProbabilityChart = {numberForm1 \[Rule] Identity};\)\), "\[IndentingNewLine]", \(successProbabilityChart[d_Integer, f_Integer, j_Integer, probability, options1___] := \[IndentingNewLine]\((Print@"\"; Print@TableForm[ Flatten[\(With[{d1 = First@#, j1 = Last@#}, \[IndentingNewLine]\(With[{goal = #}, \ \[IndentingNewLine]\(With[{player = #}, \ \[IndentingNewLine]\(With[{probabilityList = \(probability[player, f, #, goal, #, goal] &\) /@ Range@j1}, \[IndentingNewLine]Switch[ player, \[IndentingNewLine]"\", ReplacePart[ Map[numberForm1, \({#, \(Plus @@ # \ &\) /@ \((Rest@\(history@#\))\)} &\)@probabilityList, {2}], "\<\>", {\(-1\), 1}], \[IndentingNewLine]"\", Map[numberForm1, \({#} &\)@ probabilityList, {2}]]\ \[IndentingNewLine]] /. {options1}\) /. Options@ successProbabilityChart\[IndentingNewLine]\ ] &\) /@ {"\", "\"}\[IndentingNewLine]] &\) /@ allLagrangeRepresentatives[d1, f]\[IndentingNewLine]] &\) /@ \((Append[\({#, j - 1} &\) /@ Range[d - 1], {d, j}])\), 1], \[IndentingNewLine]TableDirections \[Rule] {Column, Row, Row, Column}, \[IndentingNewLine]TableHeadings \[Rule] \ {Composition[DisplayForm, FrameBox, RowBox, Reverse] /@ Flatten[\(With[{d1 = First@#, j1 = Last@#}, allLagrangeRepresentatives[d1, f]\[IndentingNewLine]] &\) /@ \((Append[\({#, j - 1} &\) /@ Range[d - 1], {d, j}])\), 1], {"\", "\"}}\ \[IndentingNewLine]])\)\)}], "Input", InitializationCell->True], Cell[CellGroupData[{ Cell[BoxData[ \(successProbabilityChart[2, 3, 3, probability]\)], "Input"], Cell[BoxData[ \("Success probabilities"\)], "Print"], Cell[BoxData[ InterpretationBox[GridBox[{ {"\<\"\"\>", "\<\"First player\"\>", "\<\"Next player\"\>"}, { TagBox[ FrameBox["1"], DisplayForm], GridBox[{ {\(1\/3\), "\<\"\"\>"}, {\(2\/9\), \(5\/9\)} }, RowSpacings->1, ColumnSpacings->0.25, RowAlignments->Baseline, ColumnAlignments->{Left}], GridBox[{ {\(1\/3\)}, {\(1\/3\)} }, RowSpacings->1, ColumnSpacings->0.25, RowAlignments->Baseline, ColumnAlignments->{Left}]}, { TagBox[ FrameBox[\(1 1\)], DisplayForm], GridBox[{ {\(1\/9\), "\<\"\"\>"}, {\(16\/81\), \(25\/81\)}, {\(136\/729\), \(361\/729\)} }, RowSpacings->1, ColumnSpacings->0.25, RowAlignments->Baseline, ColumnAlignments->{Left}], GridBox[{ {\(1\/9\)}, {\(19\/81\)}, {\(211\/729\)} }, RowSpacings->1, ColumnSpacings->0.25, RowAlignments->Baseline, ColumnAlignments->{Left}]}, { TagBox[ FrameBox[\(2 1\)], DisplayForm], GridBox[{ {\(2\/9\), "\<\"\"\>"}, {\(20\/81\), \(38\/81\)}, {\(128\/729\), \(470\/729\)} }, RowSpacings->1, ColumnSpacings->0.25, RowAlignments->Baseline, ColumnAlignments->{Left}], GridBox[{ {\(2\/9\)}, {\(26\/81\)}, {\(242\/729\)} }, RowSpacings->1, ColumnSpacings->0.25, RowAlignments->Baseline, ColumnAlignments->{Left}]} }, RowSpacings->1, ColumnSpacings->3, RowAlignments->Baseline, ColumnAlignments->{Center}], TableForm[ {{{{ Rational[ 1, 3], Rational[ 2, 9]}, {"", Rational[ 5, 9]}}, {{ Rational[ 1, 3], Rational[ 1, 3]}}}, {{{ Rational[ 1, 9], Rational[ 16, 81], Rational[ 136, 729]}, {"", Rational[ 25, 81], Rational[ 361, 729]}}, {{ Rational[ 1, 9], Rational[ 19, 81], Rational[ 211, 729]}}}, {{{ Rational[ 2, 9], Rational[ 20, 81], Rational[ 128, 729]}, {"", Rational[ 38, 81], Rational[ 470, 729]}}, {{ Rational[ 2, 9], Rational[ 26, 81], Rational[ 242, 729]}}}}, TableDirections -> {Column, Row, Row, Column}, TableHeadings -> {{ DisplayForm[ FrameBox[ RowBox[ {1}]]], DisplayForm[ FrameBox[ RowBox[ {1, 1}]]], DisplayForm[ FrameBox[ RowBox[ {2, 1}]]]}, {"First player", "Next player"}}]]], "Print"] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[ \(successProbabilityChart[3, 6, 3, probability, numberForm1 \[Rule] approximationBox]\)], "Input"], Cell[BoxData[ \("Success probabilities"\)], "Print"], Cell[BoxData[ InterpretationBox[GridBox[{ {"\<\"\"\>", "\<\"First player\"\>", "\<\"Next player\"\>"}, { TagBox[ FrameBox["1"], DisplayForm], GridBox[{ { TagBox[ RowBox[{\(1\/6\), "\[TildeEqual]", TagBox[ InterpretationBox["\<\" 0.167\"\>", 0.16666666666666666, AutoDelete->True], (PaddedForm[ #, {4, 3}]&)]}], DisplayForm], "\<\"\"\>"}, { TagBox[ RowBox[{\(5\/36\), "\[TildeEqual]", TagBox[ InterpretationBox["\<\" 0.139\"\>", 0.1388888888888889, AutoDelete->True], (PaddedForm[ #, {4, 3}]&)]}], DisplayForm], TagBox[ RowBox[{\(11\/36\), "\[TildeEqual]", TagBox[ InterpretationBox["\<\" 0.306\"\>", 0.30555555555555558, AutoDelete->True], (PaddedForm[ #, {4, 3}]&)]}], DisplayForm]} }, RowSpacings->1, ColumnSpacings->0.25, RowAlignments->Baseline, ColumnAlignments->{Left}], GridBox[{ { TagBox[ RowBox[{\(1\/6\), "\[TildeEqual]", TagBox[ InterpretationBox["\<\" 0.167\"\>", 0.16666666666666666, AutoDelete->True], (PaddedForm[ #, {4, 3}]&)]}], DisplayForm]}, { TagBox[ RowBox[{\(1\/6\), "\[TildeEqual]", TagBox[ InterpretationBox["\<\" 0.167\"\>", 0.16666666666666666, AutoDelete->True], (PaddedForm[ #, {4, 3}]&)]}], DisplayForm]} }, RowSpacings->1, ColumnSpacings->0.25, RowAlignments->Baseline, ColumnAlignments->{Left}]}, { TagBox[ FrameBox[\(1 1\)], DisplayForm], GridBox[{ { TagBox[ RowBox[{\(1\/36\), "\[TildeEqual]", TagBox[ InterpretationBox["\<\" 0.028\"\>", 0.027777777777777776, AutoDelete->True], (PaddedForm[ #, {4, 3}]&)]}], DisplayForm], "\<\"\"\>"}, { TagBox[ RowBox[{\(85\/1296\), "\[TildeEqual]", TagBox[ InterpretationBox["\<\" 0.066\"\>", 0.06558641975308642, AutoDelete->True], (PaddedForm[ #, {4, 3}]&)]}], DisplayForm], TagBox[ RowBox[{\(121\/1296\), "\[TildeEqual]", TagBox[ InterpretationBox["\<\" 0.093\"\>", 0.093364197530864196, AutoDelete->True], (PaddedForm[ #, {4, 3}]&)]}], DisplayForm]} }, RowSpacings->1, ColumnSpacings->0.25, RowAlignments->Baseline, ColumnAlignments->{Left}], GridBox[{ { TagBox[ RowBox[{\(1\/36\), "\[TildeEqual]", TagBox[ InterpretationBox["\<\" 0.028\"\>", 0.027777777777777776, AutoDelete->True], (PaddedForm[ #, {4, 3}]&)]}], DisplayForm]}, { TagBox[ RowBox[{\(91\/1296\), "\[TildeEqual]", TagBox[ InterpretationBox["\<\" 0.070\"\>", 0.070216049382716056, AutoDelete->True], (PaddedForm[ #, {4, 3}]&)]}], DisplayForm]} }, RowSpacings->1, ColumnSpacings->0.25, RowAlignments->Baseline, ColumnAlignments->{Left}]}, { TagBox[ FrameBox[\(2 1\)], DisplayForm], GridBox[{ { TagBox[ RowBox[{\(1\/18\), "\[TildeEqual]", TagBox[ InterpretationBox["\<\" 0.056\"\>", 0.055555555555555552, AutoDelete->True], (PaddedForm[ #, {4, 3}]&)]}], DisplayForm], "\<\"\"\>"}, { TagBox[ RowBox[{\(35\/324\), "\[TildeEqual]", TagBox[ InterpretationBox["\<\" 0.108\"\>", 0.10802469135802469, AutoDelete->True], (PaddedForm[ #, {4, 3}]&)]}], DisplayForm], TagBox[ RowBox[{\(53\/324\), "\[TildeEqual]", TagBox[ InterpretationBox["\<\" 0.164\"\>", 0.16358024691358025, AutoDelete->True], (PaddedForm[ #, {4, 3}]&)]}], DisplayForm]} }, RowSpacings->1, ColumnSpacings->0.25, RowAlignments->Baseline, ColumnAlignments->{Left}], GridBox[{ { TagBox[ RowBox[{\(1\/18\), "\[TildeEqual]", TagBox[ InterpretationBox["\<\" 0.056\"\>", 0.055555555555555552, AutoDelete->True], (PaddedForm[ #, {4, 3}]&)]}], DisplayForm]}, { TagBox[ RowBox[{\(19\/162\), "\[TildeEqual]", TagBox[ InterpretationBox["\<\" 0.117\"\>", 0.11728395061728394, AutoDelete->True], (PaddedForm[ #, {4, 3}]&)]}], DisplayForm]} }, RowSpacings->1, ColumnSpacings->0.25, RowAlignments->Baseline, ColumnAlignments->{Left}]}, { TagBox[ FrameBox[\(1 1 1\)], DisplayForm], GridBox[{ { TagBox[ RowBox[{\(1\/216\), "\[TildeEqual]", TagBox[ InterpretationBox["\<\" 0.005\"\>", 0.0046296296296296294, AutoDelete->True], (PaddedForm[ #, {4, 3}]&)]}], DisplayForm], "\<\"\"\>"}, { TagBox[ RowBox[{\(1115\/46656\), "\[TildeEqual]", TagBox[ InterpretationBox["\<\" 0.024\"\>", 0.023898319615912208, AutoDelete->True], (PaddedForm[ #, {4, 3}]&)]}], DisplayForm], TagBox[ RowBox[{\(1331\/46656\), "\[TildeEqual]", TagBox[ InterpretationBox["\<\" 0.029\"\>", 0.028527949245541837, AutoDelete->True], (PaddedForm[ #, {4, 3}]&)]}], DisplayForm]}, { TagBox[ RowBox[{\(466075\/10077696\), "\[TildeEqual]", TagBox[ InterpretationBox["\<\" 0.046\"\>", 0.046248170216684446, AutoDelete->True], (PaddedForm[ #, {4, 3}]&)]}], DisplayForm], TagBox[ RowBox[{\(753571\/10077696\), "\[TildeEqual]", TagBox[ InterpretationBox["\<\" 0.075\"\>", 0.074776119462226287, AutoDelete->True], (PaddedForm[ #, {4, 3}]&)]}], DisplayForm]} }, RowSpacings->1, ColumnSpacings->0.25, RowAlignments->Baseline, ColumnAlignments->{Left}], GridBox[{ { TagBox[ RowBox[{\(1\/216\), "\[TildeEqual]", TagBox[ InterpretationBox["\<\" 0.005\"\>", 0.0046296296296296294, AutoDelete->True], (PaddedForm[ #, {4, 3}]&)]}], DisplayForm]}, { TagBox[ RowBox[{\(1151\/46656\), "\[TildeEqual]", TagBox[ InterpretationBox["\<\" 0.025\"\>", 0.024669924554183813, AutoDelete->True], (PaddedForm[ #, {4, 3}]&)]}], DisplayForm]}, { TagBox[ RowBox[{\(513991\/10077696\), "\[TildeEqual]", TagBox[ InterpretationBox["\<\" 0.051\"\>", 0.051002828424274754, AutoDelete->True], (PaddedForm[ #, {4, 3}]&)]}], DisplayForm]} }, RowSpacings->1, ColumnSpacings->0.25, RowAlignments->Baseline, ColumnAlignments->{Left}]}, { TagBox[ FrameBox[\(2 1 1\)], DisplayForm], GridBox[{ { TagBox[ RowBox[{\(1\/72\), "\[TildeEqual]", TagBox[ InterpretationBox["\<\" 0.014\"\>", 0.013888888888888888, AutoDelete->True], (PaddedForm[ #, {4, 3}]&)]}], DisplayForm], "\<\"\"\>"}, { TagBox[ RowBox[{\(143\/2592\), "\[TildeEqual]", TagBox[ InterpretationBox["\<\" 0.055\"\>", 0.055169753086419755, AutoDelete->True], (PaddedForm[ #, {4, 3}]&)]}], DisplayForm], TagBox[ RowBox[{\(179\/2592\), "\[TildeEqual]", TagBox[ InterpretationBox["\<\" 0.069\"\>", 0.069058641975308643, AutoDelete->True], (PaddedForm[ #, {4, 3}]&)]}], DisplayForm]}, { TagBox[ RowBox[{\(23681\/279936\), "\[TildeEqual]", TagBox[ InterpretationBox["\<\" 0.085\"\>", 0.084594335848193869, AutoDelete->True], (PaddedForm[ #, {4, 3}]&)]}], DisplayForm], TagBox[ RowBox[{\(43013\/279936\), "\[TildeEqual]", TagBox[ InterpretationBox["\<\" 0.154\"\>", 0.15365297782350251, AutoDelete->True], (PaddedForm[ #, {4, 3}]&)]}], DisplayForm]} }, RowSpacings->1, ColumnSpacings->0.25, RowAlignments->Baseline, ColumnAlignments->{Left}], GridBox[{ { TagBox[ RowBox[{\(1\/72\), "\[TildeEqual]", TagBox[ InterpretationBox["\<\" 0.014\"\>", 0.013888888888888888, AutoDelete->True], (PaddedForm[ #, {4, 3}]&)]}], DisplayForm]}, { TagBox[ RowBox[{\(149\/2592\), "\[TildeEqual]", TagBox[ InterpretationBox["\<\" 0.057\"\>", 0.057484567901234566, AutoDelete->True], (PaddedForm[ #, {4, 3}]&)]}], DisplayForm]}, { TagBox[ RowBox[{\(26903\/279936\), "\[TildeEqual]", TagBox[ InterpretationBox["\<\" 0.096\"\>", 0.096104109510745314, AutoDelete->True], (PaddedForm[ #, {4, 3}]&)]}], DisplayForm]} }, RowSpacings->1, ColumnSpacings->0.25, RowAlignments->Baseline, ColumnAlignments->{Left}]}, { TagBox[ FrameBox[\(3 2 1\)], DisplayForm], GridBox[{ { TagBox[ RowBox[{\(1\/36\), "\[TildeEqual]", TagBox[ InterpretationBox["\<\" 0.028\"\>", 0.027777777777777776, AutoDelete->True], (PaddedForm[ #, {4, 3}]&)]}], DisplayForm], "\<\"\"\>"}, { TagBox[ RowBox[{\(227\/2592\), "\[TildeEqual]", TagBox[ InterpretationBox["\<\" 0.088\"\>", 0.087577160493827161, AutoDelete->True], (PaddedForm[ #, {4, 3}]&)]}], DisplayForm], TagBox[ RowBox[{\(299\/2592\), "\[TildeEqual]", TagBox[ InterpretationBox["\<\" 0.115\"\>", 0.11535493827160494, AutoDelete->True], (PaddedForm[ #, {4, 3}]&)]}], DisplayForm]}, { TagBox[ RowBox[{\(21043\/186624\), "\[TildeEqual]", TagBox[ InterpretationBox["\<\" 0.113\"\>", 0.11275612997256516, AutoDelete->True], (PaddedForm[ #, {4, 3}]&)]}], DisplayForm], TagBox[ RowBox[{\(42571\/186624\), "\[TildeEqual]", TagBox[ InterpretationBox["\<\" 0.228\"\>", 0.2281110682441701, AutoDelete->True], (PaddedForm[ #, {4, 3}]&)]}], DisplayForm]} }, RowSpacings->1, ColumnSpacings->0.25, RowAlignments->Baseline, ColumnAlignments->{Left}], GridBox[{ { TagBox[ RowBox[{\(1\/36\), "\[TildeEqual]", TagBox[ InterpretationBox["\<\" 0.028\"\>", 0.027777777777777776, AutoDelete->True], (PaddedForm[ #, {4, 3}]&)]}], DisplayForm]}, { TagBox[ RowBox[{\(239\/2592\), "\[TildeEqual]", TagBox[ InterpretationBox["\<\" 0.092\"\>", 0.092206790123456783, AutoDelete->True], (PaddedForm[ #, {4, 3}]&)]}], DisplayForm]}, { TagBox[ RowBox[{\(24631\/186624\), "\[TildeEqual]", TagBox[ InterpretationBox["\<\" 0.132\"\>", 0.13198195301783264, AutoDelete->True], (PaddedForm[ #, {4, 3}]&)]}], DisplayForm]} }, RowSpacings->1, ColumnSpacings->0.25, RowAlignments->Baseline, ColumnAlignments->{Left}]} }, RowSpacings->1, ColumnSpacings->3, RowAlignments->Baseline, ColumnAlignments->{Center}], TableForm[ {{{{ DisplayForm[ RowBox[ { Rational[ 1, 6], "\[TildeEqual]", PaddedForm[ 0.16666666666666666, {4, 3}]}]], DisplayForm[ RowBox[ { Rational[ 5, 36], "\[TildeEqual]", PaddedForm[ 0.1388888888888889, {4, 3}]}]]}, {"", DisplayForm[ RowBox[ { Rational[ 11, 36], "\[TildeEqual]", PaddedForm[ 0.30555555555555558, {4, 3}]}]]}}, {{ DisplayForm[ RowBox[ { Rational[ 1, 6], "\[TildeEqual]", PaddedForm[ 0.16666666666666666, {4, 3}]}]], DisplayForm[ RowBox[ { Rational[ 1, 6], "\[TildeEqual]", PaddedForm[ 0.16666666666666666, {4, 3}]}]]}}}, {{{ DisplayForm[ RowBox[ { Rational[ 1, 36], "\[TildeEqual]", PaddedForm[ 0.027777777777777776, {4, 3}]}]], DisplayForm[ RowBox[ { Rational[ 85, 1296], "\[TildeEqual]", PaddedForm[ 0.06558641975308642, {4, 3}]}]]}, {"", DisplayForm[ RowBox[ { Rational[ 121, 1296], "\[TildeEqual]", PaddedForm[ 0.093364197530864196, {4, 3}]}]]}}, {{ DisplayForm[ RowBox[ { Rational[ 1, 36], "\[TildeEqual]", PaddedForm[ 0.027777777777777776, {4, 3}]}]], DisplayForm[ RowBox[ { Rational[ 91, 1296], "\[TildeEqual]", PaddedForm[ 0.070216049382716056, {4, 3}]}]]}}}, {{{ DisplayForm[ RowBox[ { Rational[ 1, 18], "\[TildeEqual]", PaddedForm[ 0.055555555555555552, {4, 3}]}]], DisplayForm[ RowBox[ { Rational[ 35, 324], "\[TildeEqual]", PaddedForm[ 0.10802469135802469, {4, 3}]}]]}, {"", DisplayForm[ RowBox[ { Rational[ 53, 324], "\[TildeEqual]", PaddedForm[ 0.16358024691358025, {4, 3}]}]]}}, {{ DisplayForm[ RowBox[ { Rational[ 1, 18], "\[TildeEqual]", PaddedForm[ 0.055555555555555552, {4, 3}]}]], DisplayForm[ RowBox[ { Rational[ 19, 162], "\[TildeEqual]", PaddedForm[ 0.11728395061728394, {4, 3}]}]]}}}, {{{ DisplayForm[ RowBox[ { Rational[ 1, 216], "\[TildeEqual]", PaddedForm[ 0.0046296296296296294, {4, 3}]}]], DisplayForm[ RowBox[ { Rational[ 1115, 46656], "\[TildeEqual]", PaddedForm[ 0.023898319615912208, {4, 3}]}]], DisplayForm[ RowBox[ { Rational[ 466075, 10077696], "\[TildeEqual]", PaddedForm[ 0.046248170216684446, {4, 3}]}]]}, {"", DisplayForm[ RowBox[ { Rational[ 1331, 46656], "\[TildeEqual]", PaddedForm[ 0.028527949245541837, {4, 3}]}]], DisplayForm[ RowBox[ { Rational[ 753571, 10077696], "\[TildeEqual]", PaddedForm[ 0.074776119462226287, {4, 3}]}]]}}, {{ DisplayForm[ RowBox[ { Rational[ 1, 216], "\[TildeEqual]", PaddedForm[ 0.0046296296296296294, {4, 3}]}]], DisplayForm[ RowBox[ { Rational[ 1151, 46656], "\[TildeEqual]", PaddedForm[ 0.024669924554183813, {4, 3}]}]], DisplayForm[ RowBox[ { Rational[ 513991, 10077696], "\[TildeEqual]", PaddedForm[ 0.051002828424274754, {4, 3}]}]]}}}, {{{ DisplayForm[ RowBox[ { Rational[ 1, 72], "\[TildeEqual]", PaddedForm[ 0.013888888888888888, {4, 3}]}]], DisplayForm[ RowBox[ { Rational[ 143, 2592], "\[TildeEqual]", PaddedForm[ 0.055169753086419755, {4, 3}]}]], DisplayForm[ RowBox[ { Rational[ 23681, 279936], "\[TildeEqual]", PaddedForm[ 0.084594335848193869, {4, 3}]}]]}, {"", DisplayForm[ RowBox[ { Rational[ 179, 2592], "\[TildeEqual]", PaddedForm[ 0.069058641975308643, {4, 3}]}]], DisplayForm[ RowBox[ { Rational[ 43013, 279936], "\[TildeEqual]", PaddedForm[ 0.15365297782350251, {4, 3}]}]]}}, {{ DisplayForm[ RowBox[ { Rational[ 1, 72], "\[TildeEqual]", PaddedForm[ 0.013888888888888888, {4, 3}]}]], DisplayForm[ RowBox[ { Rational[ 149, 2592], "\[TildeEqual]", PaddedForm[ 0.057484567901234566, {4, 3}]}]], DisplayForm[ RowBox[ { Rational[ 26903, 279936], "\[TildeEqual]", PaddedForm[ 0.096104109510745314, {4, 3}]}]]}}}, {{{ DisplayForm[ RowBox[ { Rational[ 1, 36], "\[TildeEqual]", PaddedForm[ 0.027777777777777776, {4, 3}]}]], DisplayForm[ RowBox[ { Rational[ 227, 2592], "\[TildeEqual]", PaddedForm[ 0.087577160493827161, {4, 3}]}]], DisplayForm[ RowBox[ { Rational[ 21043, 186624], "\[TildeEqual]", PaddedForm[ 0.11275612997256516, {4, 3}]}]]}, {"", DisplayForm[ RowBox[ { Rational[ 299, 2592], "\[TildeEqual]", PaddedForm[ 0.11535493827160494, {4, 3}]}]], DisplayForm[ RowBox[ { Rational[ 42571, 186624], "\[TildeEqual]", PaddedForm[ 0.2281110682441701, {4, 3}]}]]}}, {{ DisplayForm[ RowBox[ { Rational[ 1, 36], "\[TildeEqual]", PaddedForm[ 0.027777777777777776, {4, 3}]}]], DisplayForm[ RowBox[ { Rational[ 239, 2592], "\[TildeEqual]", PaddedForm[ 0.092206790123456783, {4, 3}]}]], DisplayForm[ RowBox[ { Rational[ 24631, 186624], "\[TildeEqual]", PaddedForm[ 0.13198195301783264, {4, 3}]}]]}}}}, TableDirections -> {Column, Row, Row, Column}, TableHeadings -> {{ DisplayForm[ FrameBox[ RowBox[ {1}]]], DisplayForm[ FrameBox[ RowBox[ {1, 1}]]], DisplayForm[ FrameBox[ RowBox[ {2, 1}]]], DisplayForm[ FrameBox[ RowBox[ {1, 1, 1}]]], DisplayForm[ FrameBox[ RowBox[ {2, 1, 1}]]], DisplayForm[ FrameBox[ RowBox[ {3, 2, 1}]]]}, {"First player", "Next player"}}]]], "Print"] }, Open ]] }, Open ]], Cell[CellGroupData[{ Cell["Probabilit\[EAcute]s d'\[EAcute]chec", "Subsubsection", CellTags->"c:76"], Cell["\<\ Classement superficiel selon les repr\[EAcute]sentants des \ \[EAcute]l\[EAcute]ments du birepr\[EAcute]sentant (dont le premier est par \ construction son propre repr\[EAcute]sentant).\ \>", "Text"], Cell[CellGroupData[{ Cell[BoxData[ \({d = 2, f = 3}; Sort@Select[allLagrangeBirepresentatives[d, f], First@# \[NotEqual] Last@# &]\)], "Input"], Cell[BoxData[ \({{{1, 1}, {1, 2}}, {{1, 1}, {2, 2}}, {{1, 1}, {2, 3}}, {{1, 2}, {1, 1}}, {{1, 2}, {1, 3}}, {{1, 2}, {3, 3}}}\)], "Output"] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[ \(listQuotient[\[IndentingNewLine]Sort@ Select[allLagrangeBirepresentatives[d, f], First@# \[NotEqual] Last@# &], {First@#, lagrangeRepresentative@\(Last@#\)} &, withValues \[Rule] True]\)], "Input"], Cell[BoxData[ \({{{{1, 1}, {1, 1}}, {{{1, 1}, {2, 2}}}}, {{{1, 1}, {1, 2}}, {{{1, 1}, {1, 2}}, {{1, 1}, {2, 3}}}}, {{{1, 2}, {1, 1}}, {{{1, 2}, {1, 1}}, {{1, 2}, {3, 3}}}}, {{{1, 2}, {1, 2}}, {{{1, 2}, {1, 3}}}}}\)], "Output"] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[ \(\(MapAt[\({#, function1 @@ #} &\) /@ # &, #, \(-1\)] &\) /@ listQuotient[\[IndentingNewLine]Sort@ Select[allLagrangeBirepresentatives[d, f], First@# \[NotEqual] Last@# &], {First@#, lagrangeRepresentative@\(Last@#\)} &, withValues \[Rule] True]\)], "Input"], Cell[BoxData[ \({{{{1, 1}, {1, 1}}, {{{{1, 1}, {2, 2}}, function1[{1, 1}, {2, 2}]}}}, {{{1, 1}, {1, 2}}, {{{{1, 1}, {1, 2}}, function1[{1, 1}, {1, 2}]}, {{{1, 1}, {2, 3}}, function1[{1, 1}, {2, 3}]}}}, {{{1, 2}, {1, 1}}, {{{{1, 2}, {1, 1}}, function1[{1, 2}, {1, 1}]}, {{{1, 2}, {3, 3}}, function1[{1, 2}, {3, 3}]}}}, {{{1, 2}, {1, 2}}, {{{{1, 2}, {1, 3}}, function1[{1, 2}, {1, 3}]}}}}\)], "Output"] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[ \(fill[\(MapAt[\({#, function1 @@ #} &\) /@ # &, #, \(-1\)] &\) /@ listQuotient[\[IndentingNewLine]Sort@ Select[allLagrangeBirepresentatives[d, f], First@# \[NotEqual] Last@# &], {First@#, lagrangeRepresentative@\(Last@#\)} &, withValues \[Rule] True]]\)], "Input"], Cell[BoxData[ \({{{{{{{1, 1}, {2, 2}}, function1[{1, 1}, {2, 2}]}}, {{{{1, 1}, {1, 2}}, function1[{1, 1}, {1, 2}]}, {{{1, 1}, {2, 3}}, function1[{1, 1}, {2, 3}]}}}, {{{{{1, 2}, {1, 1}}, function1[{1, 2}, {1, 1}]}, {{{1, 2}, {3, 3}}, function1[{1, 2}, {3, 3}]}}, {{{{1, 2}, {1, 3}}, function1[{1, 2}, {1, 3}]}}}}, {{1, 1}, {1, 2}}, {{1, 1}, {1, 2}}}\)], "Output"] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[ \(\(\(\[IndentingNewLine]\)\(\(TableForm[First@#, TableDepth \[Rule] 4, TableHeadings \[Rule] Rest@#] &\)@ fill[\(MapAt[\({#, function1 @@ #} &\) /@ # &, #, \(-1\)] &\) /@ listQuotient[\[IndentingNewLine]Sort@ Select[allLagrangeBirepresentatives[d, f], First@# \[NotEqual] Last@# &], {First@#, lagrangeRepresentative@\(Last@#\)} &, withValues \[Rule] True]]\)\)\)], "Input"], Cell[BoxData[ InterpretationBox[GridBox[{ {"\<\"\"\>", \({1, 1}\), \({1, 2}\)}, {\({1, 1}\), GridBox[{ {\({{1, 1}, {2, 2}}\), \(function1[{1, 1}, {2, 2}]\)} }, RowSpacings->0.25, ColumnSpacings->1, RowAlignments->Baseline, ColumnAlignments->{Left}], GridBox[{ {\({{1, 1}, {1, 2}}\), \(function1[{1, 1}, {1, 2}]\)}, {\({{1, 1}, {2, 3}}\), \(function1[{1, 1}, {2, 3}]\)} }, RowSpacings->0.25, ColumnSpacings->1, RowAlignments->Baseline, ColumnAlignments->{Left}]}, {\({1, 2}\), GridBox[{ {\({{1, 2}, {1, 1}}\), \(function1[{1, 2}, {1, 1}]\)}, {\({{1, 2}, {3, 3}}\), \(function1[{1, 2}, {3, 3}]\)} }, RowSpacings->0.25, ColumnSpacings->1, RowAlignments->Baseline, ColumnAlignments->{Left}], GridBox[{ {\({{1, 2}, {1, 3}}\), \(function1[{1, 2}, {1, 3}]\)} }, RowSpacings->0.25, ColumnSpacings->1, RowAlignments->Baseline, ColumnAlignments->{Left}]} }, RowSpacings->1, ColumnSpacings->3, RowAlignments->Baseline, ColumnAlignments->{Center}], TableForm[ {{{{{{1, 1}, {2, 2}}, function1[ {1, 1}, {2, 2}]}}, {{{{1, 1}, {1, 2}}, function1[ {1, 1}, {1, 2}]}, {{{1, 1}, {2, 3}}, function1[ {1, 1}, {2, 3}]}}}, {{{{{1, 2}, {1, 1}}, function1[ {1, 2}, {1, 1}]}, {{{1, 2}, {3, 3}}, function1[ {1, 2}, {3, 3}]}}, {{{{1, 2}, {1, 3}}, function1[ {1, 2}, {1, 3}]}}}}, TableDepth -> 4, TableHeadings -> {{{ 1, 1}, {1, 2}}, {{1, 1}, {1, 2}}}]]], "Output"] }, Open ]], Cell["Un morceau par page.", "Text"], Cell[CellGroupData[{ Cell[BoxData[ \(scanPrint[\[IndentingNewLine]\(\(tableFormSlice[\(1 &\) /@ allLagrangeRepresentatives[d, f]]\)[First@#, TableDepth \[Rule] 4, TableHeadings \[Rule] Rest@#] &\)@ fill[\(MapAt[\({#, function1 @@ #} &\) /@ # &, #, \(-1\)] &\) /@ listQuotient[\[IndentingNewLine]Sort@ Select[allLagrangeBirepresentatives[d, f], First@# \[NotEqual] Last@# &], {First@#, lagrangeRepresentative@\(Last@#\)} &, withValues \[Rule] True]]]\)], "Input"], Cell[BoxData[ InterpretationBox[GridBox[{ {"\<\"\"\>", \({1, 1}\), \({1, 2}\)}, {\({1, 1}\), GridBox[{ {\({{1, 1}, {2, 2}}\), \(function1[{1, 1}, {2, 2}]\)} }, RowSpacings->0.25, ColumnSpacings->1, RowAlignments->Baseline, ColumnAlignments->{Left}], GridBox[{ {\({{1, 1}, {1, 2}}\), \(function1[{1, 1}, {1, 2}]\)}, {\({{1, 1}, {2, 3}}\), \(function1[{1, 1}, {2, 3}]\)} }, RowSpacings->0.25, ColumnSpacings->1, RowAlignments->Baseline, ColumnAlignments->{Left}]} }, RowSpacings->1, ColumnSpacings->3, RowAlignments->Baseline, ColumnAlignments->{Center}], TableForm[ {{{{{{1, 1}, {2, 2}}, function1[ {1, 1}, {2, 2}]}}, {{{{1, 1}, {1, 2}}, function1[ {1, 1}, {1, 2}]}, {{{1, 1}, {2, 3}}, function1[ {1, 1}, {2, 3}]}}}}, TableDepth -> 4, TableHeadings -> {{{ 1, 1}}, {{1, 1}, {1, 2}}}]]], "Print"], Cell[BoxData[ InterpretationBox[GridBox[{ {"\<\"\"\>", \({1, 1}\), \({1, 2}\)}, {\({1, 2}\), GridBox[{ {\({{1, 2}, {1, 1}}\), \(function1[{1, 2}, {1, 1}]\)}, {\({{1, 2}, {3, 3}}\), \(function1[{1, 2}, {3, 3}]\)} }, RowSpacings->0.25, ColumnSpacings->1, RowAlignments->Baseline, ColumnAlignments->{Left}], GridBox[{ {\({{1, 2}, {1, 3}}\), \(function1[{1, 2}, {1, 3}]\)} }, RowSpacings->0.25, ColumnSpacings->1, RowAlignments->Baseline, ColumnAlignments->{Left}]} }, RowSpacings->1, ColumnSpacings->3, RowAlignments->Baseline, ColumnAlignments->{Center}], TableForm[ {{{{{{1, 2}, {1, 1}}, function1[ {1, 2}, {1, 1}]}, {{{1, 2}, {3, 3}}, function1[ {1, 2}, {3, 3}]}}, {{{{1, 2}, {1, 3}}, function1[ {1, 2}, {1, 3}]}}}}, TableDepth -> 4, TableHeadings -> {{{ 1, 2}}, {{1, 1}, {1, 2}}}]]], "Print"] }, Open ]], Cell[BoxData[ \(player = "\"; j = 3;\)], "Input"], Cell[CellGroupData[{ Cell[BoxData[ \(scanPrint@ With[{d1 = d, j1 = j}, \[IndentingNewLine]\(\(tableFormSlice[\(1 &\) /@ allLagrangeRepresentatives[d1, f]]\)[ First@#, \[IndentingNewLine]TableDepth \[Rule] 4, TableHeadings \[Rule] Rest@#] &\)@ fill[\(MapAt[\({#, \[IndentingNewLine]With[{goal = First@#, result = Last@#}, \[IndentingNewLine]\(probability[ player, f, #, goal, #, result] &\) /@ Range@j1\[IndentingNewLine]]\[IndentingNewLine]}\ &\) /@ # &, #, \(-1\)] &\) /@ listQuotient[\[IndentingNewLine]Sort@ Select[allLagrangeBirepresentatives[d1, f], First@# \[NotEqual] Last@# &], {First@#, lagrangeRepresentative@\(Last@#\)} &, withValues \[Rule] True]]\[IndentingNewLine]]\)], "Input"], Cell[BoxData[ InterpretationBox[GridBox[{ {"\<\"\"\>", \({1, 1}\), \({1, 2}\)}, {\({1, 1}\), GridBox[{ {\({{1, 1}, {2, 2}}\), \({1\/9, 4\/81, 16\/729}\)} }, RowSpacings->0.25, ColumnSpacings->1, RowAlignments->Baseline, ColumnAlignments->{Left}], GridBox[{ {\({{1, 1}, {1, 2}}\), \({2\/9, 20\/81, 152\/729}\)}, {\({{1, 1}, {2, 3}}\), \({2\/9, 8\/81, 32\/729}\)} }, RowSpacings->0.25, ColumnSpacings->1, RowAlignments->Baseline, ColumnAlignments->{Left}]} }, RowSpacings->1, ColumnSpacings->3, RowAlignments->Baseline, ColumnAlignments->{Center}], TableForm[ {{{{{{1, 1}, {2, 2}}, { Rational[ 1, 9], Rational[ 4, 81], Rational[ 16, 729]}}}, {{{{1, 1}, {1, 2}}, { Rational[ 2, 9], Rational[ 20, 81], Rational[ 152, 729]}}, {{{1, 1}, {2, 3}}, { Rational[ 2, 9], Rational[ 8, 81], Rational[ 32, 729]}}}}}, TableDepth -> 4, TableHeadings -> {{{1, 1}}, {{1, 1}, {1, 2}}}]]], "Print"], Cell[BoxData[ InterpretationBox[GridBox[{ {"\<\"\"\>", \({1, 1}\), \({1, 2}\)}, {\({1, 2}\), GridBox[{ {\({{1, 2}, {1, 1}}\), \({1\/9, 10\/81, 64\/729}\)}, {\({{1, 2}, {3, 3}}\), \({1\/9, 1\/81, 1\/729}\)} }, RowSpacings->0.25, ColumnSpacings->1, RowAlignments->Baseline, ColumnAlignments->{Left}], GridBox[{ {\({{1, 2}, {1, 3}}\), \({2\/9, 11\/81, 65\/729}\)} }, RowSpacings->0.25, ColumnSpacings->1, RowAlignments->Baseline, ColumnAlignments->{Left}]} }, RowSpacings->1, ColumnSpacings->3, RowAlignments->Baseline, ColumnAlignments->{Center}], TableForm[ {{{{{{1, 2}, {1, 1}}, { Rational[ 1, 9], Rational[ 10, 81], Rational[ 64, 729]}}, {{{1, 2}, {3, 3}}, { Rational[ 1, 9], Rational[ 1, 81], Rational[ 1, 729]}}}, {{{{1, 2}, {1, 3}}, { Rational[ 2, 9], Rational[ 11, 81], Rational[ 65, 729]}}}}}, TableDepth -> 4, TableHeadings -> {{{1, 2}}, {{1, 1}, {1, 2}}}]]], "Print"] }, Open ]], Cell[TextData[{ "Bug de ", StyleBox["TableForm", "Output"], " : d\[EAcute]faut d'entr\[EAcute]e de ligne dans le premier tableau." }], "Text"], Cell[CellGroupData[{ Cell[BoxData[ \(scanPrint@ Flatten[\[IndentingNewLine]\(With[{d1 = First@#, j1 = Last@#}, \[IndentingNewLine]\(\(tableFormSlice[\(1 &\) /@ allLagrangeRepresentatives[d1, f]]\)[ First@#, \[IndentingNewLine]TableHeadings \[Rule] Rest@#, \[IndentingNewLine]TableSpacing \[Rule] {1, 1, 3, 1}, \[IndentingNewLine]TableAlignments \[Rule] \ {Center, Center, Center, Center}\[IndentingNewLine]] &\)@ fill[\(MapAt[\({\[IndentingNewLine]ColumnForm[ Insert[#, "\<\[DownArrow]\>", 2], Center], \[IndentingNewLine]With[{goal = First@#, result = Last@#}, \[IndentingNewLine]TableForm[\ \[IndentingNewLine]numberForm1 /@ \((\(probability[player, f, #, goal, #, result] &\) /@ Range@ j1)\)\[IndentingNewLine]]\ \[IndentingNewLine]]\[IndentingNewLine]} &\) /@ # &, #, \(-1\)] &\) /@ listQuotient[\[IndentingNewLine]Sort@ Select[allLagrangeBirepresentatives[d1, f], First@# \[NotEqual] Last@# &], {First@#, lagrangeRepresentative[Last@#]} &, withValues \[Rule] True]]\[IndentingNewLine]] &\) /@ \((Append[\({#, j - 1} &\) /@ Range[d - 1], {d, j}])\), 1]\)], "Input"], Cell[BoxData[ InterpretationBox[GridBox[{ {"\<\"\"\>", \({1}\)}, {GridBox[{ { InterpretationBox[GridBox[{ {\({1}\)}, {"\<\"\[DownArrow]\"\>"}, {\({2}\)} }, GridBaseline->{Baseline, {1, 1}}, ColumnAlignments->{Center}], ColumnForm[ {{1}, "\[DownArrow]", {2}}, Center], Editable->False], InterpretationBox[GridBox[{ {\(numberForm1[1\/3]\)}, {\(numberForm1[2\/9]\)} }, RowSpacings->1, ColumnSpacings->3, RowAlignments->Baseline, ColumnAlignments->{Left}], TableForm[ { numberForm1[ Rational[ 1, 3]], numberForm1[ Rational[ 2, 9]]}]]} }, RowSpacings->3, ColumnSpacings->1, RowAlignments->Center, ColumnAlignments->{Center}], ""} }, RowSpacings->1, ColumnSpacings->1, RowAlignments->Center, ColumnAlignments->{Center}], TableForm[ {{{{ ColumnForm[ {{1}, "\[DownArrow]", {2}}, Center], TableForm[ { numberForm1[ Rational[ 1, 3]], numberForm1[ Rational[ 2, 9]]}]}}}}, TableHeadings -> {{{1}}, {{1}}}, TableSpacing -> {1, 1, 3, 1}, TableAlignments -> {Center, Center, Center, Center}]]], "Print"], Cell[BoxData[ InterpretationBox[GridBox[{ {"\<\"\"\>", \({1, 1}\), \({1, 2}\)}, {\({1, 1}\), GridBox[{ { InterpretationBox[GridBox[{ {\({1, 1}\)}, {"\<\"\[DownArrow]\"\>"}, {\({2, 2}\)} }, GridBaseline->{Baseline, {1, 1}}, ColumnAlignments->{Center}], ColumnForm[ {{1, 1}, "\[DownArrow]", {2, 2}}, Center], Editable->False], InterpretationBox[GridBox[{ {\(numberForm1[1\/9]\)}, {\(numberForm1[4\/81]\)}, {\(numberForm1[16\/729]\)} }, RowSpacings->1, ColumnSpacings->3, RowAlignments->Baseline, ColumnAlignments->{Left}], TableForm[ { numberForm1[ Rational[ 1, 9]], numberForm1[ Rational[ 4, 81]], numberForm1[ Rational[ 16, 729]]}]]} }, RowSpacings->3, ColumnSpacings->1, RowAlignments->Center, ColumnAlignments->{Center}], GridBox[{ { InterpretationBox[GridBox[{ {\({1, 1}\)}, {"\<\"\[DownArrow]\"\>"}, {\({1, 2}\)} }, GridBaseline->{Baseline, {1, 1}}, ColumnAlignments->{Center}], ColumnForm[ {{1, 1}, "\[DownArrow]", {1, 2}}, Center], Editable->False], InterpretationBox[GridBox[{ {\(numberForm1[2\/9]\)}, {\(numberForm1[20\/81]\)}, {\(numberForm1[152\/729]\)} }, RowSpacings->1, ColumnSpacings->3, RowAlignments->Baseline, ColumnAlignments->{Left}], TableForm[ { numberForm1[ Rational[ 2, 9]], numberForm1[ Rational[ 20, 81]], numberForm1[ Rational[ 152, 729]]}]]}, { InterpretationBox[GridBox[{ {\({1, 1}\)}, {"\<\"\[DownArrow]\"\>"}, {\({2, 3}\)} }, GridBaseline->{Baseline, {1, 1}}, ColumnAlignments->{Center}], ColumnForm[ {{1, 1}, "\[DownArrow]", {2, 3}}, Center], Editable->False], InterpretationBox[GridBox[{ {\(numberForm1[2\/9]\)}, {\(numberForm1[8\/81]\)}, {\(numberForm1[32\/729]\)} }, RowSpacings->1, ColumnSpacings->3, RowAlignments->Baseline, ColumnAlignments->{Left}], TableForm[ { numberForm1[ Rational[ 2, 9]], numberForm1[ Rational[ 8, 81]], numberForm1[ Rational[ 32, 729]]}]]} }, RowSpacings->3, ColumnSpacings->1, RowAlignments->Center, ColumnAlignments->{Center}]} }, RowSpacings->1, ColumnSpacings->1, RowAlignments->Center, ColumnAlignments->{Center}], TableForm[ {{{{ ColumnForm[ {{1, 1}, "\[DownArrow]", {2, 2}}, Center], TableForm[ { numberForm1[ Rational[ 1, 9]], numberForm1[ Rational[ 4, 81]], numberForm1[ Rational[ 16, 729]]}]}}, {{ ColumnForm[ {{1, 1}, "\[DownArrow]", {1, 2}}, Center], TableForm[ { numberForm1[ Rational[ 2, 9]], numberForm1[ Rational[ 20, 81]], numberForm1[ Rational[ 152, 729]]}]}, { ColumnForm[ {{1, 1}, "\[DownArrow]", {2, 3}}, Center], TableForm[ { numberForm1[ Rational[ 2, 9]], numberForm1[ Rational[ 8, 81]], numberForm1[ Rational[ 32, 729]]}]}}}}, TableHeadings -> {{{1, 1}}, {{1, 1}, { 1, 2}}}, TableSpacing -> {1, 1, 3, 1}, TableAlignments -> {Center, Center, Center, Center}]]], "Print"], Cell[BoxData[ InterpretationBox[GridBox[{ {"\<\"\"\>", \({1, 1}\), \({1, 2}\)}, {\({1, 2}\), GridBox[{ { InterpretationBox[GridBox[{ {\({1, 2}\)}, {"\<\"\[DownArrow]\"\>"}, {\({1, 1}\)} }, GridBaseline->{Baseline, {1, 1}}, ColumnAlignments->{Center}], ColumnForm[ {{1, 2}, "\[DownArrow]", {1, 1}}, Center], Editable->False], InterpretationBox[GridBox[{ {\(numberForm1[1\/9]\)}, {\(numberForm1[10\/81]\)}, {\(numberForm1[64\/729]\)} }, RowSpacings->1, ColumnSpacings->3, RowAlignments->Baseline, ColumnAlignments->{Left}], TableForm[ { numberForm1[ Rational[ 1, 9]], numberForm1[ Rational[ 10, 81]], numberForm1[ Rational[ 64, 729]]}]]}, { InterpretationBox[GridBox[{ {\({1, 2}\)}, {"\<\"\[DownArrow]\"\>"}, {\({3, 3}\)} }, GridBaseline->{Baseline, {1, 1}}, ColumnAlignments->{Center}], ColumnForm[ {{1, 2}, "\[DownArrow]", {3, 3}}, Center], Editable->False], InterpretationBox[GridBox[{ {\(numberForm1[1\/9]\)}, {\(numberForm1[1\/81]\)}, {\(numberForm1[1\/729]\)} }, RowSpacings->1, ColumnSpacings->3, RowAlignments->Baseline, ColumnAlignments->{Left}], TableForm[ { numberForm1[ Rational[ 1, 9]], numberForm1[ Rational[ 1, 81]], numberForm1[ Rational[ 1, 729]]}]]} }, RowSpacings->3, ColumnSpacings->1, RowAlignments->Center, ColumnAlignments->{Center}], GridBox[{ { InterpretationBox[GridBox[{ {\({1, 2}\)}, {"\<\"\[DownArrow]\"\>"}, {\({1, 3}\)} }, GridBaseline->{Baseline, {1, 1}}, ColumnAlignments->{Center}], ColumnForm[ {{1, 2}, "\[DownArrow]", {1, 3}}, Center], Editable->False], InterpretationBox[GridBox[{ {\(numberForm1[2\/9]\)}, {\(numberForm1[11\/81]\)}, {\(numberForm1[65\/729]\)} }, RowSpacings->1, ColumnSpacings->3, RowAlignments->Baseline, ColumnAlignments->{Left}], TableForm[ { numberForm1[ Rational[ 2, 9]], numberForm1[ Rational[ 11, 81]], numberForm1[ Rational[ 65, 729]]}]]} }, RowSpacings->3, ColumnSpacings->1, RowAlignments->Center, ColumnAlignments->{Center}]} }, RowSpacings->1, ColumnSpacings->1, RowAlignments->Center, ColumnAlignments->{Center}], TableForm[ {{{{ ColumnForm[ {{1, 2}, "\[DownArrow]", {1, 1}}, Center], TableForm[ { numberForm1[ Rational[ 1, 9]], numberForm1[ Rational[ 10, 81]], numberForm1[ Rational[ 64, 729]]}]}, { ColumnForm[ {{1, 2}, "\[DownArrow]", {3, 3}}, Center], TableForm[ { numberForm1[ Rational[ 1, 9]], numberForm1[ Rational[ 1, 81]], numberForm1[ Rational[ 1, 729]]}]}}, {{ ColumnForm[ {{1, 2}, "\[DownArrow]", {1, 3}}, Center], TableForm[ { numberForm1[ Rational[ 2, 9]], numberForm1[ Rational[ 11, 81]], numberForm1[ Rational[ 65, 729]]}]}}}}, TableHeadings -> {{{1, 2}}, {{1, 1}, { 1, 2}}}, TableSpacing -> {1, 1, 3, 1}, TableAlignments -> {Center, Center, Center, Center}]]], "Print"] }, Open ]], Cell["Contourner le bug.", "Text"], Cell[CellGroupData[{ Cell[BoxData[ RowBox[{"scanPrint", "@", RowBox[{ StyleBox["MapAt", FontColor->RGBColor[1, 0, 0]], StyleBox["[", FontColor->RGBColor[1, 0, 0]], RowBox[{ StyleBox[\(TableForm[{{1}, #}, TableDirections \[Rule] Row] &\), FontColor->RGBColor[1, 0, 0]], StyleBox[",", FontColor->RGBColor[1, 0, 0]], \(Flatten[\[IndentingNewLine]\(With[{d1 = First@#, j1 = Last@#}, \[IndentingNewLine]\(\(tableFormSlice[\(1 &\ \) /@ allLagrangeRepresentatives[d1, f]]\)[ First@#, \[IndentingNewLine]TableHeadings \[Rule] Rest@#, \[IndentingNewLine]TableSpacing \[Rule] {1, 1, 3, 1}, \[IndentingNewLine]TableAlignments \ \[Rule] {Center, Center, Center, Center}\[IndentingNewLine]] &\)@ fill[\(MapAt[\({\[IndentingNewLine]ColumnForm[ Insert[#, "\<\[DownArrow]\>", 2], Center], \[IndentingNewLine]With[{goal \ = First@#, result = Last@#}, \ \[IndentingNewLine]TableForm[\[IndentingNewLine]numberForm1 /@ \ \((\(probability[player, f, #, goal, #, result] &\) /@ Range@ j1)\)\[IndentingNewLine]]\ \[IndentingNewLine]]\[IndentingNewLine]} &\) /@ # &, #, \(-1\)] &\) /@ listQuotient[\[IndentingNewLine]Sort@ Select[allLagrangeBirepresentatives[d1, f], First@# \[NotEqual] Last@# &], {First@#, lagrangeRepresentative@\(Last@#\)} &, withValues \[Rule] True]]\[IndentingNewLine]] &\) /@ \((Append[\({#, j - 1} &\) /@ Range[d - 1], {d, j}])\), 1]\), StyleBox[",", FontColor->RGBColor[1, 0, 0]], StyleBox["1", FontColor->RGBColor[1, 0, 0]]}], StyleBox["]", FontColor->RGBColor[1, 0, 0]]}]}]], "Input"], Cell[BoxData[ InterpretationBox[GridBox[{ {"1", InterpretationBox[GridBox[{ {"\<\"\"\>", \({1}\)}, {GridBox[{ { InterpretationBox[GridBox[{ {\({1}\)}, {"\<\"\[DownArrow]\"\>"}, {\({2}\)} }, GridBaseline->{Baseline, {1, 1}}, ColumnAlignments->{Center}], ColumnForm[ {{1}, "\[DownArrow]", {2}}, Center], Editable->False], InterpretationBox[GridBox[{ {\(numberForm1[1\/3]\)}, {\(numberForm1[2\/9]\)} }, RowSpacings->1, ColumnSpacings->3, RowAlignments->Baseline, ColumnAlignments->{Left}], TableForm[ { numberForm1[ Rational[ 1, 3]], numberForm1[ Rational[ 2, 9]]}]]} }, RowSpacings->3, ColumnSpacings->1, RowAlignments->Center, ColumnAlignments->{Center}], ""} }, RowSpacings->1, ColumnSpacings->1, RowAlignments->Center, ColumnAlignments->{Center}], TableForm[ {{{{ ColumnForm[ {{1}, "\[DownArrow]", {2}}, Center], TableForm[ { numberForm1[ Rational[ 1, 3]], numberForm1[ Rational[ 2, 9]]}]}}}}, TableHeadings -> {{{1}}, {{1}}}, TableSpacing -> {1, 1, 3, 1}, TableAlignments -> {Center, Center, Center, Center}]]} }, RowSpacings->3, ColumnSpacings->1, RowAlignments->Baseline, ColumnAlignments->{Left}], TableForm[ {{1}, TableForm[ {{{{ ColumnForm[ {{1}, "\[DownArrow]", {2}}, Center], TableForm[ { numberForm1[ Rational[ 1, 3]], numberForm1[ Rational[ 2, 9]]}]}}}}, TableHeadings -> {{{1}}, {{1}}}, TableSpacing -> {1, 1, 3, 1}, TableAlignments -> {Center, Center, Center, Center}]}, TableDirections -> Row]]], "Print"], Cell[BoxData[ InterpretationBox[GridBox[{ {"\<\"\"\>", \({1, 1}\), \({1, 2}\)}, {\({1, 1}\), GridBox[{ { InterpretationBox[GridBox[{ {\({1, 1}\)}, {"\<\"\[DownArrow]\"\>"}, {\({2, 2}\)} }, GridBaseline->{Baseline, {1, 1}}, ColumnAlignments->{Center}], ColumnForm[ {{1, 1}, "\[DownArrow]", {2, 2}}, Center], Editable->False], InterpretationBox[GridBox[{ {\(numberForm1[1\/9]\)}, {\(numberForm1[4\/81]\)}, {\(numberForm1[16\/729]\)} }, RowSpacings->1, ColumnSpacings->3, RowAlignments->Baseline, ColumnAlignments->{Left}], TableForm[ { numberForm1[ Rational[ 1, 9]], numberForm1[ Rational[ 4, 81]], numberForm1[ Rational[ 16, 729]]}]]} }, RowSpacings->3, ColumnSpacings->1, RowAlignments->Center, ColumnAlignments->{Center}], GridBox[{ { InterpretationBox[GridBox[{ {\({1, 1}\)}, {"\<\"\[DownArrow]\"\>"}, {\({1, 2}\)} }, GridBaseline->{Baseline, {1, 1}}, ColumnAlignments->{Center}], ColumnForm[ {{1, 1}, "\[DownArrow]", {1, 2}}, Center], Editable->False], InterpretationBox[GridBox[{ {\(numberForm1[2\/9]\)}, {\(numberForm1[20\/81]\)}, {\(numberForm1[152\/729]\)} }, RowSpacings->1, ColumnSpacings->3, RowAlignments->Baseline, ColumnAlignments->{Left}], TableForm[ { numberForm1[ Rational[ 2, 9]], numberForm1[ Rational[ 20, 81]], numberForm1[ Rational[ 152, 729]]}]]}, { InterpretationBox[GridBox[{ {\({1, 1}\)}, {"\<\"\[DownArrow]\"\>"}, {\({2, 3}\)} }, GridBaseline->{Baseline, {1, 1}}, ColumnAlignments->{Center}], ColumnForm[ {{1, 1}, "\[DownArrow]", {2, 3}}, Center], Editable->False], InterpretationBox[GridBox[{ {\(numberForm1[2\/9]\)}, {\(numberForm1[8\/81]\)}, {\(numberForm1[32\/729]\)} }, RowSpacings->1, ColumnSpacings->3, RowAlignments->Baseline, ColumnAlignments->{Left}], TableForm[ { numberForm1[ Rational[ 2, 9]], numberForm1[ Rational[ 8, 81]], numberForm1[ Rational[ 32, 729]]}]]} }, RowSpacings->3, ColumnSpacings->1, RowAlignments->Center, ColumnAlignments->{Center}]} }, RowSpacings->1, ColumnSpacings->1, RowAlignments->Center, ColumnAlignments->{Center}], TableForm[ {{{{ ColumnForm[ {{1, 1}, "\[DownArrow]", {2, 2}}, Center], TableForm[ { numberForm1[ Rational[ 1, 9]], numberForm1[ Rational[ 4, 81]], numberForm1[ Rational[ 16, 729]]}]}}, {{ ColumnForm[ {{1, 1}, "\[DownArrow]", {1, 2}}, Center], TableForm[ { numberForm1[ Rational[ 2, 9]], numberForm1[ Rational[ 20, 81]], numberForm1[ Rational[ 152, 729]]}]}, { ColumnForm[ {{1, 1}, "\[DownArrow]", {2, 3}}, Center], TableForm[ { numberForm1[ Rational[ 2, 9]], numberForm1[ Rational[ 8, 81]], numberForm1[ Rational[ 32, 729]]}]}}}}, TableHeadings -> {{{1, 1}}, {{1, 1}, { 1, 2}}}, TableSpacing -> {1, 1, 3, 1}, TableAlignments -> {Center, Center, Center, Center}]]], "Print"], Cell[BoxData[ InterpretationBox[GridBox[{ {"\<\"\"\>", \({1, 1}\), \({1, 2}\)}, {\({1, 2}\), GridBox[{ { InterpretationBox[GridBox[{ {\({1, 2}\)}, {"\<\"\[DownArrow]\"\>"}, {\({1, 1}\)} }, GridBaseline->{Baseline, {1, 1}}, ColumnAlignments->{Center}], ColumnForm[ {{1, 2}, "\[DownArrow]", {1, 1}}, Center], Editable->False], InterpretationBox[GridBox[{ {\(numberForm1[1\/9]\)}, {\(numberForm1[10\/81]\)}, {\(numberForm1[64\/729]\)} }, RowSpacings->1, ColumnSpacings->3, RowAlignments->Baseline, ColumnAlignments->{Left}], TableForm[ { numberForm1[ Rational[ 1, 9]], numberForm1[ Rational[ 10, 81]], numberForm1[ Rational[ 64, 729]]}]]}, { InterpretationBox[GridBox[{ {\({1, 2}\)}, {"\<\"\[DownArrow]\"\>"}, {\({3, 3}\)} }, GridBaseline->{Baseline, {1, 1}}, ColumnAlignments->{Center}], ColumnForm[ {{1, 2}, "\[DownArrow]", {3, 3}}, Center], Editable->False], InterpretationBox[GridBox[{ {\(numberForm1[1\/9]\)}, {\(numberForm1[1\/81]\)}, {\(numberForm1[1\/729]\)} }, RowSpacings->1, ColumnSpacings->3, RowAlignments->Baseline, ColumnAlignments->{Left}], TableForm[ { numberForm1[ Rational[ 1, 9]], numberForm1[ Rational[ 1, 81]], numberForm1[ Rational[ 1, 729]]}]]} }, RowSpacings->3, ColumnSpacings->1, RowAlignments->Center, ColumnAlignments->{Center}], GridBox[{ { InterpretationBox[GridBox[{ {\({1, 2}\)}, {"\<\"\[DownArrow]\"\>"}, {\({1, 3}\)} }, GridBaseline->{Baseline, {1, 1}}, ColumnAlignments->{Center}], ColumnForm[ {{1, 2}, "\[DownArrow]", {1, 3}}, Center], Editable->False], InterpretationBox[GridBox[{ {\(numberForm1[2\/9]\)}, {\(numberForm1[11\/81]\)}, {\(numberForm1[65\/729]\)} }, RowSpacings->1, ColumnSpacings->3, RowAlignments->Baseline, ColumnAlignments->{Left}], TableForm[ { numberForm1[ Rational[ 2, 9]], numberForm1[ Rational[ 11, 81]], numberForm1[ Rational[ 65, 729]]}]]} }, RowSpacings->3, ColumnSpacings->1, RowAlignments->Center, ColumnAlignments->{Center}]} }, RowSpacings->1, ColumnSpacings->1, RowAlignments->Center, ColumnAlignments->{Center}], TableForm[ {{{{ ColumnForm[ {{1, 2}, "\[DownArrow]", {1, 1}}, Center], TableForm[ { numberForm1[ Rational[ 1, 9]], numberForm1[ Rational[ 10, 81]], numberForm1[ Rational[ 64, 729]]}]}, { ColumnForm[ {{1, 2}, "\[DownArrow]", {3, 3}}, Center], TableForm[ { numberForm1[ Rational[ 1, 9]], numberForm1[ Rational[ 1, 81]], numberForm1[ Rational[ 1, 729]]}]}}, {{ ColumnForm[ {{1, 2}, "\[DownArrow]", {1, 3}}, Center], TableForm[ { numberForm1[ Rational[ 2, 9]], numberForm1[ Rational[ 11, 81]], numberForm1[ Rational[ 65, 729]]}]}}}}, TableHeadings -> {{{1, 2}}, {{1, 1}, { 1, 2}}}, TableSpacing -> {1, 1, 3, 1}, TableAlignments -> {Center, Center, Center, Center}]]], "Print"] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[ \(\((Switch[player, \[IndentingNewLine]"\", Print["\"], \ \[IndentingNewLine]"\", Print["\"]]; \ \[IndentingNewLine]scanPrint@ Flatten[\[IndentingNewLine]\(With[{d1 = First@#, j1 = Last@#}, \[IndentingNewLine]\(\(tableFormSlice[\(1 &\) \ /@ allLagrangeRepresentatives[d1, f]]\)[ First@#, \[IndentingNewLine]TableHeadings \[Rule] Map[Composition[DisplayForm, RowBox, Reverse], Rest@#, {2}], \[IndentingNewLine]TableSpacing \ \[Rule] {1, 1, 3, 1}\[IndentingNewLine]] &\)@ fill[\(MapAt[\({\[IndentingNewLine]ColumnForm[ Insert[ Composition[DisplayForm, RowBox, Reverse] /@ #, "\<\[DownArrow]\>", 2], Center], \ \[IndentingNewLine]With[{goal = First@#, result = Last@#}, \ \[IndentingNewLine]TableForm[\[IndentingNewLine]numberForm1 /@ \ \((\(probability[player, f, #, goal, #, result] &\) /@ Range@ j1)\)\[IndentingNewLine]]\ \[IndentingNewLine]]\[IndentingNewLine]} &\) /@ # &, #, \(-1\)] &\) /@ listQuotient[\[IndentingNewLine]Sort@ Select[allLagrangeBirepresentatives[d1, f], First@# \[NotEqual] Last@# &], {First@#, lagrangeRepresentative@\(Last@#\)} &, withValues \[Rule] True]]\[IndentingNewLine]] &\) /@ \((Append[\({#, j - 1} &\) /@ Range[d - 1], {d, j}])\), 1])\)\)], "Input"], Cell[BoxData[ \("First player's failure probabilities"\)], "Print"], Cell[BoxData[ InterpretationBox[GridBox[{ {"\<\"\"\>", TagBox["1", DisplayForm]}, {GridBox[{ { InterpretationBox[GridBox[{ {"1"}, {"\<\"\[DownArrow]\"\>"}, {"2"} }, GridBaseline->{Baseline, {1, 1}}, ColumnAlignments->{Center}], ColumnForm[ { DisplayForm[ RowBox[ {1}]], "\[DownArrow]", DisplayForm[ RowBox[ {2}]]}, Center], Editable->False], InterpretationBox[GridBox[{ {\(numberForm1[1\/3]\)}, {\(numberForm1[2\/9]\)} }, RowSpacings->1, ColumnSpacings->3, RowAlignments->Baseline, ColumnAlignments->{Left}], TableForm[ { numberForm1[ Rational[ 1, 3]], numberForm1[ Rational[ 2, 9]]}]]} }, RowSpacings->3, ColumnSpacings->1, RowAlignments->Baseline, ColumnAlignments->{Left}], ""} }, RowSpacings->1, ColumnSpacings->1, RowAlignments->Baseline, ColumnAlignments->{Center}], TableForm[ {{{{ ColumnForm[ { DisplayForm[ RowBox[ {1}]], "\[DownArrow]", DisplayForm[ RowBox[ {2}]]}, Center], TableForm[ { numberForm1[ Rational[ 1, 3]], numberForm1[ Rational[ 2, 9]]}]}}}}, TableHeadings -> {{ DisplayForm[ RowBox[ {1}]]}, { DisplayForm[ RowBox[ {1}]]}}, TableSpacing -> {1, 1, 3, 1}]]], "Print"], Cell[BoxData[ InterpretationBox[GridBox[{ {"\<\"\"\>", TagBox[\(1 1\), DisplayForm], TagBox[\(2 1\), DisplayForm]}, { TagBox[\(1 1\), DisplayForm], GridBox[{ { InterpretationBox[GridBox[{ {\(1 1\)}, {"\<\"\[DownArrow]\"\>"}, {\(2 2\)} }, GridBaseline->{Baseline, {1, 1}}, ColumnAlignments->{Center}], ColumnForm[ { DisplayForm[ RowBox[ {1, 1}]], "\[DownArrow]", DisplayForm[ RowBox[ {2, 2}]]}, Center], Editable->False], InterpretationBox[GridBox[{ {\(numberForm1[1\/9]\)}, {\(numberForm1[4\/81]\)}, {\(numberForm1[16\/729]\)} }, RowSpacings->1, ColumnSpacings->3, RowAlignments->Baseline, ColumnAlignments->{Left}], TableForm[ { numberForm1[ Rational[ 1, 9]], numberForm1[ Rational[ 4, 81]], numberForm1[ Rational[ 16, 729]]}]]} }, RowSpacings->3, ColumnSpacings->1, RowAlignments->Baseline, ColumnAlignments->{Left}], GridBox[{ { InterpretationBox[GridBox[{ {\(1 1\)}, {"\<\"\[DownArrow]\"\>"}, {\(2 1\)} }, GridBaseline->{Baseline, {1, 1}}, ColumnAlignments->{Center}], ColumnForm[ { DisplayForm[ RowBox[ {1, 1}]], "\[DownArrow]", DisplayForm[ RowBox[ {2, 1}]]}, Center], Editable->False], InterpretationBox[GridBox[{ {\(numberForm1[2\/9]\)}, {\(numberForm1[20\/81]\)}, {\(numberForm1[152\/729]\)} }, RowSpacings->1, ColumnSpacings->3, RowAlignments->Baseline, ColumnAlignments->{Left}], TableForm[ { numberForm1[ Rational[ 2, 9]], numberForm1[ Rational[ 20, 81]], numberForm1[ Rational[ 152, 729]]}]]}, { InterpretationBox[GridBox[{ {\(1 1\)}, {"\<\"\[DownArrow]\"\>"}, {\(3 2\)} }, GridBaseline->{Baseline, {1, 1}}, ColumnAlignments->{Center}], ColumnForm[ { DisplayForm[ RowBox[ {1, 1}]], "\[DownArrow]", DisplayForm[ RowBox[ {3, 2}]]}, Center], Editable->False], InterpretationBox[GridBox[{ {\(numberForm1[2\/9]\)}, {\(numberForm1[8\/81]\)}, {\(numberForm1[32\/729]\)} }, RowSpacings->1, ColumnSpacings->3, RowAlignments->Baseline, ColumnAlignments->{Left}], TableForm[ { numberForm1[ Rational[ 2, 9]], numberForm1[ Rational[ 8, 81]], numberForm1[ Rational[ 32, 729]]}]]} }, RowSpacings->3, ColumnSpacings->1, RowAlignments->Baseline, ColumnAlignments->{Left}]} }, RowSpacings->1, ColumnSpacings->1, RowAlignments->Baseline, ColumnAlignments->{Center}], TableForm[ {{{{ ColumnForm[ { DisplayForm[ RowBox[ {1, 1}]], "\[DownArrow]", DisplayForm[ RowBox[ {2, 2}]]}, Center], TableForm[ { numberForm1[ Rational[ 1, 9]], numberForm1[ Rational[ 4, 81]], numberForm1[ Rational[ 16, 729]]}]}}, {{ ColumnForm[ { DisplayForm[ RowBox[ {1, 1}]], "\[DownArrow]", DisplayForm[ RowBox[ {2, 1}]]}, Center], TableForm[ { numberForm1[ Rational[ 2, 9]], numberForm1[ Rational[ 20, 81]], numberForm1[ Rational[ 152, 729]]}]}, { ColumnForm[ { DisplayForm[ RowBox[ {1, 1}]], "\[DownArrow]", DisplayForm[ RowBox[ {3, 2}]]}, Center], TableForm[ { numberForm1[ Rational[ 2, 9]], numberForm1[ Rational[ 8, 81]], numberForm1[ Rational[ 32, 729]]}]}}}}, TableHeadings -> {{ DisplayForm[ RowBox[ {1, 1}]]}, { DisplayForm[ RowBox[ {1, 1}]], DisplayForm[ RowBox[ {2, 1}]]}}, TableSpacing -> {1, 1, 3, 1}]]], "Print"], Cell[BoxData[ InterpretationBox[GridBox[{ {"\<\"\"\>", TagBox[\(1 1\), DisplayForm], TagBox[\(2 1\), DisplayForm]}, { TagBox[\(2 1\), DisplayForm], GridBox[{ { InterpretationBox[GridBox[{ {\(2 1\)}, {"\<\"\[DownArrow]\"\>"}, {\(1 1\)} }, GridBaseline->{Baseline, {1, 1}}, ColumnAlignments->{Center}], ColumnForm[ { DisplayForm[ RowBox[ {2, 1}]], "\[DownArrow]", DisplayForm[ RowBox[ {1, 1}]]}, Center], Editable->False], InterpretationBox[GridBox[{ {\(numberForm1[1\/9]\)}, {\(numberForm1[10\/81]\)}, {\(numberForm1[64\/729]\)} }, RowSpacings->1, ColumnSpacings->3, RowAlignments->Baseline, ColumnAlignments->{Left}], TableForm[ { numberForm1[ Rational[ 1, 9]], numberForm1[ Rational[ 10, 81]], numberForm1[ Rational[ 64, 729]]}]]}, { InterpretationBox[GridBox[{ {\(2 1\)}, {"\<\"\[DownArrow]\"\>"}, {\(3 3\)} }, GridBaseline->{Baseline, {1, 1}}, ColumnAlignments->{Center}], ColumnForm[ { DisplayForm[ RowBox[ {2, 1}]], "\[DownArrow]", DisplayForm[ RowBox[ {3, 3}]]}, Center], Editable->False], InterpretationBox[GridBox[{ {\(numberForm1[1\/9]\)}, {\(numberForm1[1\/81]\)}, {\(numberForm1[1\/729]\)} }, RowSpacings->1, ColumnSpacings->3, RowAlignments->Baseline, ColumnAlignments->{Left}], TableForm[ { numberForm1[ Rational[ 1, 9]], numberForm1[ Rational[ 1, 81]], numberForm1[ Rational[ 1, 729]]}]]} }, RowSpacings->3, ColumnSpacings->1, RowAlignments->Baseline, ColumnAlignments->{Left}], GridBox[{ { InterpretationBox[GridBox[{ {\(2 1\)}, {"\<\"\[DownArrow]\"\>"}, {\(3 1\)} }, GridBaseline->{Baseline, {1, 1}}, ColumnAlignments->{Center}], ColumnForm[ { DisplayForm[ RowBox[ {2, 1}]], "\[DownArrow]", DisplayForm[ RowBox[ {3, 1}]]}, Center], Editable->False], InterpretationBox[GridBox[{ {\(numberForm1[2\/9]\)}, {\(numberForm1[11\/81]\)}, {\(numberForm1[65\/729]\)} }, RowSpacings->1, ColumnSpacings->3, RowAlignments->Baseline, ColumnAlignments->{Left}], TableForm[ { numberForm1[ Rational[ 2, 9]], numberForm1[ Rational[ 11, 81]], numberForm1[ Rational[ 65, 729]]}]]} }, RowSpacings->3, ColumnSpacings->1, RowAlignments->Baseline, ColumnAlignments->{Left}]} }, RowSpacings->1, ColumnSpacings->1, RowAlignments->Baseline, ColumnAlignments->{Center}], TableForm[ {{{{ ColumnForm[ { DisplayForm[ RowBox[ {2, 1}]], "\[DownArrow]", DisplayForm[ RowBox[ {1, 1}]]}, Center], TableForm[ { numberForm1[ Rational[ 1, 9]], numberForm1[ Rational[ 10, 81]], numberForm1[ Rational[ 64, 729]]}]}, { ColumnForm[ { DisplayForm[ RowBox[ {2, 1}]], "\[DownArrow]", DisplayForm[ RowBox[ {3, 3}]]}, Center], TableForm[ { numberForm1[ Rational[ 1, 9]], numberForm1[ Rational[ 1, 81]], numberForm1[ Rational[ 1, 729]]}]}}, {{ ColumnForm[ { DisplayForm[ RowBox[ {2, 1}]], "\[DownArrow]", DisplayForm[ RowBox[ {3, 1}]]}, Center], TableForm[ { numberForm1[ Rational[ 2, 9]], numberForm1[ Rational[ 11, 81]], numberForm1[ Rational[ 65, 729]]}]}}}}, TableHeadings -> {{ DisplayForm[ RowBox[ {2, 1}]]}, { DisplayForm[ RowBox[ {1, 1}]], DisplayForm[ RowBox[ {2, 1}]]}}, TableSpacing -> {1, 1, 3, 1}]]], "Print"] }, Open ]], Cell[BoxData[ \(\({player, d, f, j} =. ;\)\)], "Input"], Cell[BoxData[{\(Clear@ failureProbabilityChart;\), "\[IndentingNewLine]", \(Options@ failureProbabilityChart = {numberForm1 \[Rule] Identity};\), "\[IndentingNewLine]", RowBox[{\(failureProbabilityChart[player : \(("\" | "\")\), d_Integer, f_Integer, j_Integer, probability, options1___]\), ":=", RowBox[{"With", "[", RowBox[{ RowBox[{"{", RowBox[{"patch", StyleBox["=", FontColor->GrayLevel[ 0]], \(MapAt[ TableForm[{Composition[DisplayForm, StyleBox[#, Background \[Rule] GrayLevel[0.5]] &, FrameBox]@1, #}, TableDirections \[Rule] Row] &, #, 1] &\)}], StyleBox["}", FontColor->GrayLevel[0]]}], ",", \(Switch[player, \[IndentingNewLine]"\", Print["\"], \ \[IndentingNewLine]"\", Print["\"]]; \ \[IndentingNewLine]scanPrint@\(patch@ Flatten[\[IndentingNewLine]\(With[{d1 = First@#, j1 = Last@#}, \ \[IndentingNewLine]\(\(tableFormSlice[\(1 &\) /@ allLagrangeRepresentatives[d1, f]]\)[ First@#, \[IndentingNewLine]TableHeadings \[Rule] Map[Composition[DisplayForm, StyleBox[#, Background \[Rule] GrayLevel[0.5]] &, FrameBox, RowBox, Reverse], Rest@#, {2}], \[IndentingNewLine]TableSpacing \ \[Rule] {1, 1, 3, 1}\[IndentingNewLine]] &\)@ fill[\(MapAt[\({\[IndentingNewLine]ColumnForm[ Insert[ Composition[DisplayForm, FrameBox, RowBox, Reverse] /@ #, "\<\[DownArrow]\>", 2], Center], \ \[IndentingNewLine]With[{goal = First@#, result = Last@#}, \ \[IndentingNewLine]TableForm[\[IndentingNewLine]With[{probabilityList = \ \(probability[player, f, #, goal, #, result] &\) /@ Range@ j1}, \ \[IndentingNewLine]\((\(numberForm1 /. {options1}\) /. Options@failureProbabilityChart)\) /@ probabilityList\[IndentingNewLine]]\ \[IndentingNewLine]]\[IndentingNewLine]]\[IndentingNewLine]} &\) /@ # &, #, \ \(-1\)] &\) /@ listQuotient[\[IndentingNewLine]Sort@ Select[allLagrangeBirepresentatives[d1, f], First@# \[NotEqual] Last@# &], {First@#, lagrangeRepresentative@\(Last@#\)} &, withValues \[Rule] True]]\[IndentingNewLine]] &\) /@ \ \((Append[\({#, j - 1} &\) /@ Range[d - 1], {d, j}])\), 1]\)\)}], "]"}]}]}], "Input", InitializationCell->True], Cell[CellGroupData[{ Cell[BoxData[ \(With[{d = 2, f = 3, j = 3}, \[IndentingNewLine]failureProbabilityChart["\", d, f, j, probability, numberForm1 \[Rule] approximationBox]; \[IndentingNewLine]failureProbabilityChart["\", d, f, j, probability, numberForm1 \[Rule] approximationBox]\[IndentingNewLine]]\)], "Input"], Cell[BoxData[ \("First player's failure probabilities"\)], "Print"], Cell[BoxData[ InterpretationBox[GridBox[{ { TagBox[ StyleBox[ FrameBox["1"], Background->GrayLevel[0.500008]], DisplayForm], InterpretationBox[GridBox[{ {"\<\"\"\>", TagBox[ StyleBox[ FrameBox["1"], Background->GrayLevel[0.500008]], DisplayForm]}, {GridBox[{ { InterpretationBox[GridBox[{ { FrameBox["1"]}, {"\<\"\[DownArrow]\"\>"}, { FrameBox["2"]} }, GridBaseline->{Baseline, {1, 1}}, ColumnAlignments->{Center}], ColumnForm[ { DisplayForm[ FrameBox[ RowBox[ {1}]]], "\[DownArrow]", DisplayForm[ FrameBox[ RowBox[ {2}]]]}, Center], Editable->False], InterpretationBox[GridBox[{ { TagBox[ RowBox[{\(1\/3\), "\[TildeEqual]", TagBox[ InterpretationBox["\<\" 0.333\"\>", 0.33333333333333331, AutoDelete->True], (PaddedForm[ #, {4, 3}]&)]}], DisplayForm]}, { TagBox[ RowBox[{\(2\/9\), "\[TildeEqual]", TagBox[ InterpretationBox["\<\" 0.222\"\>", 0.22222222222222221, AutoDelete->True], (PaddedForm[ #, {4, 3}]&)]}], DisplayForm]} }, RowSpacings->1, ColumnSpacings->3, RowAlignments->Baseline, ColumnAlignments->{Left}], TableForm[ { DisplayForm[ RowBox[ { Rational[ 1, 3], "\[TildeEqual]", PaddedForm[ 0.33333333333333331, {4, 3}]}]], DisplayForm[ RowBox[ { Rational[ 2, 9], "\[TildeEqual]", PaddedForm[ 0.22222222222222221, {4, 3}]}]]}]]} }, RowSpacings->3, ColumnSpacings->1, RowAlignments->Baseline, ColumnAlignments->{Left}], ""} }, RowSpacings->1, ColumnSpacings->1, RowAlignments->Baseline, ColumnAlignments->{Center}], TableForm[ {{{{ ColumnForm[ { DisplayForm[ FrameBox[ RowBox[ {1}]]], "\[DownArrow]", DisplayForm[ FrameBox[ RowBox[ {2}]]]}, Center], TableForm[ { DisplayForm[ RowBox[ { Rational[ 1, 3], "\[TildeEqual]", PaddedForm[ 0.33333333333333331, {4, 3}]}]], DisplayForm[ RowBox[ { Rational[ 2, 9], "\[TildeEqual]", PaddedForm[ 0.22222222222222221, {4, 3}]}]]}]}}}}, TableHeadings -> {{ DisplayForm[ StyleBox[ FrameBox[ RowBox[ {1}]], Background -> GrayLevel[ 0.5]]]}, { DisplayForm[ StyleBox[ FrameBox[ RowBox[ {1}]], Background -> GrayLevel[ 0.5]]]}}, TableSpacing -> {1, 1, 3, 1}]]} }, RowSpacings->3, ColumnSpacings->1, RowAlignments->Baseline, ColumnAlignments->{Left}], TableForm[ { DisplayForm[ StyleBox[ FrameBox[ 1], Background -> GrayLevel[ 0.5]]], TableForm[ {{{{ ColumnForm[ { DisplayForm[ FrameBox[ RowBox[ {1}]]], "\[DownArrow]", DisplayForm[ FrameBox[ RowBox[ {2}]]]}, Center], TableForm[ { DisplayForm[ RowBox[ { Rational[ 1, 3], "\[TildeEqual]", PaddedForm[ 0.33333333333333331, {4, 3}]}]], DisplayForm[ RowBox[ { Rational[ 2, 9], "\[TildeEqual]", PaddedForm[ 0.22222222222222221, {4, 3}]}]]}]}}}}, TableHeadings -> {{ DisplayForm[ StyleBox[ FrameBox[ RowBox[ {1}]], Background -> GrayLevel[ 0.5]]]}, { DisplayForm[ StyleBox[ FrameBox[ RowBox[ {1}]], Background -> GrayLevel[ 0.5]]]}}, TableSpacing -> {1, 1, 3, 1}]}, TableDirections -> Row]]], "Print"], Cell[BoxData[ InterpretationBox[GridBox[{ {"\<\"\"\>", TagBox[ StyleBox[ FrameBox[\(1 1\)], Background->GrayLevel[0.500008]], DisplayForm], TagBox[ StyleBox[ FrameBox[\(2 1\)], Background->GrayLevel[0.500008]], DisplayForm]}, { TagBox[ StyleBox[ FrameBox[\(1 1\)], Background->GrayLevel[0.500008]], DisplayForm], GridBox[{ { InterpretationBox[GridBox[{ { FrameBox[\(1 1\)]}, {"\<\"\[DownArrow]\"\>"}, { FrameBox[\(2 2\)]} }, GridBaseline->{Baseline, {1, 1}}, ColumnAlignments->{Center}], ColumnForm[ { DisplayForm[ FrameBox[ RowBox[ {1, 1}]]], "\[DownArrow]", DisplayForm[ FrameBox[ RowBox[ {2, 2}]]]}, Center], Editable->False], InterpretationBox[GridBox[{ { TagBox[ RowBox[{\(1\/9\), "\[TildeEqual]", TagBox[ InterpretationBox["\<\" 0.111\"\>", 0.1111111111111111, AutoDelete->True], (PaddedForm[ #, {4, 3}]&)]}], DisplayForm]}, { TagBox[ RowBox[{\(4\/81\), "\[TildeEqual]", TagBox[ InterpretationBox["\<\" 0.049\"\>", 0.049382716049382713, AutoDelete->True], (PaddedForm[ #, {4, 3}]&)]}], DisplayForm]}, { TagBox[ RowBox[{\(16\/729\), "\[TildeEqual]", TagBox[ InterpretationBox["\<\" 0.022\"\>", 0.02194787379972565, AutoDelete->True], (PaddedForm[ #, {4, 3}]&)]}], DisplayForm]} }, RowSpacings->1, ColumnSpacings->3, RowAlignments->Baseline, ColumnAlignments->{Left}], TableForm[ { DisplayForm[ RowBox[ { Rational[ 1, 9], "\[TildeEqual]", PaddedForm[ 0.1111111111111111, {4, 3}]}]], DisplayForm[ RowBox[ { Rational[ 4, 81], "\[TildeEqual]", PaddedForm[ 0.049382716049382713, {4, 3}]}]], DisplayForm[ RowBox[ { Rational[ 16, 729], "\[TildeEqual]", PaddedForm[ 0.02194787379972565, {4, 3}]}]]}]]} }, RowSpacings->3, ColumnSpacings->1, RowAlignments->Baseline, ColumnAlignments->{Left}], GridBox[{ { InterpretationBox[GridBox[{ { FrameBox[\(1 1\)]}, {"\<\"\[DownArrow]\"\>"}, { FrameBox[\(2 1\)]} }, GridBaseline->{Baseline, {1, 1}}, ColumnAlignments->{Center}], ColumnForm[ { DisplayForm[ FrameBox[ RowBox[ {1, 1}]]], "\[DownArrow]", DisplayForm[ FrameBox[ RowBox[ {2, 1}]]]}, Center], Editable->False], InterpretationBox[GridBox[{ { TagBox[ RowBox[{\(2\/9\), "\[TildeEqual]", TagBox[ InterpretationBox["\<\" 0.222\"\>", 0.22222222222222221, AutoDelete->True], (PaddedForm[ #, {4, 3}]&)]}], DisplayForm]}, { TagBox[ RowBox[{\(20\/81\), "\[TildeEqual]", TagBox[ InterpretationBox["\<\" 0.247\"\>", 0.24691358024691357, AutoDelete->True], (PaddedForm[ #, {4, 3}]&)]}], DisplayForm]}, { TagBox[ RowBox[{\(152\/729\), "\[TildeEqual]", TagBox[ InterpretationBox["\<\" 0.209\"\>", 0.20850480109739369, AutoDelete->True], (PaddedForm[ #, {4, 3}]&)]}], DisplayForm]} }, RowSpacings->1, ColumnSpacings->3, RowAlignments->Baseline, ColumnAlignments->{Left}], TableForm[ { DisplayForm[ RowBox[ { Rational[ 2, 9], "\[TildeEqual]", PaddedForm[ 0.22222222222222221, {4, 3}]}]], DisplayForm[ RowBox[ { Rational[ 20, 81], "\[TildeEqual]", PaddedForm[ 0.24691358024691357, {4, 3}]}]], DisplayForm[ RowBox[ { Rational[ 152, 729], "\[TildeEqual]", PaddedForm[ 0.20850480109739369, {4, 3}]}]]}]]}, { InterpretationBox[GridBox[{ { FrameBox[\(1 1\)]}, {"\<\"\[DownArrow]\"\>"}, { FrameBox[\(3 2\)]} }, GridBaseline->{Baseline, {1, 1}}, ColumnAlignments->{Center}], ColumnForm[ { DisplayForm[ FrameBox[ RowBox[ {1, 1}]]], "\[DownArrow]", DisplayForm[ FrameBox[ RowBox[ {3, 2}]]]}, Center], Editable->False], InterpretationBox[GridBox[{ { TagBox[ RowBox[{\(2\/9\), "\[TildeEqual]", TagBox[ InterpretationBox["\<\" 0.222\"\>", 0.22222222222222221, AutoDelete->True], (PaddedForm[ #, {4, 3}]&)]}], DisplayForm]}, { TagBox[ RowBox[{\(8\/81\), "\[TildeEqual]", TagBox[ InterpretationBox["\<\" 0.099\"\>", 0.098765432098765427, AutoDelete->True], (PaddedForm[ #, {4, 3}]&)]}], DisplayForm]}, { TagBox[ RowBox[{\(32\/729\), "\[TildeEqual]", TagBox[ InterpretationBox["\<\" 0.044\"\>", 0.0438957475994513, AutoDelete->True], (PaddedForm[ #, {4, 3}]&)]}], DisplayForm]} }, RowSpacings->1, ColumnSpacings->3, RowAlignments->Baseline, ColumnAlignments->{Left}], TableForm[ { DisplayForm[ RowBox[ { Rational[ 2, 9], "\[TildeEqual]", PaddedForm[ 0.22222222222222221, {4, 3}]}]], DisplayForm[ RowBox[ { Rational[ 8, 81], "\[TildeEqual]", PaddedForm[ 0.098765432098765427, {4, 3}]}]], DisplayForm[ RowBox[ { Rational[ 32, 729], "\[TildeEqual]", PaddedForm[ 0.0438957475994513, {4, 3}]}]]}]]} }, RowSpacings->3, ColumnSpacings->1, RowAlignments->Baseline, ColumnAlignments->{Left}]} }, RowSpacings->1, ColumnSpacings->1, RowAlignments->Baseline, ColumnAlignments->{Center}], TableForm[ {{{{ ColumnForm[ { DisplayForm[ FrameBox[ RowBox[ {1, 1}]]], "\[DownArrow]", DisplayForm[ FrameBox[ RowBox[ {2, 2}]]]}, Center], TableForm[ { DisplayForm[ RowBox[ { Rational[ 1, 9], "\[TildeEqual]", PaddedForm[ 0.1111111111111111, {4, 3}]}]], DisplayForm[ RowBox[ { Rational[ 4, 81], "\[TildeEqual]", PaddedForm[ 0.049382716049382713, {4, 3}]}]], DisplayForm[ RowBox[ { Rational[ 16, 729], "\[TildeEqual]", PaddedForm[ 0.02194787379972565, {4, 3}]}]]}]}}, {{ ColumnForm[ { DisplayForm[ FrameBox[ RowBox[ {1, 1}]]], "\[DownArrow]", DisplayForm[ FrameBox[ RowBox[ {2, 1}]]]}, Center], TableForm[ { DisplayForm[ RowBox[ { Rational[ 2, 9], "\[TildeEqual]", PaddedForm[ 0.22222222222222221, {4, 3}]}]], DisplayForm[ RowBox[ { Rational[ 20, 81], "\[TildeEqual]", PaddedForm[ 0.24691358024691357, {4, 3}]}]], DisplayForm[ RowBox[ { Rational[ 152, 729], "\[TildeEqual]", PaddedForm[ 0.20850480109739369, {4, 3}]}]]}]}, { ColumnForm[ { DisplayForm[ FrameBox[ RowBox[ {1, 1}]]], "\[DownArrow]", DisplayForm[ FrameBox[ RowBox[ {3, 2}]]]}, Center], TableForm[ { DisplayForm[ RowBox[ { Rational[ 2, 9], "\[TildeEqual]", PaddedForm[ 0.22222222222222221, {4, 3}]}]], DisplayForm[ RowBox[ { Rational[ 8, 81], "\[TildeEqual]", PaddedForm[ 0.098765432098765427, {4, 3}]}]], DisplayForm[ RowBox[ { Rational[ 32, 729], "\[TildeEqual]", PaddedForm[ 0.0438957475994513, {4, 3}]}]]}]}}}}, TableHeadings -> {{ DisplayForm[ StyleBox[ FrameBox[ RowBox[ {1, 1}]], Background -> GrayLevel[ 0.5]]]}, { DisplayForm[ StyleBox[ FrameBox[ RowBox[ {1, 1}]], Background -> GrayLevel[ 0.5]]], DisplayForm[ StyleBox[ FrameBox[ RowBox[ {2, 1}]], Background -> GrayLevel[ 0.5]]]}}, TableSpacing -> {1, 1, 3, 1}]]], "Print"], Cell[BoxData[ InterpretationBox[GridBox[{ {"\<\"\"\>", TagBox[ StyleBox[ FrameBox[\(1 1\)], Background->GrayLevel[0.500008]], DisplayForm], TagBox[ StyleBox[ FrameBox[\(2 1\)], Background->GrayLevel[0.500008]], DisplayForm]}, { TagBox[ StyleBox[ FrameBox[\(2 1\)], Background->GrayLevel[0.500008]], DisplayForm], GridBox[{ { InterpretationBox[GridBox[{ { FrameBox[\(2 1\)]}, {"\<\"\[DownArrow]\"\>"}, { FrameBox[\(1 1\)]} }, GridBaseline->{Baseline, {1, 1}}, ColumnAlignments->{Center}], ColumnForm[ { DisplayForm[ FrameBox[ RowBox[ {2, 1}]]], "\[DownArrow]", DisplayForm[ FrameBox[ RowBox[ {1, 1}]]]}, Center], Editable->False], InterpretationBox[GridBox[{ { TagBox[ RowBox[{\(1\/9\), "\[TildeEqual]", TagBox[ InterpretationBox["\<\" 0.111\"\>", 0.1111111111111111, AutoDelete->True], (PaddedForm[ #, {4, 3}]&)]}], DisplayForm]}, { TagBox[ RowBox[{\(10\/81\), "\[TildeEqual]", TagBox[ InterpretationBox["\<\" 0.123\"\>", 0.12345679012345678, AutoDelete->True], (PaddedForm[ #, {4, 3}]&)]}], DisplayForm]}, { TagBox[ RowBox[{\(64\/729\), "\[TildeEqual]", TagBox[ InterpretationBox["\<\" 0.088\"\>", 0.0877914951989026, AutoDelete->True], (PaddedForm[ #, {4, 3}]&)]}], DisplayForm]} }, RowSpacings->1, ColumnSpacings->3, RowAlignments->Baseline, ColumnAlignments->{Left}], TableForm[ { DisplayForm[ RowBox[ { Rational[ 1, 9], "\[TildeEqual]", PaddedForm[ 0.1111111111111111, {4, 3}]}]], DisplayForm[ RowBox[ { Rational[ 10, 81], "\[TildeEqual]", PaddedForm[ 0.12345679012345678, {4, 3}]}]], DisplayForm[ RowBox[ { Rational[ 64, 729], "\[TildeEqual]", PaddedForm[ 0.0877914951989026, {4, 3}]}]]}]]}, { InterpretationBox[GridBox[{ { FrameBox[\(2 1\)]}, {"\<\"\[DownArrow]\"\>"}, { FrameBox[\(3 3\)]} }, GridBaseline->{Baseline, {1, 1}}, ColumnAlignments->{Center}], ColumnForm[ { DisplayForm[ FrameBox[ RowBox[ {2, 1}]]], "\[DownArrow]", DisplayForm[ FrameBox[ RowBox[ {3, 3}]]]}, Center], Editable->False], InterpretationBox[GridBox[{ { TagBox[ RowBox[{\(1\/9\), "\[TildeEqual]", TagBox[ InterpretationBox["\<\" 0.111\"\>", 0.1111111111111111, AutoDelete->True], (PaddedForm[ #, {4, 3}]&)]}], DisplayForm]}, { TagBox[ RowBox[{\(1\/81\), "\[TildeEqual]", TagBox[ InterpretationBox["\<\" 0.012\"\>", 0.012345679012345678, AutoDelete->True], (PaddedForm[ #, {4, 3}]&)]}], DisplayForm]}, { TagBox[ RowBox[{\(1\/729\), "\[TildeEqual]", TagBox[ InterpretationBox["\<\" 0.001\"\>", 0.0013717421124828531, AutoDelete->True], (PaddedForm[ #, {4, 3}]&)]}], DisplayForm]} }, RowSpacings->1, ColumnSpacings->3, RowAlignments->Baseline, ColumnAlignments->{Left}], TableForm[ { DisplayForm[ RowBox[ { Rational[ 1, 9], "\[TildeEqual]", PaddedForm[ 0.1111111111111111, {4, 3}]}]], DisplayForm[ RowBox[ { Rational[ 1, 81], "\[TildeEqual]", PaddedForm[ 0.012345679012345678, {4, 3}]}]], DisplayForm[ RowBox[ { Rational[ 1, 729], "\[TildeEqual]", PaddedForm[ 0.0013717421124828531, {4, 3}]}]]}]]} }, RowSpacings->3, ColumnSpacings->1, RowAlignments->Baseline, ColumnAlignments->{Left}], GridBox[{ { InterpretationBox[GridBox[{ { FrameBox[\(2 1\)]}, {"\<\"\[DownArrow]\"\>"}, { FrameBox[\(3 1\)]} }, GridBaseline->{Baseline, {1, 1}}, ColumnAlignments->{Center}], ColumnForm[ { DisplayForm[ FrameBox[ RowBox[ {2, 1}]]], "\[DownArrow]", DisplayForm[ FrameBox[ RowBox[ {3, 1}]]]}, Center], Editable->False], InterpretationBox[GridBox[{ { TagBox[ RowBox[{\(2\/9\), "\[TildeEqual]", TagBox[ InterpretationBox["\<\" 0.222\"\>", 0.22222222222222221, AutoDelete->True], (PaddedForm[ #, {4, 3}]&)]}], DisplayForm]}, { TagBox[ RowBox[{\(11\/81\), "\[TildeEqual]", TagBox[ InterpretationBox["\<\" 0.136\"\>", 0.13580246913580246, AutoDelete->True], (PaddedForm[ #, {4, 3}]&)]}], DisplayForm]}, { TagBox[ RowBox[{\(65\/729\), "\[TildeEqual]", TagBox[ InterpretationBox["\<\" 0.089\"\>", 0.089163237311385465, AutoDelete->True], (PaddedForm[ #, {4, 3}]&)]}], DisplayForm]} }, RowSpacings->1, ColumnSpacings->3, RowAlignments->Baseline, ColumnAlignments->{Left}], TableForm[ { DisplayForm[ RowBox[ { Rational[ 2, 9], "\[TildeEqual]", PaddedForm[ 0.22222222222222221, {4, 3}]}]], DisplayForm[ RowBox[ { Rational[ 11, 81], "\[TildeEqual]", PaddedForm[ 0.13580246913580246, {4, 3}]}]], DisplayForm[ RowBox[ { Rational[ 65, 729], "\[TildeEqual]", PaddedForm[ 0.089163237311385465, {4, 3}]}]]}]]} }, RowSpacings->3, ColumnSpacings->1, RowAlignments->Baseline, ColumnAlignments->{Left}]} }, RowSpacings->1, ColumnSpacings->1, RowAlignments->Baseline, ColumnAlignments->{Center}], TableForm[ {{{{ ColumnForm[ { DisplayForm[ FrameBox[ RowBox[ {2, 1}]]], "\[DownArrow]", DisplayForm[ FrameBox[ RowBox[ {1, 1}]]]}, Center], TableForm[ { DisplayForm[ RowBox[ { Rational[ 1, 9], "\[TildeEqual]", PaddedForm[ 0.1111111111111111, {4, 3}]}]], DisplayForm[ RowBox[ { Rational[ 10, 81], "\[TildeEqual]", PaddedForm[ 0.12345679012345678, {4, 3}]}]], DisplayForm[ RowBox[ { Rational[ 64, 729], "\[TildeEqual]", PaddedForm[ 0.0877914951989026, {4, 3}]}]]}]}, { ColumnForm[ { DisplayForm[ FrameBox[ RowBox[ {2, 1}]]], "\[DownArrow]", DisplayForm[ FrameBox[ RowBox[ {3, 3}]]]}, Center], TableForm[ { DisplayForm[ RowBox[ { Rational[ 1, 9], "\[TildeEqual]", PaddedForm[ 0.1111111111111111, {4, 3}]}]], DisplayForm[ RowBox[ { Rational[ 1, 81], "\[TildeEqual]", PaddedForm[ 0.012345679012345678, {4, 3}]}]], DisplayForm[ RowBox[ { Rational[ 1, 729], "\[TildeEqual]", PaddedForm[ 0.0013717421124828531, {4, 3}]}]]}]}}, {{ ColumnForm[ { DisplayForm[ FrameBox[ RowBox[ {2, 1}]]], "\[DownArrow]", DisplayForm[ FrameBox[ RowBox[ {3, 1}]]]}, Center], TableForm[ { DisplayForm[ RowBox[ { Rational[ 2, 9], "\[TildeEqual]", PaddedForm[ 0.22222222222222221, {4, 3}]}]], DisplayForm[ RowBox[ { Rational[ 11, 81], "\[TildeEqual]", PaddedForm[ 0.13580246913580246, {4, 3}]}]], DisplayForm[ RowBox[ { Rational[ 65, 729], "\[TildeEqual]", PaddedForm[ 0.089163237311385465, {4, 3}]}]]}]}}}}, TableHeadings -> {{ DisplayForm[ StyleBox[ FrameBox[ RowBox[ {2, 1}]], Background -> GrayLevel[ 0.5]]]}, { DisplayForm[ StyleBox[ FrameBox[ RowBox[ {1, 1}]], Background -> GrayLevel[ 0.5]]], DisplayForm[ StyleBox[ FrameBox[ RowBox[ {2, 1}]], Background -> GrayLevel[ 0.5]]]}}, TableSpacing -> {1, 1, 3, 1}]]], "Print"], Cell[BoxData[ \("Next player's failure probabilities"\)], "Print"], Cell[BoxData[ InterpretationBox[GridBox[{ { TagBox[ StyleBox[ FrameBox["1"], Background->GrayLevel[0.500008]], DisplayForm], InterpretationBox[GridBox[{ {"\<\"\"\>", TagBox[ StyleBox[ FrameBox["1"], Background->GrayLevel[0.500008]], DisplayForm]}, {GridBox[{ { InterpretationBox[GridBox[{ { FrameBox["1"]}, {"\<\"\[DownArrow]\"\>"}, { FrameBox["2"]} }, GridBaseline->{Baseline, {1, 1}}, ColumnAlignments->{Center}], ColumnForm[ { DisplayForm[ FrameBox[ RowBox[ {1}]]], "\[DownArrow]", DisplayForm[ FrameBox[ RowBox[ {2}]]]}, Center], Editable->False], InterpretationBox[GridBox[{ { TagBox[ RowBox[{\(1\/3\), "\[TildeEqual]", TagBox[ InterpretationBox["\<\" 0.333\"\>", 0.33333333333333331, AutoDelete->True], (PaddedForm[ #, {4, 3}]&)]}], DisplayForm]}, { TagBox[ RowBox[{\(1\/3\), "\[TildeEqual]", TagBox[ InterpretationBox["\<\" 0.333\"\>", 0.33333333333333331, AutoDelete->True], (Pad