{"id":3339,"date":"2022-05-13T14:57:54","date_gmt":"2022-05-13T19:57:54","guid":{"rendered":"https:\/\/laurentlessard.com\/bookproofs\/?p=3339"},"modified":"2022-05-14T09:02:32","modified_gmt":"2022-05-14T14:02:32","slug":"tetrahedral-dice-game","status":"publish","type":"post","link":"https:\/\/laurentlessard.com\/bookproofs\/tetrahedral-dice-game\/","title":{"rendered":"Tetrahedral dice game"},"content":{"rendered":"<p>This week&#8217;s <a href=\"https:\/\/fivethirtyeight.com\/features\/its-elementary-my-dear-riddler\/\">Riddler Classic<\/a> is a game of four-sided dice:<\/p>\n<blockquote><p>\nYou have four fair tetrahedral dice whose four sides are numbered 1 through 4.<\/p>\n<p>You play a game in which you roll them all and divide them into two groups: those whose values are unique, and those which are duplicates. For example, if you roll a 1, 2, 2 and 4, then the 1 and 4 will go into the &#8220;unique&#8221; group, while the 2s will go into the &#8220;duplicate&#8221; group.<\/p>\n<p>Next, you reroll all the dice in the duplicate pool and sort all the dice again. Continuing the previous example, that would mean you reroll the 2s. If the result happens to be 1 and 3, then the &#8220;unique&#8221; group will now consist of 3 and 4, while the &#8220;duplicate&#8221; group will have two 1s.<\/p>\n<p>You continue rerolling the duplicate pool and sorting all the dice until all the dice are members of the same group. If all four dice are in the &#8220;unique&#8221; group, you win. If all four are in the &#8220;duplicate&#8221; group, you lose.<\/p>\n<p>What is your probability of winning the game?<\/p><\/blockquote>\n<p>My solution:<br \/>\n<a href=\"javascript:Solution('soln_tetradice','toggle_tetradice')\" id=\"toggle_tetradice\">[Show Solution]<\/a><\/p>\n<div id=\"soln_tetradice\" style=\"display: none\">\n<p>We can view this game as a <a href=\"https:\/\/en.wikipedia.org\/wiki\/Markov_chain\">Markov chain<\/a>. At any point in time, we are in a particular <em>state<\/em> of the game, and when we re-roll the dice, we transition to a different state. Although there are many possible states (one for each possible way of rolling the four dice), we can use symmetry arguments to reduce the total states to just four. Here they are:<\/p>\n<ol>\n<li> All dice are duplicates. This includes cases like (1,1,1,1) but also (2,2,3,3). If we ever arrive at this position, the game ends and we lose.\n<li> Three dice are duplicates. For example: (1,1,1,2)\n<li> Two dice are duplicates. For example: (1,1,2,3)\n<li> No dice are duplicates. For example: (1,2,3,4). If we ever arrive at this position, the game ends and we win.\n<\/ol>\n<p>We can associate each state transition with a probability. For example, suppose we roll (1,1,2,3). We are in the &#8220;two-duplicate&#8221; state. We must re-roll the two 1&#8217;s, and four things could happen:<\/p>\n<ul>\n<li> We roll (2,2) or (3,3) (probability 1\/8). We now have 3 duplicates and the game continues.\n<li> We roll (2,3) or (3,2) (probability 1\/8). We now have 4 duplicates and the game ends (we lose).\n<li> We roll (1,4) or (4,1) (probability 1\/8). We now have no duplicates and the game ends (we win).\n<li> We roll anything else (probability 5\/8). We have 2 duplicates again and the game continues.\n<\/ul>\n<p>If we continue in this manner and find all possible transition probabilities between all four states, we obtain the following diagram:<\/p>\n<p><a href=\"https:\/\/laurentlessard.com\/bookproofs\/wp-content\/uploads\/2022\/05\/tetradice_diagram.png\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/laurentlessard.com\/bookproofs\/wp-content\/uploads\/2022\/05\/tetradice_diagram.png\" alt=\"\" width=\"2150\" height=\"1655\" class=\"aligncenter size-full wp-image-3347\" srcset=\"https:\/\/laurentlessard.com\/bookproofs\/wp-content\/uploads\/2022\/05\/tetradice_diagram.png 2150w, https:\/\/laurentlessard.com\/bookproofs\/wp-content\/uploads\/2022\/05\/tetradice_diagram-300x231.png 300w, https:\/\/laurentlessard.com\/bookproofs\/wp-content\/uploads\/2022\/05\/tetradice_diagram-1024x788.png 1024w, https:\/\/laurentlessard.com\/bookproofs\/wp-content\/uploads\/2022\/05\/tetradice_diagram-768x591.png 768w, https:\/\/laurentlessard.com\/bookproofs\/wp-content\/uploads\/2022\/05\/tetradice_diagram-1536x1182.png 1536w, https:\/\/laurentlessard.com\/bookproofs\/wp-content\/uploads\/2022\/05\/tetradice_diagram-2048x1576.png 2048w, https:\/\/laurentlessard.com\/bookproofs\/wp-content\/uploads\/2022\/05\/tetradice_diagram-1200x924.png 1200w\" sizes=\"auto, (max-width: 709px) 85vw, (max-width: 909px) 67vw, (max-width: 1362px) 62vw, 840px\" \/><\/a><\/p>\n<p>We can think of the &#8220;three duplicates&#8221; state as our start state. Why? Because we start the game by rolling all four dice. This is mathematically equivalent to rolling three dice, since the value of the die we don&#8217;t roll might as well have been our first roll (all numbers are equivalent by symmetry). Therefore, we can represent our transitions as follows:<br \/>\n\\[<br \/>\nA = \\begin{bmatrix}<br \/>\n 1 &#038; \\frac{5}{32} &#038; \\frac{1}{8} &#038; 0 \\\\<br \/>\n 0 &#038; \\frac{3}{16} &#038; \\frac{1}{8} &#038; 0 \\\\<br \/>\n 0 &#038; \\frac{9}{16} &#038; \\frac{5}{8} &#038; 0 \\\\<br \/>\n 0 &#038; \\frac{3}{32} &#038; \\frac{1}{8} &#038; 1<br \/>\n\\end{bmatrix},\\qquad<br \/>\nx_0 = \\begin{bmatrix}<br \/>\n0 \\\\ 1 \\\\ 0 \\\\ 0\\end{bmatrix}.<br \/>\n\\]Notice that all columns sum to 1 since the sum of probabilities from every node along outgoing edges must sum to 1. We can view our current state distribution as a column vector that sums to 1. For example, our initial state is given by $x_0$ above, since we start in the &#8220;three-duplicate&#8221; state with probability 1. Every time we transition to a new state, our new distribution can be found by multiplying our current state by $A$. In other words:<br \/>\n\\[<br \/>\nx_{k+1} = A x_k,\\quad\\text{for }k=0,1,\\dots<br \/>\n\\]The question is: where will we end up on average? This is equivalent to asking for the limit<br \/>\n\\[<br \/>\nx_\\infty = \\lim_{k\\to\\infty} A^k x_0<br \/>\n\\]We can find this limit by performing an eigenvalue decomposition:<br \/>\n\\begin{align}<br \/>\nA &#038;= V\\Lambda V^{-1} \\\\<br \/>\n&#038;= \\begin{bmatrix}<br \/>\n 0 &#038; 1 &#038; \\frac{23}{21} &#038; -1 \\\\<br \/>\n 0 &#038; 0 &#038; -\\frac{8}{21} &#038; 30 \\\\<br \/>\n 0 &#038; 0 &#038; -\\frac{12}{7} &#038; -30 \\\\<br \/>\n 1 &#038; 0 &#038; 1 &#038; 1<br \/>\n\\end{bmatrix}<br \/>\n\\begin{bmatrix}<br \/>\n 1 &#038; 0 &#038; 0 &#038; 0 \\\\<br \/>\n 0 &#038; 1 &#038; 0 &#038; 0 \\\\<br \/>\n 0 &#038; 0 &#038; \\frac{3}{4} &#038; 0 \\\\<br \/>\n 0 &#038; 0 &#038; 0 &#038; \\frac{1}{16}<br \/>\n\\end{bmatrix}<br \/>\n\\begin{bmatrix}<br \/>\n 0 &#038; \\frac{9}{20} &#038; \\frac{29}{60} &#038; 1 \\\\<br \/>\n 1 &#038; \\frac{11}{20} &#038; \\frac{31}{60} &#038; 0 \\\\<br \/>\n 0 &#038; -\\frac{21}{44} &#038; -\\frac{21}{44} &#038; 0 \\\\<br \/>\n 0 &#038; \\frac{3}{110} &#038; -\\frac{1}{165} &#038; 0<br \/>\n\\end{bmatrix}<br \/>\n\\end{align}The limit is therefore:<br \/>\n\\begin{align}<br \/>\nA^\\infty x_0 &#038;= V \\Lambda^{\\infty} V^{-1}x_0 \\\\<br \/>\n&#038;= \\begin{bmatrix}<br \/>\n 0 &#038; 1 &#038; \\frac{23}{21} &#038; -1 \\\\<br \/>\n 0 &#038; 0 &#038; -\\frac{8}{21} &#038; 30 \\\\<br \/>\n 0 &#038; 0 &#038; -\\frac{12}{7} &#038; -30 \\\\<br \/>\n 1 &#038; 0 &#038; 1 &#038; 1<br \/>\n\\end{bmatrix}<br \/>\n\\begin{bmatrix}<br \/>\n 1 &#038; 0 &#038; 0 &#038; 0 \\\\<br \/>\n 0 &#038; 1 &#038; 0 &#038; 0 \\\\<br \/>\n 0 &#038; 0 &#038; 0 &#038; 0 \\\\<br \/>\n 0 &#038; 0 &#038; 0 &#038; 0<br \/>\n\\end{bmatrix}<br \/>\n\\begin{bmatrix}<br \/>\n 0 &#038; \\frac{9}{20} &#038; \\frac{29}{60} &#038; 1 \\\\<br \/>\n 1 &#038; \\frac{11}{20} &#038; \\frac{31}{60} &#038; 0 \\\\<br \/>\n 0 &#038; -\\frac{21}{44} &#038; -\\frac{21}{44} &#038; 0 \\\\<br \/>\n 0 &#038; \\frac{3}{110} &#038; -\\frac{1}{165} &#038; 0<br \/>\n\\end{bmatrix} \\begin{bmatrix}<br \/>\n0 \\\\ 1 \\\\ 0 \\\\ 0\\end{bmatrix}\\\\<br \/>\n&#038;= \\begin{bmatrix}<br \/>\n 0 &#038; 1 \\\\<br \/>\n 0 &#038; 0 \\\\<br \/>\n 0 &#038; 0 \\\\<br \/>\n 1 &#038; 0<br \/>\n\\end{bmatrix}<br \/>\n\\begin{bmatrix}<br \/>\n 0 &#038; \\frac{9}{20} &#038; \\frac{29}{60} &#038; 1 \\\\<br \/>\n 1 &#038; \\frac{11}{20} &#038; \\frac{31}{60} &#038; 0<br \/>\n \\end{bmatrix}<br \/>\n\\begin{bmatrix}<br \/>\n0 \\\\ 1 \\\\ 0 \\\\ 0\\end{bmatrix} \\\\<br \/>\n&#038;= \\begin{bmatrix}<br \/>\n\\frac{11}{20} \\\\ 0 \\\\ 0 \\\\ \\frac{9}{20}\\end{bmatrix}<br \/>\n\\end{align}In other words, there is a 11\/20, or 55% chance that we will lose and end up in the &#8220;all duplicate&#8221; case, and a 9\/20, or 45% chance that we will win and end up in the &#8220;all unique&#8221; case.\n<\/p><\/div>\n","protected":false},"excerpt":{"rendered":"<p>This week&#8217;s Riddler Classic is a game of four-sided dice: You have four fair tetrahedral dice whose four sides are numbered 1 through 4. You play a game in which you roll them all and divide them into two groups: those whose values are unique, and those which are duplicates. For example, if you roll &hellip; <a href=\"https:\/\/laurentlessard.com\/bookproofs\/tetrahedral-dice-game\/\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;Tetrahedral dice game&#8221;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":3347,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"om_disable_all_campaigns":false,"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"_uf_show_specific_survey":0,"_uf_disable_surveys":false,"footnotes":""},"categories":[7],"tags":[20,8,2],"class_list":["post-3339","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-riddler","tag-markov-chains","tag-probability","tag-riddler"],"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/laurentlessard.com\/bookproofs\/wp-json\/wp\/v2\/posts\/3339","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/laurentlessard.com\/bookproofs\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/laurentlessard.com\/bookproofs\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/laurentlessard.com\/bookproofs\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/laurentlessard.com\/bookproofs\/wp-json\/wp\/v2\/comments?post=3339"}],"version-history":[{"count":6,"href":"https:\/\/laurentlessard.com\/bookproofs\/wp-json\/wp\/v2\/posts\/3339\/revisions"}],"predecessor-version":[{"id":3348,"href":"https:\/\/laurentlessard.com\/bookproofs\/wp-json\/wp\/v2\/posts\/3339\/revisions\/3348"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/laurentlessard.com\/bookproofs\/wp-json\/wp\/v2\/media\/3347"}],"wp:attachment":[{"href":"https:\/\/laurentlessard.com\/bookproofs\/wp-json\/wp\/v2\/media?parent=3339"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/laurentlessard.com\/bookproofs\/wp-json\/wp\/v2\/categories?post=3339"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/laurentlessard.com\/bookproofs\/wp-json\/wp\/v2\/tags?post=3339"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}