(************** 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[ 28273, 707]*) (*NotebookOutlinePosition[ 29001, 732]*) (* CellTagsIndexPosition[ 28957, 728]*) (*WindowFrame->Normal*) Notebook[{ Cell[BoxData[{\(<< Statistics`DiscreteDistributions`\), "\[IndentingNewLine]", RowBox[{"<<", StyleBox[ RowBox[{"LinearAlgebra", StyleBox["`", "MB"], "MatrixManipulation", StyleBox["`", "MB"]}]]}]}], "Input"], Cell[CellGroupData[{ Cell["Laboriously", "Subsection"], Cell[CellGroupData[{ Cell["Enumerate all end-states", "Subsubsection"], Cell[TextData[{ "This recursively generates all the possible numbers of each item we could \ find in ", Cell[BoxData[ \(TraditionalForm\`d\)]], " days" }], "Text"], Cell[BoxData[{ \(\(ddRec[days_, 1] := {{days}};\)\), "\[IndentingNewLine]", \(\(ddRec[0, \ item_] := \ {Array[0 &, item]};\)\), "\[IndentingNewLine]", \(\(ddRec[days_, \ item_] := \ Table[\(Prepend[#, i] &\) /@ ddRec[days - i, item - 1], \ {i, \ 0, \ days}] // Flatten[#, 1] &;\)\), "\[IndentingNewLine]", \(\(ddChances[crit_, days_, items_] := Module[{keysAll, \ keysWin, keysAllN, keysWinN}, \[IndentingNewLine]keysAll\ = \ \(Flatten[{#, \ \ "\", Multinomial @@ #}, 1] &\) /@ ddRec[days, items]; \[IndentingNewLine]keysWin\ = \ Select[keysAll, \ crit]; \[IndentingNewLine]keysAllN\ = \ Plus @@ keysAll[\([All, \ items + 2]\)]; \[IndentingNewLine]keysWinN\ = Plus @@ keysWin[\([All, \ items + 2]\)]; \[IndentingNewLine]return = {keysAll, keysWin, keysWinN, keysAllN - \ keysWinN, keysAllN, \[IndentingNewLine]keysWinN\/keysAllN, keysWinN\/keysAllN // N, Length[keysAll]}];\)\)}], "Input"], Cell[CellGroupData[{ Cell[BoxData[ \(ddRec[3, 4]\)], "Input"], Cell[BoxData[ FormBox[ RowBox[{"(", "\[NoBreak]", GridBox[{ {"0", "0", "0", "3"}, {"0", "0", "1", "2"}, {"0", "0", "2", "1"}, {"0", "0", "3", "0"}, {"0", "1", "0", "2"}, {"0", "1", "1", "1"}, {"0", "1", "2", "0"}, {"0", "2", "0", "1"}, {"0", "2", "1", "0"}, {"0", "3", "0", "0"}, {"1", "0", "0", "2"}, {"1", "0", "1", "1"}, {"1", "0", "2", "0"}, {"1", "1", "0", "1"}, {"1", "1", "1", "0"}, {"1", "2", "0", "0"}, {"2", "0", "0", "1"}, {"2", "0", "1", "0"}, {"2", "1", "0", "0"}, {"3", "0", "0", "0"} }, ColumnAlignments->{Decimal}], "\[NoBreak]", ")"}], TraditionalForm]], "Output"] }, Open ]] }, Open ]], Cell[CellGroupData[{ Cell[TextData[{ "Probability of finding ", Cell[BoxData[ \(TraditionalForm\`f\)]], " of a single item" }], "Subsubsection"], Cell[CellGroupData[{ Cell[BoxData[{ RowBox[{ RowBox[{ RowBox[{"Ch", "[", GridBox[{ {"n_"}, {"k_"} }], "]"}], ":=", \(Binomial[n, k]\)}], ";"}], "\[IndentingNewLine]", RowBox[{ RowBox[{\(g[f_, d_, i_]\), ":=", RowBox[{ RowBox[{"Ch", "[", GridBox[{ {"d"}, {"f"} }], "]"}], \(\((1\/i)\)\^f\), \(\((1 - 1\/i)\)\^\(d - f\)\)}]}], "\[IndentingNewLine]"}], "\[IndentingNewLine]", \(W[d_, i_] := \ \((1 - 1\/i)\)\^d\), "\[IndentingNewLine]", \(W[d, i] W[d, i - 1] // Simplify\)}], "Input"], Cell[BoxData[ \(TraditionalForm\`\((\(i - 2\)\/i)\)\^d\)], "Output"] }, Open ]] }, Open ]], Cell[CellGroupData[{ Cell["Compare formulas", "Subsubsection"], Cell[CellGroupData[{ Cell[BoxData[{ \(\(have2Q[ keys_] := \((\((keys[\([1]\)] == \ 0)\)\ || \((keys[\([2]\)] \[Equal] 0)\))\);\)\), "\[IndentingNewLine]", \(\(have3Q[ keys_] := \((\((keys[\([1]\)] == \ 0)\)\ || \((keys[\([2]\)] \[Equal] 0)\) || \((keys[\([3]\)] \[Equal] 0)\))\);\)\), "\[IndentingNewLine]", \(With[{i = 6}, Table[Flatten[{\[IndentingNewLine]2 g[0, d, i] - g[0, d, i] g[0, d, i - 1], \[IndentingNewLine]\(2\ \((i - 1)\)\^d - \ \((i - \ 2)\)\^d\)\/\(\(\ \)\(i\^d\)\), \[IndentingNewLine]1 - Sum[g[f1, d, i] g[f2, d - f1, i - 1], {f1, 1, d}, {f2, 1, d - f1}], \[IndentingNewLine]\((g[0, d, i] + Sum[g[f1, d, i] \((g[0, d - f1, i - 1])\), {f1, 1, d}])\), \[IndentingNewLine]\(ddChances[have2Q, d, i]\)[\([{6, 7}]\)]}, \[IndentingNewLine]1], {d, \ 1, \ 5}]]\), "\[IndentingNewLine]", \(With[{i = 6}, \[IndentingNewLine]Table[ Flatten[{\[IndentingNewLine]3 g[0, d, i] - 3 g[0, d, i] g[0, d, i - 1] + g[0, d, i] g[0, d, i - 1] g[0, d, i - 2], \[IndentingNewLine]\(\(3\ \((i - 1)\)\^d\)\(-\)\(3\ \ \((i - 2)\)\^d\)\(+\)\(\((i - 3)\)\^d\)\(\ \)\)\/\(\(\ \)\(i\^d\)\), \ \[IndentingNewLine]1 - Sum[g[f1, d, i] g[f2, d - f1, i - 1] g[f3, d - f2 - f1, i - 2], {f1, 1, d}, {f2, 1, d - f1}, {f3, 1, d - f2 - f1}], \[IndentingNewLine]\((g[0, d, i] + \[IndentingNewLine]Sum[\ \ g[f1, d, i] \((\[IndentingNewLine]g[0, d - f1, i - 1] + Sum[g[f2, d - f1, i - 1] g[0, d - \((f1 + f2)\), i - 2], {f2, 1, d - f1}])\), {f1, 1, d}])\), \[IndentingNewLine]\(ddChances[have3Q, d, i]\)[\([{6, 7, 5, 4}]\)]}, \[IndentingNewLine]1], {d, \ 1, \ 8}]]\)}], "Input"], Cell[BoxData[ FormBox[ RowBox[{"(", "\[NoBreak]", GridBox[{ {"1", "1", "1", "1", "1", "1.`"}, {\(17\/18\), \(17\/18\), \(17\/18\), \(17\/18\), \(17\/18\), "0.9444444444444444`"}, {\(31\/36\), \(31\/36\), \(31\/36\), \(31\/36\), \(31\/36\), "0.8611111111111112`"}, {\(497\/648\), \(497\/648\), \(497\/648\), \(497\/648\), \ \(497\/648\), "0.7669753086419753`"}, {\(871\/1296\), \(871\/1296\), \(871\/1296\), \(871\/1296\), \ \(871\/1296\), "0.6720679012345679`"} }, ColumnAlignments->{Decimal}], "\[NoBreak]", ")"}], TraditionalForm]], "Output"], Cell[BoxData[ FormBox[ RowBox[{"(", "\[NoBreak]", GridBox[{ {"1", "1", "1", "1", "1", "1.`", "0", "6"}, {"1", "1", "1", "1", "1", "1.`", "0", "36"}, {\(35\/36\), \(35\/36\), \(35\/36\), \(35\/36\), \(35\/36\), "0.9722222222222222`", "6", "216"}, {\(11\/12\), \(11\/12\), \(11\/12\), \(11\/12\), \(11\/12\), "0.9166666666666666`", "108", "1296"}, {\(1091\/1296\), \(1091\/1296\), \(1091\/1296\), \(1091\/1296\), \ \(1091\/1296\), "0.841820987654321`", "1230", "7776"}, {\(109\/144\), \(109\/144\), \(109\/144\), \(109\/144\), \ \(109\/144\), "0.7569444444444444`", "11340", "46656"}, {\(31235\/46656\), \(31235\/46656\), \(31235\/46656\), \ \(31235\/46656\), \(31235\/46656\), "0.669474451303155`", "92526", "279936"}, {\(9091\/15552\), \(9091\/15552\), \(9091\/15552\), \(9091\/15552\ \), \(9091\/15552\), "0.5845550411522634`", "697788", "1679616"} }, ColumnAlignments->{Decimal}], "\[NoBreak]", ")"}], TraditionalForm]], "Output"] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[ \(Table[\ {d, 100 \(\( 3\ \((i - 1)\)\^d\)\(-\)\(3\ \((i - 2)\)\^d\)\(+\)\(\((i \ - 3)\)\^d\)\(\ \)\)\/\(\(\ \)\(i\^d\)\), 100 \((1 - \ \(\(3\ \((i - 1)\)\^d\)\(-\)\(3\ \((i - 2)\)\^d\)\(+\ \)\(\((i - 3)\)\^d\)\(\ \)\)\/\(\(\ \)\(i\^d\)\))\)} /. i \[Rule] 6. , {d, 15}] // NumberForm[#, 2] &\)], "Input"], Cell[BoxData[ FormBox[ RowBox[{\(NumberForm::"sigz"\), \(\(:\)\(\ \)\), "\<\"In addition to \ the number of digits requested, one or more zeros will appear as \ placeholders. \\!\\(\\*ButtonBox[\\\"More\[Ellipsis]\\\", \ ButtonStyle->\\\"RefGuideLinkText\\\", ButtonFrame->None, \ ButtonData:>\\\"NumberForm::sigz\\\"]\\)\"\>"}], TraditionalForm]], "Message"], Cell[BoxData[ FormBox[ RowBox[{\(NumberForm::"sigz"\), \(\(:\)\(\ \)\), "\<\"In addition to \ the number of digits requested, one or more zeros will appear as \ placeholders. \\!\\(\\*ButtonBox[\\\"More\[Ellipsis]\\\", \ ButtonStyle->\\\"RefGuideLinkText\\\", ButtonFrame->None, \ ButtonData:>\\\"NumberForm::sigz\\\"]\\)\"\>"}], TraditionalForm]], "Message"], Cell[BoxData[ FormBox[ TagBox[ RowBox[{"(", "\[NoBreak]", GridBox[{ {"\<\"1\"\>", "\<\"100.\"\>", "\<\"0.\"\>"}, {"\<\"2\"\>", "\<\"100.\"\>", "\<\"0.\"\>"}, {"\<\"3\"\>", "\<\"97.\"\>", "\<\"2.8\"\>"}, {"\<\"4\"\>", "\<\"92.\"\>", "\<\"8.3\"\>"}, {"\<\"5\"\>", "\<\"84.\"\>", "\<\"16.\"\>"}, {"\<\"6\"\>", "\<\"76.\"\>", "\<\"24.\"\>"}, {"\<\"7\"\>", "\<\"67.\"\>", "\<\"33.\"\>"}, {"\<\"8\"\>", "\<\"58.\"\>", "\<\"42.\"\>"}, {"\<\"9\"\>", "\<\"51.\"\>", "\<\"49.\"\>"}, {"\<\"10\"\>", "\<\"43.\"\>", "\<\"57.\"\>"}, {"\<\"11\"\>", "\<\"37.\"\>", "\<\"63.\"\>"}, {"\<\"12\"\>", "\<\"31.\"\>", "\<\"69.\"\>"}, {"\<\"13\"\>", "\<\"27.\"\>", "\<\"73.\"\>"}, {"\<\"14\"\>", "\<\"22.\"\>", "\<\"78.\"\>"}, {"\<\"15\"\>", "\<\"19.\"\>", "\<\"81.\"\>"} }, ColumnAlignments->{Decimal}], "\[NoBreak]", ")"}], (NumberForm[ #, 2]&)], TraditionalForm]], "Output"] }, Open ]] }, Open ]] }, Open ]], Cell[CellGroupData[{ Cell["Symbolically", "Subsection"], Cell[TextData[{ Cell[BoxData[ \(TraditionalForm\`P(B\&_\ or\ J\&_\ or\ S\&_)\ = \ P(B\&_\ or\ J\&_)\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ + \ P(S\&_)\ - P(\((B\&_\ or\ J\&_)\)\ \[Wedge]S\&_)\)]], "\n", Cell[BoxData[ \(TraditionalForm\`P(B\&_\ or\ J\&_\ or\ S\&_)\ = \ P(B\&_) + P(J\&_) - P(B\&_\[Wedge]J\&_)\ \ \ \ \ \ \ \ \ \ \ + \ P(S\&_)\ - P(\((B\&_\ or\ J\&_)\)\ \ \[Wedge]S\&_)\)]], "\n", Cell[BoxData[ \(TraditionalForm\`P(B\&_\ or\ J\&_\ or\ S\&_)\ = \ P(B\&_) + P(J\&_) - \(P(B\&_)\) \(P(J\&_ | B\&_)\)\ + \ P(S\&_)\ - P(S\&_\[Wedge]\((B\&_\ or\ J\&_)\)\ \ )\)]], "\n", Cell[BoxData[ \(TraditionalForm\`P(B\&_\ or\ J\&_\ or\ S\&_)\ = \ P(B\&_) + P(J\&_) - \(P(B\&_)\) \(P(J\&_ | B\&_)\)\ + \ P(S\&_)\ - \(P(S\&_)\) \(P(\((B\&_\ or\ J\&_)\)\ | C)\)\)]], "\n", Cell[BoxData[ \(TraditionalForm\`P(B\&_\ or\ J\&_\ or\ S\&_)\ = \ P(B\&_) + P(J\&_) + \ P(S\&_)\ - \(P(B\&_)\) \(P(J\&_ | B\&_)\)\ - \(P( S\&_)\) \((P(B\&_ | C) + P(J\&_ | S\&_) - P(B\&_\[VeryThinSpace]J\&_ | S\&_))\)\)]], "\n", Cell[BoxData[ \(TraditionalForm\`P(B\&_\ or\ J\&_\ or\ S\&_)\ = \ P(B\&_) + P(J\&_) + \ P(S\&_)\ - \(P(B\&_)\) \(P(J\&_ | B\&_)\)\ - \(P(S\&_)\) \(P( B\&_ | C)\) - \(P(S\&_)\) \(P(J\&_ | S\&_)\) + P(B\&_\[VeryThinSpace]J\&_\[VeryThinSpace]S\&_)\)]] }], "Text"] }, Open ]], Cell[CellGroupData[{ Cell["Day by Day", "Subsection"], Cell[TextData[{ Cell[BoxData[ \(TraditionalForm\`P(0) + \ P(1) + P(2)\)]], "\n\n", Cell[BoxData[ \(TraditionalForm\`P\_0\%d = \[Product]\+\(i = 1\)\%d P\_0\)]], "\n", Cell[BoxData[ \(TraditionalForm\`P\_1\%d = \[Sum]\+\(a = 1\)\%d\(\( P\_0\%\(a - 1\)\)( 1 - P\_0)\) P\_1\%\(a - 1\)\)]] }], "Text"], Cell[BoxData[ RowBox[{\(p[f_, d_, pk_]\), ":=", " ", RowBox[{ RowBox[{"Ch", "[", GridBox[{ {"d"}, {"f"} }], "]"}], \(pk\^f\), \(\((1 - pk)\)\^\(d - f\)\)}]}]], "Input"] }, Open ]], Cell[CellGroupData[{ Cell["Data", "Subsection"], Cell[CellGroupData[{ Cell["Message from Theophrastus", "Subsubsection"], Cell["\<\ Hi Dirk- Here is a summary of the results of DD adventuring and zapping of DD, Room 10 \ items since I started using KoLMafia during ascension 4. They are listed in \ the order of occurance. You can see I have never zapped and obtained a key \ that I had, but rumor has it that Jick has confirmed that is impossible. I can't say for sure whether Ascension 4 is complete, since the logs start at \ day 9, turn 663 (out of 18 days, 2122 turns). I suppose that makes the info \ pretty much worthless, but make of it what you will. I am fairly sure that \ all trips to the dungeon were logged for that run as well. The abbreviations \ should be self-explanatory, but for the sake of completeness, here they are: SPBS - Sneaky Pete's Breath Spray; BR - Boris's Ring; JE - Jarlsberg's \ Earring; SK/BK/JK, the three keys. Hope this helps. -theo Asc. Results 4 SPBS JE BR JK JE BK [zapped non-key for SK] 5 SK BK BK SK JE JE [zapped non-key for JK] 6 SPBS BK BR BK [zapped non-key for SK] [zapped non-key for JK] 7 JK JE SPBS SK BK 8 JK JE JK BK SK 9 JK BK SPBS SK 10 SK JE BR JE BK SPBS SK [zapped non-key for JK] 11 BK SK BK JK 12 BK JK SPBS SPBS SK 13 JK JK SPBS SK SK [zapped non-key for BK] 14 SK JK BK 15 SK JK BR JK JE [zapped non-key for BK] 16 SK SPBS SPBS [zapped non-key for JK] [zapped key for BK] 17 SK JK BK 18 JE JK [zapped non-key for SK] SK [zapped 1 of 2 SK for BK] 19 SK BK [zapped key for JK]\ \>", "Text"] }, Open ]], Cell[CellGroupData[{ Cell["Data", "Subsubsection"], Cell[BoxData[ \(\(\( (*\ Note : \ Removed\ first\ run\ that\ Theo\ indicated\ as\ suspect\ *) \)\ \(\[IndentingNewLine]\)\(\(keyseq[ Theo] = \[IndentingNewLine]{{K\_s, K\_b, K\_b, K\_s, W\_j, W\_j, Zap[W\__, K\_j]}, \[IndentingNewLine]{W\_s, K\_b, W\_b, K\_b, Zap[W\__, K\_s], Zap[W\__, K\_j]}, \[IndentingNewLine]{K\_j, W\_j, W\_s, K\_s, K\_b}, \[IndentingNewLine]{K\_j, W\_j, K\_j, K\_b, K\_s}, \[IndentingNewLine]{K\_j, K\_b, W\_s, K\_s}, \[IndentingNewLine]{K\_s, W\_j, W\_b, W\_j, K\_b, W\_s, K\_s, Zap[W\__, K\_j]}, \[IndentingNewLine]{K\_b, K\_s, K\_b, K\_j}, \[IndentingNewLine]{K\_b, K\_j, W\_s, W\_s, K\_s}, \[IndentingNewLine]{K\_j, K\_j, W\_s, K\_s, K\_s, Zap[W\__, K\_b]}, \[IndentingNewLine]{K\_s, K\_j, K\_b}, \[IndentingNewLine]{K\_s, K\_j, W\_b, K\_j, W\_j, Zap[W\__, K\_b]}, \[IndentingNewLine]{K\_s, W\_s, W\_s, Zap[W\__, J\_k], Zap[K\__, K\_b]}, \[IndentingNewLine]{K\_s, K\_j, K\_b}, \[IndentingNewLine]{W\_j, K\_j, Zap[W\__, K\_s], K\_s, Zap[K\_s, K\_b]}, \[IndentingNewLine]{K\_s, K\_b, Zap[K\__, K\_j]}};\)\[IndentingNewLine] AllFlat[id_]\ \ \ \ \ := Flatten[keyseq[id]]\[IndentingNewLine] \(ZapsFlat[id_]\ \ \ := Cases[AllFlat[id], Zap[_\__, _\__]];\)\[IndentingNewLine] \(ItemsFlat[id_]\ := Cases[AllFlat[id], _\__];\)\[IndentingNewLine] \(Keys[data_] := Cases[data, K\__];\)\[IndentingNewLine] \(Junk[data_] := Cases[data, W\__];\)\)\)\)], "Input"], Cell[CellGroupData[{ Cell[BoxData[{ \(Length /@ {AllFlat[Theo], ZapsFlat[Theo], ItemsFlat[Theo]}\), "\[IndentingNewLine]", \({n\_items, n\_keys, n\_junk, f\_keys} = {ItemsFlat[Theo] // Length, \[IndentingNewLine]Keys[AllFlat[Theo]] // Length, Junk[AllFlat[Theo]] // Length, 100. \ Length[Keys[AllFlat[Theo]]]\/Length[ItemsFlat[Theo]]}\)}], \ "Input"], Cell[BoxData[ \(TraditionalForm\`{75, 11, 64}\)], "Output"], Cell[BoxData[ \(TraditionalForm\`{64, 44, 20, 68.75`}\)], "Output"] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[{ \(cond[had_, Zap[a_, b_]] := Module[{flhad = Flatten[had]}, \[IndentingNewLine]{ReplacePart[flhad, b, First[Position[flhad, a, 2]]], {}}]\), "\[IndentingNewLine]", \(cond[had_, got_] := {Flatten[had, 1], got}\), "\[IndentingNewLine]", \(KeyStateMapper[keyseq_] := \(Rest[FoldList[cond, \ {{}, {}}, #]] &\) /@ keyseq\), "\[IndentingNewLine]", \(\(foundItems[keyseq_] := DeleteCases[ Flatten[KeyStateMapper[keyseq], 1], \ {_, {}}];\)\[IndentingNewLine]\), "\[IndentingNewLine]", \({KeyStateMapper[keyseq[Theo]], \[IndentingNewLine]keyseq[Theo]} // Transpose\)}], "Input"], Cell[BoxData[ FormBox[ RowBox[{"(", "\[NoBreak]", GridBox[{ { RowBox[{"(", "\[NoBreak]", GridBox[{ {\({}\), \(K\_s\)}, {\({K\_s}\), \(K\_b\)}, {\({K\_s, K\_b}\), \(K\_b\)}, {\({K\_s, K\_b, K\_b}\), \(K\_s\)}, {\({K\_s, K\_b, K\_b, K\_s}\), \(W\_j\)}, {\({K\_s, K\_b, K\_b, K\_s, W\_j}\), \(W\_j\)}, {\({K\_s, K\_b, K\_b, K\_s, K\_j, W\_j}\), \({}\)} }], "\[NoBreak]", ")"}], \({K\_s, K\_b, K\_b, K\_s, W\_j, W\_j, Zap(W\__, K\_j)}\)}, { RowBox[{"(", "\[NoBreak]", GridBox[{ {\({}\), \(W\_s\)}, {\({W\_s}\), \(K\_b\)}, {\({W\_s, K\_b}\), \(W\_b\)}, {\({W\_s, K\_b, W\_b}\), \(K\_b\)}, {\({K\_s, K\_b, W\_b, K\_b}\), \({}\)}, {\({K\_s, K\_b, K\_j, K\_b}\), \({}\)} }], "\[NoBreak]", ")"}], \({W\_s, K\_b, W\_b, K\_b, Zap(W\__, K\_s), Zap(W\__, K\_j)}\)}, { RowBox[{"(", "\[NoBreak]", GridBox[{ {\({}\), \(K\_j\)}, {\({K\_j}\), \(W\_j\)}, {\({K\_j, W\_j}\), \(W\_s\)}, {\({K\_j, W\_j, W\_s}\), \(K\_s\)}, {\({K\_j, W\_j, W\_s, K\_s}\), \(K\_b\)} }], "\[NoBreak]", ")"}], \({K\_j, W\_j, W\_s, K\_s, K\_b}\)}, { RowBox[{"(", "\[NoBreak]", GridBox[{ {\({}\), \(K\_j\)}, {\({K\_j}\), \(W\_j\)}, {\({K\_j, W\_j}\), \(K\_j\)}, {\({K\_j, W\_j, K\_j}\), \(K\_b\)}, {\({K\_j, W\_j, K\_j, K\_b}\), \(K\_s\)} }], "\[NoBreak]", ")"}], \({K\_j, W\_j, K\_j, K\_b, K\_s}\)}, { RowBox[{"(", "\[NoBreak]", GridBox[{ {\({}\), \(K\_j\)}, {\({K\_j}\), \(K\_b\)}, {\({K\_j, K\_b}\), \(W\_s\)}, {\({K\_j, K\_b, W\_s}\), \(K\_s\)} }], "\[NoBreak]", ")"}], \({K\_j, K\_b, W\_s, K\_s}\)}, { RowBox[{"(", "\[NoBreak]", GridBox[{ {\({}\), \(K\_s\)}, {\({K\_s}\), \(W\_j\)}, {\({K\_s, W\_j}\), \(W\_b\)}, {\({K\_s, W\_j, W\_b}\), \(W\_j\)}, {\({K\_s, W\_j, W\_b, W\_j}\), \(K\_b\)}, {\({K\_s, W\_j, W\_b, W\_j, K\_b}\), \(W\_s\)}, {\({K\_s, W\_j, W\_b, W\_j, K\_b, W\_s}\), \(K\_s\)}, {\({K\_s, K\_j, W\_b, W\_j, K\_b, W\_s, K\_s}\), \({}\)} }], "\[NoBreak]", ")"}], \({K\_s, W\_j, W\_b, W\_j, K\_b, W\_s, K\_s, Zap(W\__, K\_j)}\)}, { RowBox[{"(", "\[NoBreak]", GridBox[{ {\({}\), \(K\_b\)}, {\({K\_b}\), \(K\_s\)}, {\({K\_b, K\_s}\), \(K\_b\)}, {\({K\_b, K\_s, K\_b}\), \(K\_j\)} }], "\[NoBreak]", ")"}], \({K\_b, K\_s, K\_b, K\_j}\)}, { RowBox[{"(", "\[NoBreak]", GridBox[{ {\({}\), \(K\_b\)}, {\({K\_b}\), \(K\_j\)}, {\({K\_b, K\_j}\), \(W\_s\)}, {\({K\_b, K\_j, W\_s}\), \(W\_s\)}, {\({K\_b, K\_j, W\_s, W\_s}\), \(K\_s\)} }], "\[NoBreak]", ")"}], \({K\_b, K\_j, W\_s, W\_s, K\_s}\)}, { RowBox[{"(", "\[NoBreak]", GridBox[{ {\({}\), \(K\_j\)}, {\({K\_j}\), \(K\_j\)}, {\({K\_j, K\_j}\), \(W\_s\)}, {\({K\_j, K\_j, W\_s}\), \(K\_s\)}, {\({K\_j, K\_j, W\_s, K\_s}\), \(K\_s\)}, {\({K\_j, K\_j, K\_b, K\_s, K\_s}\), \({}\)} }], "\[NoBreak]", ")"}], \({K\_j, K\_j, W\_s, K\_s, K\_s, Zap(W\__, K\_b)}\)}, { RowBox[{"(", "\[NoBreak]", GridBox[{ {\({}\), \(K\_s\)}, {\({K\_s}\), \(K\_j\)}, {\({K\_s, K\_j}\), \(K\_b\)} }], "\[NoBreak]", ")"}], \({K\_s, K\_j, K\_b}\)}, { RowBox[{"(", "\[NoBreak]", GridBox[{ {\({}\), \(K\_s\)}, {\({K\_s}\), \(K\_j\)}, {\({K\_s, K\_j}\), \(W\_b\)}, {\({K\_s, K\_j, W\_b}\), \(K\_j\)}, {\({K\_s, K\_j, W\_b, K\_j}\), \(W\_j\)}, {\({K\_s, K\_j, K\_b, K\_j, W\_j}\), \({}\)} }], "\[NoBreak]", ")"}], \({K\_s, K\_j, W\_b, K\_j, W\_j, Zap(W\__, K\_b)}\)}, { RowBox[{"(", "\[NoBreak]", GridBox[{ {\({}\), \(K\_s\)}, {\({K\_s}\), \(W\_s\)}, {\({K\_s, W\_s}\), \(W\_s\)}, {\({K\_s, J\_k, W\_s}\), \({}\)}, {\({K\_b, J\_k, W\_s}\), \({}\)} }], "\[NoBreak]", ")"}], \({K\_s, W\_s, W\_s, Zap(W\__, J\_k), Zap(K\__, K\_b)}\)}, { RowBox[{"(", "\[NoBreak]", GridBox[{ {\({}\), \(K\_s\)}, {\({K\_s}\), \(K\_j\)}, {\({K\_s, K\_j}\), \(K\_b\)} }], "\[NoBreak]", ")"}], \({K\_s, K\_j, K\_b}\)}, { RowBox[{"(", "\[NoBreak]", GridBox[{ {\({}\), \(W\_j\)}, {\({W\_j}\), \(K\_j\)}, {\({K\_s, K\_j}\), \({}\)}, {\({K\_s, K\_j}\), \(K\_s\)}, {\({K\_b, K\_j, K\_s}\), \({}\)} }], "\[NoBreak]", ")"}], \({W\_j, K\_j, Zap(W\__, K\_s), K\_s, Zap(K\_s, K\_b)}\)}, { RowBox[{"(", "\[NoBreak]", GridBox[{ {\({}\), \(K\_s\)}, {\({K\_s}\), \(K\_b\)}, {\({K\_j, K\_b}\), \({}\)} }], "\[NoBreak]", ")"}], \({K\_s, K\_b, Zap(K\__, K\_j)}\)} }], "\[NoBreak]", ")"}], TraditionalForm]], "Output"] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[{ \(\(f1 = foundItems[keyseq[Theo]];\)\), "\[IndentingNewLine]", \(\(f1hadone = Cases[f1, {had_, got_} /; \((MemberQ[had, got])\)];\)\), "\[IndentingNewLine]", \(\(f1lacked = Cases[f1, {had_, got_} /; \((\(! MemberQ[had, got]\))\)];\)\), "\[IndentingNewLine]", \(\(f1hadoneK = Cases[f1, {had_, got : K\__} /; \((MemberQ[had, got])\)];\)\), "\[IndentingNewLine]", \(\(f1lackedK = Cases[f1, {had_, got : K\__} /; \((\(! MemberQ[had, got]\))\)];\)\), "\[IndentingNewLine]", \(\(f1hadoneW = Cases[f1, {had_, got : W\__} /; \((MemberQ[had, got])\)];\)\), "\[IndentingNewLine]", \(\(f1lackedW = Cases[f1, {had_, got : W\__} /; \((\(! MemberQ[had, got]\))\)];\)\), "\[IndentingNewLine]", \({n\_items, H\_items, L\_items, H\_keys, L\_keys, H\_junk, L\_junk} = Length /@ {f1, f1hadone, f1lacked, f1hadoneK, f1lackedK, f1hadoneW, f1lackedW}\)}], "Input"], Cell[BoxData[ \(TraditionalForm\`{64, 14, 50, 10, 34, 4, 16}\)], "Output"] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[{ RowBox[{ RowBox[{"foo", "=", RowBox[{"(", GridBox[{ {"\"\<\!\(n\_items\)\>\"", \(n\_items\), "1", "\[Placeholder]"}, {"\"\<\!\(n\_keys\)\>\"", \(n\_keys\), \(n\_keys/n\_items\), "\[Placeholder]"}, {"\"\<\!\(n\_junk\)\>\"", \(n\_junk\), \(n\_junk/n\_items\), "\[Placeholder]"}, {"\"\<\!\(H\_items\)\>\"", \(H\_items\), \(H\_items/n\_items\), "\[Placeholder]"}, {"\"\<\!\(L\_items\)\>\"", \(L\_items\), \(L\_items/n\_items\), "\[Placeholder]"}, {"\"\<\!\(H\_keys\)\>\"", \(H\_keys\), \(H\_keys/n\_keys\), "\[Placeholder]"}, {"\"\<\!\(L\_keys\)\>\"", \(L\_keys\), \(L\_keys/n\_keys\), "\[Placeholder]"}, {"\"\<\!\(H\_junk\)\>\"", \(H\_junk\), \(H\_junk/n\_junk\), "\[Placeholder]"}, {"\"\<\!\(L\_junk\)\>\"", \(L\_junk\), \(L\_junk/n\_junk\), "\[Placeholder]"} }], ")"}]}], ";"}], "\[IndentingNewLine]", \(foo[\([All, 4]\)] = foo[\([All, 3]\)] // N;\), "\[IndentingNewLine]", "foo"}], "Input"], Cell[BoxData[ FormBox[ RowBox[{"(", "\[NoBreak]", GridBox[{ {"\<\"\\!\\(n\\_items\\)\"\>", "64", "1", "1.`"}, {"\<\"\\!\\(n\\_keys\\)\"\>", "44", \(11\/16\), "0.6875`"}, {"\<\"\\!\\(n\\_junk\\)\"\>", "20", \(5\/16\), "0.3125`"}, {"\<\"\\!\\(H\\_items\\)\"\>", "14", \(7\/32\), "0.21875`"}, {"\<\"\\!\\(L\\_items\\)\"\>", "50", \(25\/32\), "0.78125`"}, {"\<\"\\!\\(H\\_keys\\)\"\>", "10", \(5\/22\), "0.22727272727272727`"}, {"\<\"\\!\\(L\\_keys\\)\"\>", "34", \(17\/22\), "0.7727272727272727`"}, {"\<\"\\!\\(H\\_junk\\)\"\>", "4", \(1\/5\), "0.2`"}, {"\<\"\\!\\(L\\_junk\\)\"\>", "16", \(4\/5\), "0.8`"} }], "\[NoBreak]", ")"}], TraditionalForm]], "Output"] }, Open ]] }, Open ]] }, Open ]] }, FrontEndVersion->"5.0 for Microsoft Windows", ScreenRectangle->{{0, 1920}, {0, 1387}}, WindowSize->{1230, 893}, WindowMargins->{{Automatic, 9}, {89, Automatic}}, PrintingCopies->1, PrintingPageRange->{Automatic, Automatic}, Magnification->1.5 ] (******************************************************************* Cached data follows. If you edit this Notebook file directly, not using Mathematica, you must remove the line containing CacheID at the top of the file. The cache data will then be recreated when you save this file from within Mathematica. *******************************************************************) (*CellTagsOutline CellTagsIndex->{} *) (*CellTagsIndex CellTagsIndex->{} *) (*NotebookFileOutline Notebook[{ Cell[1754, 51, 276, 8, 68, "Input"], Cell[CellGroupData[{ Cell[2055, 63, 33, 0, 79, "Subsection"], Cell[CellGroupData[{ Cell[2113, 67, 49, 0, 43, "Subsubsection"], Cell[2165, 69, 175, 6, 47, "Text"], Cell[2343, 77, 1112, 19, 363, "Input"], Cell[CellGroupData[{ Cell[3480, 100, 44, 1, 42, "Input"], Cell[3527, 103, 860, 25, 514, "Output"] }, Open ]] }, Open ]], Cell[CellGroupData[{ Cell[4436, 134, 135, 5, 43, "Subsubsection"], Cell[CellGroupData[{ Cell[4596, 143, 643, 18, 229, "Input"], Cell[5242, 163, 72, 1, 61, "Output"] }, Open ]] }, Open ]], Cell[CellGroupData[{ Cell[5363, 170, 41, 0, 43, "Subsubsection"], Cell[CellGroupData[{ Cell[5429, 174, 2117, 40, 653, "Input"], Cell[7549, 216, 673, 14, 186, "Output"], Cell[8225, 232, 1097, 19, 286, "Output"] }, Open ]], Cell[CellGroupData[{ Cell[9359, 256, 359, 6, 108, "Input"], Cell[9721, 264, 369, 6, 32, "Message"], Cell[10093, 272, 369, 6, 32, "Message"], Cell[10465, 280, 1115, 21, 407, "Output"] }, Open ]] }, Open ]] }, Open ]], Cell[CellGroupData[{ Cell[11641, 308, 34, 0, 79, "Subsection"], Cell[11678, 310, 1565, 35, 141, "Text"] }, Open ]], Cell[CellGroupData[{ Cell[13280, 350, 32, 0, 79, "Subsection"], Cell[13315, 352, 339, 10, 113, "Text"], Cell[13657, 364, 229, 6, 57, "Input"] }, Open ]], Cell[CellGroupData[{ Cell[13923, 375, 26, 0, 79, "Subsection"], Cell[CellGroupData[{ Cell[13974, 379, 50, 0, 43, "Subsubsection"], Cell[14027, 381, 1435, 38, 879, "Text"] }, Open ]], Cell[CellGroupData[{ Cell[15499, 424, 29, 0, 43, "Subsubsection"], Cell[15531, 426, 1623, 25, 639, "Input"], Cell[CellGroupData[{ Cell[17179, 455, 385, 8, 125, "Input"], Cell[17567, 465, 63, 1, 41, "Output"], Cell[17633, 468, 71, 1, 41, "Output"] }, Open ]], Cell[CellGroupData[{ Cell[17741, 474, 676, 12, 224, "Input"], Cell[18420, 488, 6456, 134, 2042, "Output"] }, Open ]], Cell[CellGroupData[{ Cell[24913, 627, 1149, 27, 264, "Input"], Cell[26065, 656, 78, 1, 41, "Output"] }, Open ]], Cell[CellGroupData[{ Cell[26180, 662, 1233, 24, 306, "Input"], Cell[27416, 688, 817, 14, 334, "Output"] }, Open ]] }, Open ]] }, Open ]] } ] *) (******************************************************************* End of Mathematica Notebook file. *******************************************************************)