<jupyter_start><jupyter_text>Definitions:1. $S_1$ is the set of outcomes for a roll of a single die: $S_1 = \lbrace x \vert x \in \Bbb N, x \le 6 \rbrace = \lbrace 1, 2, 3, 4, 5, 6 \rbrace$. More generally, $S_n$ is the set of outcomes for a roll of $n$ dice: $S_n = \lbrace (x_1, \dots, x_n) \vert x \in \Bbb N, x \le 6 \rbrace$, where $n \in \lbrace 1, 2, 3, 4, 5, 6 \rbrace$.2. $A \times B$ represents the Cartesian product of the sets $A$ and $B$. For example, $S_2 = \prod_1^2 S_1 = S_1 \times S_1$ represents a set of thirty six tuples reflecting all possible outcomes for a roll of two dice: $S_2 = \lbrace (1, 1), (1, 2), \cdots, (6, 5), (6, 6)\rbrace$ and $\vert S_2 \vert = 36$. 3. Define $R_n$ as the set of outcomes rolling $n$ dice that retains a player's turn; ie., a non-zilch outcome, or an outcome that results in accrued points. Thus, $Z_n = S_n \setminus R_n$ represents the set of outcomes rolling $n$ dice resulting in Zilch. Then the probability of a retaining roll with $n$ dice is $P(R_n)$, and the probability of a Zilch roll with $n$ dice is always $P(Z_n) = 1-P(R_n)$. 4. Define $C_n$ as the set of outcomes rolling $n$ dice that clears the dice over a _single_ roll; ie., outcomes that retain a player's turn _and_ allow a player to collect all held dice with the option of a new roll.5. Define $C_n^{*}$ as the set of outcomes rolling $n$ dice that clears the dice over a sequence of length $r$ $(1 \le r \le i)$ dice rolls; ie, outcomes for a sequence of rolls that retain a player's turn _and_ allow a player to collect all held dice with the option of a new roll. 6. Finally, let $\bar A$ denote the compliment of $A$, and let $\vert A \vert$ denote the cardinality of $A$.From the above definitions, it is clear that $C_n, R_n, S_n$ represent sets of tuples with each tuple of length $n$, and that $C_n \subseteq R_n \subset S_n$. Moreover, $C_n \subseteq C_n^{*}$, and $C_n^{*}$ represents a set of tuples with varying length (except in the special case of $C_1^{*}$, see below). With the definitions above, we represent the sets and probabilities of _retaining_ outcomes, _clearing_ outcomes, and _special roll_ outcomes for each roll of $n$ dice. ---  1 Die  Sets$C_1 = R_1 = C_1^{*} = \lbrace 1, 5 \rbrace$ Probabilities$\begin{eqnarray}P(C_1) = P(R_1) &=& P(C_1^{*}) \\&=& \frac{\vert C_1 \vert}{\vert S_1 \vert} \\&=& \frac{2}{6}\end{eqnarray}$ ---  2 Dice  Sets$C_2 = C_1 \times C_1$$R_2 = S_2 \setminus (\bar{C_1} \times \bar{C_1})$$C_2^{*} = C_2 \cup ((R_2 \setminus C_2) \times C_1)$  Probabilities$\begin{eqnarray}P(C_2) &=& \frac{\vert C_2 \vert}{\vert S_2 \vert} \\ &=& \frac{4}{6^2}\\ {} P(R_2) &=& \frac{\vert S_2 \vert - \vert \bar{C_1} \times \bar{C_1} \vert}{\vert S_2 \vert} \\  &=& \frac{36}{6^2} - \frac{4^2}{6^2} \\ &=& \frac{20}{6^2} \\ {} P(C_2^{*}) &=& \frac{\vert C_2 \vert}{\vert S_2 \vert} + \frac{\vert R_2 \setminus C_2 \vert}{\vert S_2 \vert} \cdot P(C_1) \\ &=& \frac{4 \vphantom{2 \choose 1}}{6^2} + \frac{2 \cdot 4 {2 \choose 1}}{6^2} \frac{2 \vphantom{2 \choose 1}}{6 \vphantom{6^3}} \\ &=& \frac{56}{6^3}\\\end{eqnarray}$Note that since $A_i$, $B_{j \ne i}$ represent rolls of different numbers of dice $(i, j)$, $P(A_i \cup B_{j \ne i}) = P(A_i)P(B_{j \ne i})$; ie., these must be independent events.<jupyter_code>(4/6**2, 20/6**2, 56/6**3)<jupyter_output><empty_output><jupyter_text>---  3 DiceWith three or more dice, outcomes include some special rolls. We use $K_n$ to denote the outcome of $n$ of a kind rolling $n$ dice.    Sets$K_3 = \lbrace (x_1, x_2, x_3) \vert (x_1, x_2, x_3) \in S_3, x_1 = x_2 = x_3 \rbrace$.$C_3 = K_3 \cup \lbrace (x_1, x_2, x_3) \vert  x_1, x_2, x_3 \in C_1 \rbrace$.$R_3 = S_3 \setminus \left(\left \lbrace \left(x_1, x_2, x_3 \right) \vert  x_1, x_2, x_3 \in \bar{C_1}  \right \rbrace  \setminus K_3 \right)$.$\begin{eqnarray}C_3^{*} = C_3 &\large\cup& {\underset{\small{\lbrace (i,j,k) \vert i \ne j \ne k, \; i,j,k \in {\lbrace 1,2,3 \rbrace} \rbrace}}{\Large\mathrm \cup} {\left \lbrace (x_1, x_2, x_3) \vert x_i, x_j \in C_1, x_k \in \bar{C_1} \right \rbrace}} \times C_1 \\&\large\cup&  {\underset{\small{\lbrace (i,j,k) \vert i \ne j \ne k, \; i,j,k \in {\lbrace 1,2,3 \rbrace} \rbrace}}{\Large\mathrm \cup} {\left \lbrace (x_1, x_2, x_3) \vert x_i, x_j \in \bar{C_1}, x_k \in C_1 \right \rbrace}} \times C_2^{*} \end{eqnarray}$  Probabilities$\begin{eqnarray}P(K_3) &=& \frac{\vert K_3 \vert}{\vert S_3 \vert} \\ &=& \frac{6}{6^3} \end{eqnarray}$$\begin{eqnarray}P(C_3) &=& \frac{ \vert K_3 \vert}{\vert S_3 \vert} + \frac{\vert \lbrace (x_1, x_2, x_3) \vert  x_1, x_2, x_3 \in C_1 \rbrace \setminus \lbrace (1,1,1), (5,5,5) \rbrace \vert}{\vert S_3 \vert} \\ &=& \frac{6}{6^3} + \frac{2^3 - 2}{6^3} \\ &=& \frac{12}{6^3}\end{eqnarray}$$\begin{eqnarray}P(R_3) &=& \frac{\left\vert S_3 \vphantom{\bar{C_1}} \right\vert}{\vert S_3 \vert} - \frac{\left \vert \left\lbrace (x_1, x_2, x_3) \vert  x_1, x_2, x_3 \in \bar{C_1} \right \rbrace \setminus K_3 \right \vert}{\vert S_3 \vert}\\ &=& \frac{216}{6^3} - \frac{4^3-4}{6^3} \\ &=& \frac{156}{6^3}\end{eqnarray}$$\begin{eqnarray}P(C_3^{*}) &=& \frac{\left \vert C_3 \vphantom{\underset{\small{\lbrace i \rbrace}}{\Large\mathrm \cup}} \right \vert}{\vert S_3 \vert} + \frac{\left \vert {\underset{\small{\lbrace (i,j,k) \vert i \ne j \ne k, \; i,j,k \in {\lbrace 1,2,3 \rbrace} \rbrace}}{\Large\mathrm \cup} {\left \lbrace (x_1, x_2, x_3) \vert x_i, x_j \in C_1, x_k \in \bar{C_1} \right \rbrace}} \right \vert}{\vert S_3 \vert} \cdot P(C_1) \\ & & \; + \; \frac{\left \vert {\underset{\small{\lbrace (i,j,k) \vert i \ne j \ne k, \; i,j,k \in {\lbrace 1,2,3 \rbrace} \rbrace}}{\Large\mathrm \cup} {\left \lbrace (x_1, x_2, x_3) \vert x_i, x_j \in \bar{C_1}, x_k \in C_1 \right \rbrace}} \right \vert}{\vert S_3 \vert} \cdot P(C_2^{*}) \\ &=& \frac{12 \vphantom{3 \choose 1}}{6^3} + \frac{2^2 \cdot 4 {3 \choose 1}}{6^3} \frac{2}{6} + \frac{2 \cdot 4^2 {3 \choose 2}}{6^3} \frac{56 \vphantom{3 \choose 1}}{6^3} \\ &=& \frac{1904}{6^5}\end{eqnarray}$<jupyter_code>(12/6**3, 156/6**3, 1904/6**5)<jupyter_output><empty_output><jupyter_text>---  4 DiceSpecial rolls: let $K_{m,n}$ denote the set of outcomes representing $m$ of a kind rolling $n$ dice, along with the provision that $K_n \subset K_{m,n}$. Sets$K_4 = \lbrace (x_1, x_2, x_3, x_4) \vert x_1 = x_2 = x_3 = x_4, (x_1, x_2, x_3, x_4) \in S_4 \rbrace$.$K_{3,4} = \underset{\small{\lbrace (i,j,k,l) \vert i \ne j \ne k \ne l, \; i,j,k,l \in {\lbrace 1,2,3,4 \rbrace} \rbrace}}{\Large\mathrm \cup} {\left \lbrace (x_1, x_2, x_3, x_4) \vert x_i=x_j=x_k, (x_i, x_j, x_k, x_l) \in S_4 \right \rbrace}$.$\begin{eqnarray}C_4 = K_4 &\large\cup& \underset{\small{\lbrace (i,j,k,l) \vert i \ne j \ne k \ne l, \; i,j,k,l \in {\lbrace 1,2,3,4 \rbrace} \rbrace}}{\Large\mathrm \cup} {\left \lbrace (x_1, x_2, x_3, x_4) \vert x_i=x_j=x_k \ne x_l, \;\; x_l \in C_1, \;\; (x_i, x_j, x_k, x_l) \in S_4 \right \rbrace} \\ &\large\cup& \underset{\small{\lbrace (i,j,k,l) \vert i \ne j \ne k \ne l, \; i,j,k,l \in {\lbrace 1,2,3,4 \rbrace} \rbrace}}{\Large\mathrm \cup} {\left \lbrace (x_1, x_2, x_3, x_4) \vert x_i=x_j, x_k=x_l, x_j \ne x_k, \;\; x_i, x_j, x_k, x_l \in C_1 \right \rbrace}\end{eqnarray}$$R_4 = S_4 \setminus \left(\left \lbrace \left(x_1, x_2, x_3, x_4 \right) \vert  x_1, x_2, x_3, x_4 \in \bar{C_1}  \right \rbrace  \setminus K_{3,4} \right)$.$\begin{eqnarray}C_4^{*} = C_4 &\large\cup& ((K_{3,4} \setminus C_4) \times C_1) \\ &\large\cup& \underset{\small{\lbrace (i,j,k,l) \vert i \ne j \ne k \ne l, \; i,j,k,l \in {\lbrace 1,2,3,4 \rbrace} \rbrace}}{\Large\mathrm \cup} {\left \lbrace (x_1, x_2, x_3, x_4) \vert x_i,x_j,x_k \in C_1, x_l \in \bar{C_1} \right \rbrace} \setminus K_{3,4} \times C_1 \\ &\large\cup& \underset{\small{\lbrace (i,j,k,l) \vert i \ne j \ne k \ne l, \; i,j,k,l \in {\lbrace 1,2,3,4 \rbrace} \rbrace}}{\Large\mathrm \cup} {\left \lbrace (x_1, x_2, x_3, x_4) \vert x_i,x_j \in C_1 x_k, x_l \in \bar{C_1} \right \rbrace} \times C_2^{*} \\ &\large\cup& \underset{\small{\lbrace (i,j,k,l) \vert i \ne j \ne k \ne l, \; i,j,k,l \in {\lbrace 1,2,3,4 \rbrace} \rbrace}}{\Large\mathrm \cup} {\left \lbrace (x_1, x_2, x_3, x_4) \vert x_i \in C_1 x_j, x_k, x_l \in \bar{C_1} \right \rbrace} \setminus K_{3,4} \times C_3^{*}\end{eqnarray}$  Probabilities$\begin{eqnarray}P(C_4) &=& \frac{\left\vert K_4 \vphantom{\underset{\small{\lbrace i \rbrace}}{\Large\mathrm \cup}} \right\vert}{\vert S_4 \vert} + \frac{\left\vert \underset{\small{\lbrace (i,j,k,l) \vert i \ne j \ne k \ne l, \; i,j,k,l \in {\lbrace 1,2,3,4 \rbrace} \rbrace}}{\Large\mathrm \cup} {\left \lbrace (x_1, x_2, x_3, x_4) \vert x_i=x_j=x_k \ne x_l, \;\; x_l \in C_1, \;\; (x_i, x_j, x_k, x_l) \in S_4 \right \rbrace} \right\vert}{\vert S_4 \vert} \\ & & \; + \frac{\left\vert \underset{\small{\lbrace (i,j,k,l) \vert i \ne j \ne k \ne l, \; i,j,k,l \in {\lbrace 1,2,3,4 \rbrace} \rbrace}}{\Large\mathrm \cup} {\left \lbrace (x_1, x_2, x_3, x_4) \vert x_i=x_j, x_k=x_l, x_j \ne x_k, \;\; x_i, x_j, x_k, x_l \in C_1 \right \rbrace}\right\vert}{\vert S_4 \vert} \\ &=& \frac{6}{6^4} + \frac{\left(4 \cdot 2 + 2 \right) {4 \choose 1}}{6^4} + \frac{2 {3 \choose 1}}{6^4} \\ &=& \frac{52}{6^4}\end{eqnarray}$$\begin{eqnarray}P(R_4) &=& \frac{\left\vert S_4 \vphantom{\bar{C_1}} \right\vert}{\vert S_4 \vert} - \frac{\left \vert \left\lbrace (x_1, x_2, x_3, x_4) \vert  x_1, x_2, x_3, x_4 \in \bar{C_1} \right \rbrace \setminus K_{3,4} \right \vert}{\vert S_4 \vert}\\ &=& \frac{1296\vphantom{{4\choose 3}}}{6^4} - \frac{4^4-\left(4 + 4 \cdot 3 {4 \choose 1}\right)}{6^4} \\ &=& \frac{1092}{6^4}\end{eqnarray}$$\begin{eqnarray}P(C_4^{*}) &=& \frac{\left\vert C_4 \right\vert}{\vert S_4\vert} + \frac{\vert K_{3,4} \setminus C_4 \vert}{\vert S_4 \vert} \cdot P(C_1) \\  & & \; + \frac{\left\vert \underset{\small{\lbrace (i,j,k,l) \vert i \ne j \ne k \ne l, \; i,j,k,l \in {\lbrace 1,2,3,4 \rbrace} \rbrace}}{\Large\mathrm \cup} {\left \lbrace (x_1, x_2, x_3, x_4) \vert x_i,x_j,x_k \in C_1, x_l \in \bar{C_1} \right \rbrace}\setminus K_{3,4}\right\vert}{\vert S_4 \vert} \cdot P(C_1) \\ & & \; + \frac{\left\vert \underset{\small{\lbrace (i,j,k,l) \vert i \ne j \ne k \ne l, \; i,j,k,l \in {\lbrace 1,2,3,4 \rbrace} \rbrace}}{\Large\mathrm \cup} {\left \lbrace (x_1, x_2, x_3, x_4) \vert x_i,x_j \in C_1, x_k, x_l \in \bar{C_1} \right \rbrace}\right\vert}{\vert S_4 \vert} \cdot P(C_2^{*}) \\ & & \; + \frac{\left\vert \underset{\small{\lbrace (i,j,k,l) \vert i \ne j \ne k \ne l, \; i,j,k,l \in {\lbrace 1,2,3,4 \rbrace} \rbrace}}{\Large\mathrm \cup} {\left \lbrace (x_1, x_2, x_3, x_4) \vert x_i \in C_1, x_j,x_k, x_l \in \bar{C_1} \right \rbrace} \setminus K_{3,4} \right\vert}{\vert S_4 \vert} \cdot P(C_3^{*}) \\ &=& \frac{52}{6^4} + \frac{\left(4 \cdot 3 + 2 \cdot 4\right) {4 \choose 1} }{6^4} \cdot \frac{2}{6} + \frac{2^2 \cdot 4 {4 \choose 1}}{6^4} \cdot \frac{2}{6} + \frac{2^2 \cdot 4^2 {4 \choose 2}}{6^4} \cdot \frac{56}{6^3} + \frac{2 \cdot 4^2 \cdot 3 {4 \choose 1}}{6^4} \cdot \frac{1904}{6^5} \\ &=& \frac{346883}{6^8}\end{eqnarray}$<jupyter_code>(52/6**4, 1092/6**4, 346883/6**8)<jupyter_output><empty_output><jupyter_text>---  5 Dice Sets$K_5 = \lbrace (x_1, x_2, x_3, x_4, x_5) \vert x_1 = x_2 = x_3 = x_4 = x_5, (x_1, x_2, x_3, x_4, x_5) \in S_5 \rbrace$.$K_{4,5} = \underset{\small{\lbrace (h,i,j,k,l) \vert h \ne i \ne j \ne k \ne l, \; h,i,j,k,l \in {\lbrace 1,2,3,4,5 \rbrace} \rbrace}}{\Large\mathrm \cup} {\left \lbrace (x_1, x_2, x_3, x_4, x_5) \vert x_h=x_i=x_j=x_k, (x_h, x_i, x_j, x_k, x_l) \in S_5 \right \rbrace}$.$K_{3,5} = \underset{\small{\lbrace (h,i,j,k,l) \vert h \ne i \ne j \ne k \ne l, \; h,i,j,k,l \in {\lbrace 1,2,3,4,5 \rbrace} \rbrace}}{\Large\mathrm \cup} {\left \lbrace (x_1, x_2, x_3, x_4, x_5) \vert x_h=x_i=x_j, (x_h, x_i, x_j, x_k, x_l) \in S_5 \right \rbrace}$.$\begin{eqnarray}C_5 = K_5 &\large\cup& \underset{\small{\lbrace (h,i,j,k,l) \vert h \ne i \ne j \ne k \ne l, \; h,i,j,k,l \in {\lbrace 1,2,3,4,5 \rbrace} \rbrace}}{\Large\mathrm \cup} {\left \lbrace (x_1, x_2, x_3, x_4, x_5) \vert x_h=x_i=x_j=x_k \ne x_l, \;\; x_l \in C_1, \;\; (x_h, x_i, x_j, x_k, x_l) \in S_5 \right \rbrace} \\ &\large\cup& \underset{\small{\lbrace (h,i,j,k,l) \vert h \ne i \ne j \ne k \ne l, \; h,i,j,k,l \in {\lbrace 1,2,3,4,5 \rbrace} \rbrace}}{\Large\mathrm \cup} {\left \lbrace (x_1, x_2, x_3, x_4, x_5) \vert x_h=x_i=x_j, x_j \ne x_k, x_j \ne x_l, \;\; x_k, x_l \in C_1, \;\; (x_h, x_i, x_j, x_k, x_l) \in S_5 \right \rbrace} \end{eqnarray}$$R_5 = S_5 \setminus \left(\left \lbrace \left(x_1, x_2, x_3, x_4, x_5 \right) \vert  x_1, x_2, x_3, x_4, x_5 \in \bar{C_1}  \right \rbrace  \setminus K_{3,5} \right)$.$\begin{eqnarray}C_5^{*} = {}\end{eqnarray}$  Probabilities$\begin{eqnarray}P(C_5) &=& \frac{\left\vert K_5 \vphantom{\underset{\small{\lbrace i \rbrace}}{\Large\mathrm \cup}} \right\vert}{\vert S_5 \vert} + \frac{\left\vert \underset{\small{\lbrace (h,i,j,k,l) \vert h \ne i \ne j \ne k \ne l, \; h,i,j,k,l \in {\lbrace 1,2,3,4,5 \rbrace} \rbrace}}{\Large\mathrm \cup} {\left \lbrace (x_1, x_2, x_3, x_4, x_5) \vert x_h=x_i=x_j=x_k \ne x_l, \;\; x_l \in C_1, \;\; (x_h, x_i, x_j, x_k, x_l) \in S_5 \right \rbrace} \right\vert}{\vert S_5 \vert} \\ & & \; + \frac{\left\vert \underset{\small{\lbrace (h,i,j,k,l) \vert h \ne i \ne j \ne k \ne l, \; h,i,j,k,l \in {\lbrace 1,2,3,4,5 \rbrace} \rbrace}}{\Large\mathrm \cup} {\left \lbrace (x_1, x_2, x_3, x_4, x_5) \vert x_h=x_i=x_j, x_j \ne x_k, x_j \ne x_l, \;\; x_k, x_l \in C_1, \;\; (x_h, x_i, x_j, x_k, x_l) \in S_5 \right \rbrace} \right\vert}{\vert S_5 \vert} \\ &=& \frac{6}{6^5} + \frac{\left(4 \cdot 2 + 2 \right) {5 \choose 1}}{6^5} + \frac{\left(4 \cdot 2^2 + 2 \right) {5 \choose 2}}{6^5} \\ &=& \frac{236}{6^5}\end{eqnarray}$$\begin{eqnarray}P(R_5) &=& \frac{\left\vert S_5 \vphantom{\bar{C_1}} \right\vert}{\vert S_5 \vert} - \frac{\left \vert \left\lbrace (x_1, x_2, x_3, x_4, x_5) \vert  x_1, x_2, x_3, x_4, x_5 \in \bar{C_1} \right \rbrace \setminus K_{3,5} \right \vert}{\vert S_5 \vert}\\ &=& \frac{7776\vphantom{{5\choose 3}}}{6^5} - \frac{4^5-\left(4 + 4 \cdot 3 {5 \choose 1} + 4 \cdot 3^2 {5 \choose 2} \right)}{6^5} \\ &=& \frac{7176}{6^5}\end{eqnarray}$$\begin{eqnarray}P(C_5^{*}) &=& \end{eqnarray}$<jupyter_code>7776 - (4**5 - (4 + 4*3*5 + 4*3**2*10))<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.23552042529378847, 'fraction_numerical': 0.05777839955232233, 'mean_word_length': 3.37484700122399, 'pattern_counts': {'":': 0, '<': 17, '<?xml version=': 0, '>': 17, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '4', 'dir': 'jupyter-structured-clean-dedup', 'id': '401503', 'license': 'CC-BY-3.0', 'n_tokens_mistral': 6950, 'n_tokens_neox': 6535, 'n_words': 1829, 'path': 'zilch_full_probabilities.ipynb', 'repo_name': 'cognitionswitch/cognitionswitch.github.io', 'size': '14296'}