{"id":2660,"date":"2017-09-11T12:00:17","date_gmt":"2017-09-11T17:00:17","guid":{"rendered":"https:\/\/blogs.mathworks.com\/cleve\/?p=2660"},"modified":"2017-09-10T20:24:15","modified_gmt":"2017-09-11T01:24:15","slug":"brad-efrons-nontransitive-dice","status":"publish","type":"post","link":"https:\/\/blogs.mathworks.com\/cleve\/2017\/09\/11\/brad-efrons-nontransitive-dice\/","title":{"rendered":"Brad Efron&#8217;s Nontransitive Dice"},"content":{"rendered":"<div class=\"content\"><!--introduction--><p>Do not get involved in a bar bet with Brad Efron and his dice until you have read this.<\/p><!--\/introduction--><h3>Contents<\/h3><div><ul><li><a href=\"#9c32a1d0-5446-4d7e-895d-3dbdd5b0b59d\">Brad Efron<\/a><\/li><li><a href=\"#52925be6-d0ff-4b9b-94a2-0445167ddac7\">Brad's wager<\/a><\/li><li><a href=\"#6cee78ce-cd94-4340-90cd-1db5886842bd\">Transitivity<\/a><\/li><li><a href=\"#7a8ce7fb-e19e-4461-a4eb-1947bd5cb93f\">Brad's dice<\/a><\/li><li><a href=\"#66027140-ea41-429c-bc0a-9b579f6ab432\">Compare<\/a><\/li><li><a href=\"#370a4d05-d4b0-4638-968e-10e3102dc1bf\">Simulate<\/a><\/li><li><a href=\"#b8464486-4ec1-42ab-b509-b48583233a9e\">Three dice nontransitive set<\/a><\/li><\/ul><\/div><h4>Brad Efron<a name=\"9c32a1d0-5446-4d7e-895d-3dbdd5b0b59d\"><\/a><\/h4><p>Bradley Efron is the Max H. Stein Professor of Humanities and Sciences, Professor of Statistics, and Professor of Biostatistics at Stanford. He is best known for his invention of the bootstrap resampling technique, which is a fundamental tool in computational statistics.  In 2005, he received the National Medal of Science.  But I think of him for something much less esoteric -- his nontransitive dice.  And I also remember him as one of my roommates when we were both students at Caltech.<\/p><h4>Brad's wager<a name=\"52925be6-d0ff-4b9b-94a2-0445167ddac7\"><\/a><\/h4><p>If you come across Brad in a bar some night, he might offer you the following wager.  He would show you four individual dice, like these.<\/p><p><img decoding=\"async\" vspace=\"5\" hspace=\"5\" src=\"https:\/\/blogs.mathworks.com\/cleve\/files\/non_transitive_dice_1.jpg\" alt=\"\"> <\/p><p>Photo credit: <a href=\"http:\/\/www.grand-illusions.com\">http:\/\/www.grand-illusions.com<\/a><\/p><p>You would get to pick one of the dice.  He would then pick one for himself.  You would then roll the dice a number of times, with the player rolling the highest number each time winning a dollar. (Rolling the same number is a <i>push<\/i>.  No money changes hands.) Do you want to play?  I'll reveal the zinger -- no matter which of the four dice you choose, Brad can pick one that will win money from you in the long run.<\/p><h4>Transitivity<a name=\"6cee78ce-cd94-4340-90cd-1db5886842bd\"><\/a><\/h4><p>A binary mathematical relationship, $\\rho$, is said to be <i>transitive<\/i> if $x \\ \\rho \\ y$ and $y \\ \\rho \\ z$ implies $x \\ \\rho \\ z$. <i>Equality<\/i> is the obvious example.  If $x = y$ and $y = z$ then $x = z$. Other examples include <i>greater than<\/i>, <i>divides<\/i>, and <i>subset<\/i>.<\/p><p>On the other hand, a relationship is <i>nontransitive<\/i> if the implication does not necessarily hold.  Despite their efforts to make it transitive, <i>Facebook friend<\/i> is still nontransitive.<\/p><p>Ordinarily, the term <i>dominates<\/i>, or <i>beats<\/i> is transitive.  And, ordinarily, you might think this applies to dice games.  But, no, such thinking could cost you money. Brad's dice are <i>nontransitive<\/i>.<\/p><h4>Brad's dice<a name=\"7a8ce7fb-e19e-4461-a4eb-1947bd5cb93f\"><\/a><\/h4><p>Here are the six values on the faces of Brad's four dice.<\/p><pre class=\"codeinput\">   A = [4 4 4 4 0 0];\r\n   B = [3 3 3 3 3 3];\r\n   C = [6 6 2 2 2 2];\r\n   D = [5 5 5 1 1 1];\r\n<\/pre><p>How do these compare when paired up against each other? It is obvious that <tt>A<\/tt> wins money from <tt>B<\/tt> because <tt>B<\/tt> rolls a 3 all of the time, while <tt>A<\/tt> rolls a winning 4 two-thirds of the time.  The odds are 2:1 in <tt>A<\/tt>'s favor.  Similarly <tt>B<\/tt>'s constant 3's dominate <tt>C<\/tt>'s 2's two-thirds of the time.  The odds are 2:1 in <tt>B<\/tt>'s favor.<\/p><p>Comparing <tt>C<\/tt> with <tt>D<\/tt> is more complicated because neither rolls a constant value..  We have to compare each possible roll of one die with all the possible rolls of the other.  That's 36 comparisons.  The comparison is facilitated by constructing the following matrix. The comparison of a row vector with a column vector is allowed under MATLAB's new rules of <i>singleton expansion<\/i>.<\/p><pre class=\"codeinput\">   Z = (C &gt; D') - (C &lt; D')\r\n<\/pre><pre class=\"codeoutput\">Z =\r\n     1     1    -1    -1    -1    -1\r\n     1     1    -1    -1    -1    -1\r\n     1     1    -1    -1    -1    -1\r\n     1     1     1     1     1     1\r\n     1     1     1     1     1     1\r\n     1     1     1     1     1     1\r\n<\/pre><p>The result is a matrix <tt>Z<\/tt> with +1 where <tt>C<\/tt> beats <tt>D<\/tt> and a -1 where <tt>D<\/tt> beats <tt>C<\/tt>.  There is a submatrix of -1s in the upper right, but no solid column or row. All that remains is to count the number of +1's and -1's to get the odds.<\/p><pre class=\"codeinput\">   odds = [nnz(Z == +1) nnz(Z == -1)]\r\n<\/pre><pre class=\"codeoutput\">odds =\r\n    24    12\r\n<\/pre><p>There are twice as many +1s as -1s, so, again, the odds are 2:1 that <tt>C<\/tt> beats <tt>D<\/tt>.<\/p><p>But now how does <tt>D<\/tt> fair against <tt>A<\/tt>?<\/p><pre class=\"codeinput\">   Z = (D &gt; A') - (D &lt; A')\r\n   odds = [nnz(Z == +1) nnz(Z == -1)]\r\n<\/pre><pre class=\"codeoutput\">Z =\r\n     1     1     1    -1    -1    -1\r\n     1     1     1    -1    -1    -1\r\n     1     1     1    -1    -1    -1\r\n     1     1     1    -1    -1    -1\r\n     1     1     1     1     1     1\r\n     1     1     1     1     1     1\r\nodds =\r\n    24    12\r\n<\/pre><p>Again, there are twice as many +1s as -1s.  The odds are 2:1 in <tt>D<\/tt>'s favor.<\/p><p>To summarize, <tt>A<\/tt> beats <tt>B<\/tt>, <tt>B<\/tt> beats <tt>C<\/tt>, <tt>C<\/tt> beats <tt>D<\/tt>, and <tt>D<\/tt> beats <tt>A<\/tt>.  No matter which die you choose, Brad can pick one that will beat it -- and by a substantial margin.   It's like \"Rock, Paper, Scissors\" with a fourth option, but you have to make the first move.<\/p><h4>Compare<a name=\"66027140-ea41-429c-bc0a-9b579f6ab432\"><\/a><\/h4><p>Let's capture that comparison in a function. The function can print and label the matrix <tt>Z<\/tt>, as well as provide for pushes, which we'll need later.<\/p><pre class=\"codeinput\">   type <span class=\"string\">compare<\/span>\r\n<\/pre><pre class=\"codeoutput\">\r\nfunction odds = compare(X,Y)\r\n    Z = (X &gt; Y') - (X &lt; Y');\r\n    odds = [nnz(Z==1) nnz(Z==0) nnz(Z==-1)];\r\n    \r\n    fprintf('\\n         X  %3d %5d %5d %5d %5d %5d\\n',X)\r\n    fprintf('       Y\\n')\r\n    fprintf('   %5d  %5d %5d %5d %5d %5d %5d\\n',[Y' Z]')\r\nend\r\n   \r\n<\/pre><p>Use the function to compare <tt>A<\/tt> with <tt>C<\/tt>.<\/p><pre class=\"codeinput\">   AvC = compare(A,C)\r\n<\/pre><pre class=\"codeoutput\">\r\n         X    4     4     4     4     0     0\r\n       Y\r\n       6     -1    -1    -1    -1    -1    -1\r\n       6     -1    -1    -1    -1    -1    -1\r\n       2      1     1     1     1    -1    -1\r\n       2      1     1     1     1    -1    -1\r\n       2      1     1     1     1    -1    -1\r\n       2      1     1     1     1    -1    -1\r\nAvC =\r\n    16     0    20\r\n<\/pre><p>Dividing out a common factor, that is odds of 4:5 against <tt>A<\/tt>.<\/p><p>The final possible comparison is <tt>B<\/tt> versus <tt>D<\/tt>.  <tt>B<\/tt>'s unimaginative play results in complete rows of +1 or -1.<\/p><pre class=\"codeinput\">   BvD = compare(B,D)\r\n<\/pre><pre class=\"codeoutput\">\r\n         X    3     3     3     3     3     3\r\n       Y\r\n       5     -1    -1    -1    -1    -1    -1\r\n       5     -1    -1    -1    -1    -1    -1\r\n       5     -1    -1    -1    -1    -1    -1\r\n       1      1     1     1     1     1     1\r\n       1      1     1     1     1     1     1\r\n       1      1     1     1     1     1     1\r\nBvD =\r\n    18     0    18\r\n<\/pre><p>So <tt>B<\/tt> and <tt>D<\/tt> are an even match.  Here is the complete summary of all possible pairings among Efron's Dice,<\/p><pre>              A      B      C      D\r\n        A           2:1    4:5    1:2\r\n        B    1:2           2:1    1:1\r\n        C    5:4    1:2           2:1\r\n        D    2:1    1:1    1:2<\/pre><h4>Simulate<a name=\"370a4d05-d4b0-4638-968e-10e3102dc1bf\"><\/a><\/h4><p>In case we don't believe these comparisons, or because we'd like to see the shape of the distribution, or just because it's fun, let's do some Monte Carlo simulations.  Because 108 is divisible by 36, I'll make 108 rolls one game and simulate 10000 games. Here is the code.<\/p><pre class=\"codeinput\">   type <span class=\"string\">simulate<\/span>\r\n<\/pre><pre class=\"codeoutput\">\r\nfunction simulate(X,Y)\r\n    m = 108;   % Number of rolls in a single game.\r\n    n = 10000; % Number of games in a simulation.\r\n    s = zeros(1,n);\r\n    for k = 1:n\r\n        for l = 1:m\r\n            i = randi(6);\r\n            j = randi(6);\r\n            if X(i) &gt; Y(j)\r\n                s(k) = s(k) + 1;\r\n            elseif X(i) &lt; Y(j)\r\n                s(k) = s(k) - 1;\r\n            % else X(i) == Y(j)\r\n            % push counts as a roll\r\n            end\r\n        end\r\n    end\r\n       \r\n    clf\r\n    shg\r\n    histogram(s)\r\n    line([0 0],get(gca,'ylim'),'color','k','linewidth',2)\r\n    title(sprintf('mean = %6.2f',mean(s)))\r\nend\r\n<\/pre><p>I'll initialize the random number generator so that I get the same results every time I <tt>publish<\/tt> this post.<\/p><pre class=\"codeinput\">  rng(1)\r\n<\/pre><p>Now verify that <tt>A<\/tt> beats <tt>B<\/tt>.<\/p><pre class=\"codeinput\">   simulate(A,B);\r\n<\/pre><img decoding=\"async\" vspace=\"5\" hspace=\"5\" src=\"https:\/\/blogs.mathworks.com\/cleve\/files\/efron_blog_01.png\" alt=\"\"> <p>Sure enough, the 2:1 odds imply that <tt>A<\/tt> can be expected to be ahead by 108\/3 dollars after 108 flips.  There is a vertical black line at zero to emphasize that this isn't a fair game.<\/p><p>How about those 4:5 odds for <tt>A<\/tt> versus <tt>C<\/tt>?  <tt>A<\/tt> can be expected to lose 108\/9 dollars with 108 flips.<\/p><pre class=\"codeinput\">   simulate(A,C)\r\n<\/pre><img decoding=\"async\" vspace=\"5\" hspace=\"5\" src=\"https:\/\/blogs.mathworks.com\/cleve\/files\/efron_blog_02.png\" alt=\"\"> <h4>Three dice nontransitive set<a name=\"b8464486-4ec1-42ab-b509-b48583233a9e\"><\/a><\/h4><p>Efron's dice were introduced in a <i>Scientific American<\/i> article by Martin Gardner in 1970.  Since then a number of people have found other sets of nontransitive dice with interesting properties. The <a href=\"https:\/\/en.wikipedia.org\/wiki\/Nontransitive_dice\">Wikipedia article on nontransitive dice<\/a> has an abundance of information, including the following set.<\/p><pre class=\"codeinput\">   A = [1 1 3 5 5 6];\r\n   B = [2 3 3 4 4 5];\r\n   C = [1 2 2 4 6 6];\r\n<\/pre><p>This set is very close to a conventional set.  The sum of the numbers on each die is 21, the same as a conventional die. And each die differs from a standard <tt>1:6<\/tt> die in only two places.  Nevertheless, the set is nontransitive.<\/p><p>Since this is so close to a conventional set, we expect the odds to be closer to even.  Let's see.<\/p><pre class=\"codeinput\">   AvB = compare(A,B)\r\n<\/pre><pre class=\"codeoutput\">\r\n         X    1     1     3     5     5     6\r\n       Y\r\n       2     -1    -1     1     1     1     1\r\n       3     -1    -1     0     1     1     1\r\n       3     -1    -1     0     1     1     1\r\n       4     -1    -1    -1     1     1     1\r\n       4     -1    -1    -1     1     1     1\r\n       5     -1    -1    -1     0     0     1\r\nAvB =\r\n    17     4    15\r\n<\/pre><p>Since the dice have matching values, we have some zeros in the matrix.  <tt>A<\/tt> has only 17 winning values compared to <tt>B<\/tt>'s 15.<\/p><pre class=\"codeinput\">   simulate(A,B)\r\n<\/pre><img decoding=\"async\" vspace=\"5\" hspace=\"5\" src=\"https:\/\/blogs.mathworks.com\/cleve\/files\/efron_blog_03.png\" alt=\"\"> <p>Here is the result all three pairwise comparisons.<\/p><pre>              A      B      C\r\n        A          17:15  15:17\r\n        B   15:17         17:15\r\n        C   17:15  15:17<\/pre><script language=\"JavaScript\"> <!-- \r\n    function grabCode_fbd59e85e13747dcaaa91b54ebefd563() {\r\n        \/\/ Remember the title so we can use it in the new page\r\n        title = document.title;\r\n\r\n        \/\/ Break up these strings so that their presence\r\n        \/\/ in the Javascript doesn't mess up the search for\r\n        \/\/ the MATLAB code.\r\n        t1='fbd59e85e13747dcaaa91b54ebefd563 ' + '##### ' + 'SOURCE BEGIN' + ' #####';\r\n        t2='##### ' + 'SOURCE END' + ' #####' + ' fbd59e85e13747dcaaa91b54ebefd563';\r\n    \r\n        b=document.getElementsByTagName('body')[0];\r\n        i1=b.innerHTML.indexOf(t1)+t1.length;\r\n        i2=b.innerHTML.indexOf(t2);\r\n \r\n        code_string = b.innerHTML.substring(i1, i2);\r\n        code_string = code_string.replace(\/REPLACE_WITH_DASH_DASH\/g,'--');\r\n\r\n        \/\/ Use \/x3C\/g instead of the less-than character to avoid errors \r\n        \/\/ in the XML parser.\r\n        \/\/ Use '\\x26#60;' instead of '<' so that the XML parser\r\n        \/\/ doesn't go ahead and substitute the less-than character. \r\n        code_string = code_string.replace(\/\\x3C\/g, '\\x26#60;');\r\n\r\n        copyright = 'Copyright 2017 The MathWorks, Inc.';\r\n\r\n        w = window.open();\r\n        d = w.document;\r\n        d.write('<pre>\\n');\r\n        d.write(code_string);\r\n\r\n        \/\/ Add copyright line at the bottom if specified.\r\n        if (copyright.length > 0) {\r\n            d.writeln('');\r\n            d.writeln('%%');\r\n            if (copyright.length > 0) {\r\n                d.writeln('% _' + copyright + '_');\r\n            }\r\n        }\r\n\r\n        d.write('<\/pre>\\n');\r\n\r\n        d.title = title + ' (MATLAB code)';\r\n        d.close();\r\n    }   \r\n     --> <\/script><p style=\"text-align: right; font-size: xx-small; font-weight:lighter;   font-style: italic; color: gray\"><br><a href=\"javascript:grabCode_fbd59e85e13747dcaaa91b54ebefd563()\"><span style=\"font-size: x-small;        font-style: italic;\">Get \r\n      the MATLAB code <noscript>(requires JavaScript)<\/noscript><\/span><\/a><br><br>\r\n      Published with MATLAB&reg; R2017a<br><\/p><\/div><!--\r\nfbd59e85e13747dcaaa91b54ebefd563 ##### SOURCE BEGIN #####\r\n%% Brad Efron's Nontransitive Dice\r\n% Do not get involved in a bar bet with Brad Efron and his dice until\r\n% you have read this.\r\n\r\n%% Brad Efron\r\n% Bradley Efron is the Max H. Stein Professor of Humanities and Sciences,\r\n% Professor of Statistics, and Professor of Biostatistics at Stanford.\r\n% He is best known for his invention of the bootstrap resampling\r\n% technique, which is a fundamental tool in computational\r\n% statistics.  In 2005, he received the National\r\n% Medal of Science.  But I think of him for something much less\r\n% esoteric REPLACE_WITH_DASH_DASH his nontransitive dice.  And I also remember him as one of\r\n% my roommates when we were both students at Caltech.\r\n\r\n%% Brad's wager\r\n% If you come across Brad in a bar some night, he might offer you\r\n% the following wager.  He would show you four individual dice,\r\n% like these.\r\n%\r\n% <<non_transitive_dice_1.jpg>>\r\n%\r\n% Photo credit: http:\/\/www.grand-illusions.com\r\n%\r\n% You would get to pick one of the dice.  He would then pick one for\r\n% himself.  You would then roll the dice a number of times, with the\r\n% player rolling the highest number each time winning a dollar.\r\n% (Rolling the same number is a _push_.  No money changes hands.) \r\n% Do you want to play?  I'll reveal the zinger REPLACE_WITH_DASH_DASH no matter which of \r\n% the four dice you choose, Brad can pick one that will win money from \r\n% you in the long run.\r\n\r\n%% Transitivity\r\n% A binary mathematical relationship, $\\rho$, is said to be _transitive_\r\n% if $x \\ \\rho \\ y$ and $y \\ \\rho \\ z$ implies $x \\ \\rho \\ z$.\r\n% _Equality_ is the obvious example.  If $x = y$ and $y = z$ then $x = z$.\r\n% Other examples include _greater than_, _divides_, and _subset_.\r\n\r\n%%\r\n% On the other hand, a relationship is _nontransitive_ if the\r\n% implication does not necessarily hold.  Despite their efforts to\r\n% make it transitive, _Facebook friend_ is still nontransitive.\r\n\r\n%% \r\n% Ordinarily, the term _dominates_, or _beats_ is\r\n% transitive.  And, ordinarily, you might think this applies to\r\n% dice games.  But, no, such thinking could cost you money.\r\n% Brad's dice are _nontransitive_.\r\n\r\n%% Brad's dice\r\n% Here are the six values on the faces of Brad's four dice.\r\n\r\n   A = [4 4 4 4 0 0];\r\n   B = [3 3 3 3 3 3];\r\n   C = [6 6 2 2 2 2];\r\n   D = [5 5 5 1 1 1];\r\n \r\n%%\r\n% How do these compare when paired up against each other?\r\n% It is obvious that |A| wins money from |B| because |B| rolls a\r\n% 3 all of the time, while |A| rolls a winning 4 two-thirds of the\r\n% time.  The odds are 2:1 in |A|'s favor.  Similarly |B|'s constant\r\n% 3's dominate |C|'s 2's two-thirds of the time.  The odds are 2:1\r\n% in |B|'s favor.\r\n\r\n%%\r\n% Comparing |C| with |D| is more complicated because neither rolls\r\n% a constant value..  We have to compare each possible\r\n% roll of one die with all the possible rolls of the other.  That's\r\n% 36 comparisons.  The comparison is facilitated by constructing\r\n% the following matrix.\r\n% The comparison of a row vector with a column vector is allowed under\r\n% MATLAB's new rules of _singleton expansion_. \r\n   \r\n   Z = (C > D') - (C < D')\r\n   \r\n%%\r\n% The result is a matrix |Z|\r\n% with +1 where |C| beats |D| and a -1 where |D| beats |C|.  There is a\r\n% submatrix of -1s in the upper right, but no solid column or row.\r\n% All that remains is to count the number of +1's and -1's to get the odds.\r\n\r\n   odds = [nnz(Z == +1) nnz(Z == -1)]\r\n\r\n%%\r\n% There are twice as many +1s as -1s, so, again, the odds are 2:1 that\r\n% |C| beats |D|.\r\n\r\n%%\r\n% But now how does |D| fair against |A|?\r\n\r\n   Z = (D > A') - (D < A')\r\n   odds = [nnz(Z == +1) nnz(Z == -1)]\r\n  \r\n%%\r\n% Again, there are twice as many +1s as -1s.  The odds are 2:1 in |D|'s \r\n% favor.\r\n\r\n%%\r\n% To summarize, |A| beats |B|, |B| beats |C|, |C| beats |D|, and \r\n% |D| beats |A|.  No matter which die you choose, Brad can pick\r\n% one that will beat it REPLACE_WITH_DASH_DASH and by a substantial margin.   It's\r\n% like \"Rock, Paper, Scissors\" with a fourth option, but you have\r\n% to make the first move.\r\n\r\n%% Compare\r\n% Let's capture that comparison in a function.\r\n% The function can print and label the matrix |Z|, as well as\r\n% provide for pushes, which we'll need later.\r\n\r\n   type compare\r\n\r\n%%\r\n% Use the function to compare |A| with |C|.\r\n\r\n   AvC = compare(A,C)\r\n   \r\n%%\r\n% Dividing out a common factor, that is odds of 4:5 against |A|.\r\n\r\n%%\r\n% The final possible comparison is |B| versus |D|.  |B|'s unimaginative\r\n% play results in complete rows of +1 or -1.\r\n\r\n   BvD = compare(B,D)\r\n\r\n%%\r\n% So |B| and |D| are an even match.  Here is the complete summary\r\n% of all possible pairings among Efron's Dice,\r\n\r\n%%\r\n%                A      B      C      D\r\n%          A           2:1    4:5    1:2\r\n%          B    1:2           2:1    1:1\r\n%          C    5:4    1:2           2:1\r\n%          D    2:1    1:1    1:2 \r\n\r\n%% Simulate\r\n% In case we don't believe these comparisons, or because we'd like to see\r\n% the shape of the distribution, or just because it's fun,\r\n% let's do some Monte Carlo simulations.  Because 108 is divisible\r\n% by 36, I'll make 108 rolls one game and simulate 10000 games. \r\n% Here is the code.\r\n\r\n   type simulate\r\n \r\n%%\r\n% I'll initialize the random number generator so that I get the same \r\n% results every time I |publish| this post.\r\n\r\n  rng(1)\r\n   \r\n%%\r\n% Now verify that |A| beats |B|.\r\n\r\n   simulate(A,B);\r\n   \r\n%%\r\n% Sure enough, the 2:1 odds imply that |A| can be expected to be\r\n% ahead by 108\/3 dollars after 108 flips.  There is a vertical \r\n% black line at zero to emphasize that this isn't a fair game.\r\n   \r\n%%\r\n% How about those 4:5 odds for |A| versus |C|?  |A| can be expected\r\n% to lose 108\/9 dollars with 108 flips.\r\n\r\n   simulate(A,C)\r\n   \r\n   \r\n%% Three dice nontransitive set\r\n% Efron's dice were introduced in a _Scientific American_ article\r\n% by Martin Gardner in 1970.  Since then a number of people have\r\n% found other sets of nontransitive dice with interesting properties.\r\n% The <https:\/\/en.wikipedia.org\/wiki\/Nontransitive_dice Wikipedia\r\n% article on nontransitive dice> has an abundance of information,\r\n% including the following set.  \r\n\r\n   A = [1 1 3 5 5 6];\r\n   B = [2 3 3 4 4 5];\r\n   C = [1 2 2 4 6 6];\r\n   \r\n%%\r\n% This set is very close to a conventional set.  The sum of the\r\n% numbers on each die is 21, the same as a conventional die.\r\n% And each die differs from a standard |1:6| die in only two\r\n% places.  Nevertheless, the set is nontransitive.  \r\n   \r\n%%\r\n% Since this is so close to a conventional set, we expect the\r\n% odds to be closer to even.  Let's see.\r\n\r\n   AvB = compare(A,B)\r\n   \r\n%%\r\n% Since the dice have matching values, we have some zeros in\r\n% the matrix.  |A| has only 17 winning values compared to |B|'s 15.\r\n\r\n   simulate(A,B)\r\n   \r\n%%\r\n% Here is the result all three pairwise comparisons.\r\n%\r\n%                A      B      C      \r\n%          A          17:15  15:17\r\n%          B   15:17         17:15\r\n%          C   17:15  15:17      \r\n\r\n##### SOURCE END ##### fbd59e85e13747dcaaa91b54ebefd563\r\n-->\r\n\r\n","protected":false},"excerpt":{"rendered":"<div class=\"overview-image\"><img decoding=\"async\"  class=\"img-responsive\" src=\"https:\/\/blogs.mathworks.com\/cleve\/files\/non_transitive_dice_1.jpg\" onError=\"this.style.display ='none';\" \/><\/div><!--introduction--><p>Do not get involved in a bar bet with Brad Efron and his dice until you have read this.... <a class=\"read-more\" href=\"https:\/\/blogs.mathworks.com\/cleve\/2017\/09\/11\/brad-efrons-nontransitive-dice\/\">read more >><\/a><\/p>","protected":false},"author":78,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":[],"categories":[5,4,6,8],"tags":[],"_links":{"self":[{"href":"https:\/\/blogs.mathworks.com\/cleve\/wp-json\/wp\/v2\/posts\/2660"}],"collection":[{"href":"https:\/\/blogs.mathworks.com\/cleve\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blogs.mathworks.com\/cleve\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blogs.mathworks.com\/cleve\/wp-json\/wp\/v2\/users\/78"}],"replies":[{"embeddable":true,"href":"https:\/\/blogs.mathworks.com\/cleve\/wp-json\/wp\/v2\/comments?post=2660"}],"version-history":[{"count":3,"href":"https:\/\/blogs.mathworks.com\/cleve\/wp-json\/wp\/v2\/posts\/2660\/revisions"}],"predecessor-version":[{"id":2673,"href":"https:\/\/blogs.mathworks.com\/cleve\/wp-json\/wp\/v2\/posts\/2660\/revisions\/2673"}],"wp:attachment":[{"href":"https:\/\/blogs.mathworks.com\/cleve\/wp-json\/wp\/v2\/media?parent=2660"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blogs.mathworks.com\/cleve\/wp-json\/wp\/v2\/categories?post=2660"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blogs.mathworks.com\/cleve\/wp-json\/wp\/v2\/tags?post=2660"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}