Dice Game: 6-sided die vs 20-sided die

  • Thread starter Thread starter Master1022
  • Start date Start date
  • Tags Tags
    Dice Game
AI Thread Summary
In the discussion about a game involving a 20-sided die versus three 6-sided dice, participants analyze the fairness and expected outcomes based on probability. Both dice sets have the same expected value of 10.5, but the variance differs, with the three 6-sided dice having lower variance. The game’s fairness is questioned, particularly regarding the impact of specific winning numbers; the 20-sided die has winning scores (19 and 20) that cannot be matched by the three 6-sided dice. Simulations suggest that while both sets are equal in average outcomes, the 20-sided die has a slight edge due to its higher maximum potential. Overall, the consensus is that the game is generally fair, but the 20-sided die may be preferable in certain scenarios.
Master1022
Messages
590
Reaction score
116
Homework Statement
There is a game where one person rolls a 20-sided dice and another person rolls three 6-sided dice. They both roll their dice and whoever gets a sum of numbers wins the game. Which person would you rather be? Is it a fair game?
Relevant Equations
Expectation and variance
Hi,

I was taking a look at the following question.

Question: There is a game where one person rolls a 20-sided dice and another person rolls three 6-sided dice. They both roll their dice and whoever gets a higher number (for 20-sided die) OR sum of numbers (for three 6-sided dice) wins the game. Which person would you rather be? Is it a fair game? Assume the dice are all fair

Attempt:
I think the general concept is about looking at expectation and variance for both cases and then make a decision from there.

So for the person with the 20-sided die, the expectation and variance are given by:
E(\text{20 sided die}) = \frac{n + 1}{2} = \frac{21}{2} = 10.5
Var(\text{20 sided die}) = \frac{n^2 - 1}{12} = \frac{(20)^2 - 1}{12} = \frac{399}{12}

For the person with the three 6-sided dice:
E(\text{three 6 sided die}) = E(X_1 + X_2 + X_3) = 3 \cdot E(\text{one 6 sided die}) = 3 \cdot \frac{7}{2} = 10.5
Var(\text{three 6 sided die}) = Var(X_1 + X_2 + X_3) = 3 \cdot \frac{n^2 - 1}{12} = 3 \cdot \frac{(6)^2 - 1}{12} = \frac{35}{4}

Thus, both of the distributions have the same expected value/mean. Therefore, perhaps we would rather be the person who chooses the lower variance side, which is the three 6-sided die. Does that seem reasonable?

Also, what does the 'is the game fair' part mean? Is that basically asking if the mean and variance are the same? If so, then based on the calculations above, I would say the game isn't fair...

Any help would be greatly appreciated.
 
Last edited:
Physics news on Phys.org
It kind of depends on the number to win.If the number is 10 or 11, then
- the 1D20 has a 1-in-20 chance of winning
- the 3D6 have a 27-in-216 (1-in-12.5) chance of winning .

If the number is 3 or 18, then
- the 1D20 has a 1-in-20 chance of winning
- the 3D6 have a 1-in-216 chance of winning.

Heck, if the number is 1, the 3D6 has a zero chance of winning.

Or am I misunderstanding the rules?
 
DaveC426913 said:
It kind of depends on the number to win.

If the number is 3 (or 18), then
- the 1D20 has a 1:20 chance of winning
- the 3D6 have a 1:216 chance of winning.

Heck, if the number is 1, the 3D6 has a zero chance of winning.

Or am I mis-understanding the rules?
Hi @DaveC426913 , thanks for the reply! Sorry, I think there was a word missing from my original question. Basically, the person with the three 6-sided die adds up their 3 numbers and compares the sum to the 1 number from the person who rolled the 20-sided die. Then whichever number is higher wins the game.

Apologies - I hope this is more clear
 
Master1022 said:
whichever number is higher wins the game.
Ah.

There's a super-duper easy way to answer this question, but your teach might not like it.
 
  • Wow
Likes Master1022
DaveC426913 said:
Ah.

There's a super-duper easy way to answer this question, but your teach might not like it.
Does it have something to do with the fact that the 20-sided die has two cases which cannot be beaten by the other player (19 and 20)? Or should I continue thinking along the mean and variance line?
 
For both dice sets, the probability curve is symmetrical.

You could just as easily make the rule "whoever gets the lowest score wins" and you have the exact same problem with the exact same solution - just mirrored.

I could produce a graph of the probabilities and show them to you horizontally flipped or unflipped, and you would not be able to tell me which rule is applied.

Therefore, neither dice set can have an advantage.

Your teacher will not like this answer because it doesn't help you practice the math - although it might help you intuit and verify the math..
 
  • Like
  • Informative
Likes Master1022 and jbriggs444
DaveC426913 said:
For both dice sets, the probability curve is symmetrical.

You could just as easily make the rule "whoever gets the lowest score wins" and you have the exact same problem with the exact same solution - just mirrored.

I could produce a graph of the probabilities and show them to you horizontally flipped or unflipped, and you would not be able to tell me which rule is applied.

Therefore, neither dice set can have an advantage.
Okay thank you, I agree with regards to the symmetry. However, would the variance come into consideration if we had to choose one set with which to play the game?
 
Master1022 said:
Okay thank you, I agree with regards to the symmetry. However, would the variance come into consideration if we had to choose one set with which to play the game?
Both set of dice average 10.5. If the goal is to get the highest sum, then they are equal.
 
  • Like
Likes Master1022
Master1022 said:
However, would the variance come into consideration if we had to choose one set with which to play the game?
Not really. It would only indicate if you lost (won) a roll by a lot or a little. If the expected values are equal, then the game is fair.
 
  • Like
  • Informative
Likes Master1022 and phyzguy
  • #10
Note that my "solution" is off-topic for the Mathematics Homework forum (though it might be on-topic in a Mathematics or Logic forum).
 
  • #12
Master1022 said:
Okay thank you, I agree with regards to the symmetry. However, would the variance come into consideration if we had to choose one set with which to play the game?
Symmetry, not variance, is the key.
 
  • Wow
Likes Master1022
  • #13
DaveC426913 said:
Your teacher will not like this answer because it doesn't help you practice the math - although it might help you intuit and verify the math..
I'm not sure the student is supposed to crunch the numbers here, in terms of probability calculations. If anything, I'd do a computer simulation to check the symmetry argument.
 
  • #14
PeroK said:
I'm not sure the student is supposed to crunch the numbers here, in terms of probability calculations.
I guess. My solution bypass any math completely. Not sure if an elegant, intuitive proof is allowed.
PeroK said:
If anything, I'd do a computer simulation to check the symmetry argument.
You mean check that a D20 has a symmetrical distribution, and that 3D6 has a symmetrical distribution?
That's too trivial to warrant a simulation is it not? It's self-evident.
 
  • #15
DaveC426913 said:
I guess. My solution bypass any math completely. Not sure if an elegant, intuitive proof is allowed.

You mean check that a D20 has a symmetrical distribution, and that 3D6 has a symmetrical distribution?
That's too trivial to warrant a simulation is it not? It's self-evident.
Your solution is probably what is expected.

There's no harm in running a simulation just to confirm. Even just writing the code may give an insight into why the symmetry argument works.
 
  • Like
Likes jedishrfu
  • #16
When in doubt, write a program to figure it out.
 
  • Like
Likes Master1022, Dale and berkeman
  • #17
jedishrfu said:
When in doubt, write a program to figure it out.
Or use Excel... :smile:
 
  • Haha
Likes jedishrfu
  • #18
berkeman said:
Or use Excel... :smile:
Gloria in excel-sis deo!
 
  • Haha
Likes SammyS, jedishrfu and berkeman
  • #19
If you turn it into a three person game, variance becomes a useful heuristic and the d20 has an advantage.
 
  • Like
Likes PeroK
  • #20
jbriggs444 said:
If you turn it into a three person game, variance becomes a useful heuristic and the d20 has an advantage.
That depends on what the third player has, I imagine!
 
  • Like
Likes jbriggs444
  • #21
PeroK said:
That depends on what the third player has, I imagine!
Indeed. We might constrain the third player to a set of dice with an expectation of 10.5. Or to a choice between 3d6 and 1d20.
 
  • #22
jbriggs444 said:
Indeed. We might constrain the third player to a set of dice with an expectation of 10.5. Or to a choice between 3d6 and 1d20.
I see what you mean. The D20 player can't be worse, it seems. If the third player has a two-sided die showing 0 and 21, then the D20 and the 3xD6 are still equal.
 
  • #23
PeroK said:
I see what you mean. The D20 player can't be worse, it seems. If the third player has a two-sided die showing 0 and 21, then the D20 and the 3xD6 are still equal.
I think that against an intentionally sub-optimal and asymmetric third player with something like a 5, 5, 5, 6, 21, 21 that you can get an advantage with a symmetric low variance (3d6) over a symmetric high variance (1d20).
 
  • #24
jbriggs444 said:
I think that against an intentionally sub-optimal and asymmetric third player with something like a 5, 5, 5, 6, 21, 21 that you can get an advantage with a symmetric low variance (3d6) over a symmetric high variance (1d20).
I did a Python simulation and there seems to be a slight edge to D20 there. For simplicity I didn't count draws, only when one player won.

I can't immediately find any third option that gives 3D6 an advantage over D20.
 
  • #25
PS I assigned the third player a fixed score of everything from 1-20 and there is no score that creates an advantage for 3D6. The higher the number, the greater the advantage to D20.

Therefore, there is no combination of numbers for the third player that gives 3D6 an advantage.
 
  • Like
Likes jbriggs444
  • #26
PeroK said:
There's no harm in running a simulation just to confirm.
Here's a Python simulation with two players as in the original problem.
Python:
from random import choice

SixDie = [1, 2, 3, 4, 5, 6]
TwentyDie = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20]
SDTotal = 0
TDTotal = 0

NTrials = 1000000
for i in range(0, NTrials+1):
   SDScore = choice(SixDie) +  choice(SixDie) +  choice(SixDie)
   SDTotal += SDScore
   TDScore =  choice(TwentyDie)
   TDTotal += TDScore

print("Six dice average: ", {SDTotal / NTrials})
print("Twenty die average:  ", {TDTotal / NTrials})
Output with 1,000,000 trials is
Code:
Six dice average:  {10.501267}
Twenty die average:   {10.501052}
Running time in Python is about 8 seconds.
 
  • #27
The game is who wins the most; not the highest average. The average scores are clearly equal.

Anyway, if a third player is involved, then in general the 20-sided die is better than the three 6-sided dice - or, at least, no worse.
 
  • #28
PeroK said:
I did a Python simulation and there seems to be a slight edge to D20 there. For simplicity I didn't count draws, only when one player won.
I had forgotten that the aim was to see which was the winner. I edited my Python code to count wins, and saw a slight advantage for 1D20, likely for the reason already given, that for a 20-sided die, there are possible scores of 19 and 20 that can't be matched by three 6-sided dice.

If we modify the game with four 5-sided dice (no such Platonic solid exists, but never mind) vs. the 20-sided die, the four 5-sided dice have a clear advantage. Each has an expected value of 3, so the expected value of four of them would be 12, which is higher than the 10.5 expected value for the 20-sided die.
 
  • #29
Mark44 said:
I had forgotten that the aim was to see which was the winner. I edited my Python code to count wins, and saw a slight advantage for 1D20, likely for the reason already given, that for a 20-sided die, there are possible scores of 19 and 20 that can't be matched by three 6-sided dice.
By a symmetry argument the game is equal. The automatically winning scores of 19 and 20 are counterbalanced by the losing scores of 1 and 2. Likewise scores of 18 and 3 counterbalance etc.
 
  • Like
  • Informative
Likes Master1022 and pbuk
  • #30
PeroK said:
The game is who wins the most; not the highest average. The average scores are clearly equal.

Anyway, if a third player is involved, then in general the 20-sided die is better than the three 6-sided dice - or, at least, no worse.
Can you specify how the third player is involved? I am confused by this.
 
  • Like
Likes Master1022
  • #31
FactChecker said:
Can you specify how the third player is involved? I am confused by this.
You have a third player with a third way of scoring. It could be anything. Absolutely anything. Then, excluding draws between two or more players, you count how often each player wins outright.

The hypothesis is that the 20-sided die is never worse than the three 6-sided dice. And, in general, is almost always better.
 
  • #32
PeroK said:
You have a third player with a third way of scoring. It could be anything. Absolutely anything. Then, excluding draws between two or more players, you count how often each player wins outright.

The hypothesis is that the 20-sided die is never worse than the three 6-sided dice. And, in general, is almost always better.
Is the third player rolling another 20-sided die, or another set of three 6-sided die, or doesn't it matter?
Before I think hard about it, I want to know what I am thinking hard about. :-)
 
  • #33
FactChecker said:
Is the third player rolling another 20-sided die, or another set of three 6-sided die, or doesn't it matter?
It could be those or anything at all. They might get a fixed score of 15 every time; or scores of 5 or 10 with equal probability; or, absolutely anything.
 
  • #34
PeroK said:
It could be those or anything at all. They might get a fixed score of 15 every time; or scores of 5 or 10 with equal probability; or, absolutely anything.
So, as long as the winner has to beat two others, it is an advantage to have a larger variance than at least one other (and not less than others). Is that what you are saying? I'll buy that.
(That is, given equal means.)
 
Last edited:
  • Like
Likes PeroK
  • #35
Mark44 said:
NTrials = 1000000
for i in range(0, NTrials+1):
That loop will execute 1,000,001 times.
 
  • #36
pbuk said:
That loop will execute 1,000,001 times.
I realized that when I counted the total wins for each set and the ties.
 
  • #37
pbuk said:
That loop will execute 1,000,001 times.
Complete enumeration of the probability space for the two-way competition is way cheaper than that.

I did a complete enumeration for a 3-way competition and only needed 25,920 cases. My intuition about 3d6 beating 1d20 in a three way match against (5, 5, 5, 6, 21, 21) was faulty.

Scoring: win = 6 points, 2 way tie = 3 points, 3 way draw = 2 points each.
Code:
C:\>test.pl
Player 1 (3d6)           scores 50972 points
Player 2 (1d20)          scores 51632 points
Player 3 (5,5,5,6,21,21) scores 52916 points

Player 1 (3d6)           rolled a mean of 10.5 pips per roll
Player 2 (1d20)          rolled a mean of 10.5 pips per roll
Player 3 (5,5,5,6,21,21) rolled a mean of 10.5 pips per roll

There were 25920 combinations with a total of 155520 points available
The total points awarded were 155520
The code for this is somewhat verbose with extra sanity-checking, but is fairly straightforward.
Perl:
#!/usr/bin/perl

use strict;
use warnings;

# Points = winning points: 6 = clear win, 3 = two-way tie, 2 = three-way tie
my $p1_points = 0;
my $p2_points = 0;
my $p3_points = 0;

# Total = total pips rolled
my $p1_total = 0;
my $p2_total = 0;
my $p3_total = 0;

my $total_combos = 0;

sub scores ( $$$$$ );

foreach my $d1 ( 1, 2, 3, 4, 5, 6 ) {
    foreach my $d2 ( 1, 2, 3, 4, 5, 6 ) {
        foreach my $d3 ( 1, 2, 3, 4, 5, 6 ) {
            foreach my $d4 ( 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20 ) {
                foreach my $d5 ( 5, 5, 5, 6, 21, 21 ) {
                    my @result = scores ( $d1, $d2, $d3, $d4, $d5 );
                    $p1_points = $p1_points + $result[0];
                    $p2_points = $p2_points + $result[1];
                    $p3_points = $p3_points + $result[2];
                    $p1_total = $p1_total + $result[3];
                    $p2_total = $p2_total + $result[4];
                    $p3_total = $p3_total + $result[5];
                    $total_combos = $total_combos + 1;
                };
            };
        };
    };
};

if ( $total_combos != 6 * 6 * 6 * 20 * 6 ) {
    print STDERR "Calculated total combinations is ", 6 * 6 * 6 * 20 * 6, " but this code found $total_combos instead\n";
    exit;
};

print "Player 1 (3d6)           scores $p1_points points\n";
print "Player 2 (1d20)          scores $p2_points points\n";
print "Player 3 (5,5,5,6,21,21) scores $p3_points points\n";
print "\n";
print "Player 1 (3d6)           rolled a mean of ", $p1_total/$total_combos, " pips per roll\n";
print "Player 2 (1d20)          rolled a mean of ", $p2_total/$total_combos, " pips per roll\n";
print "Player 3 (5,5,5,6,21,21) rolled a mean of ", $p3_total/$total_combos, " pips per roll\n";
print "\n";
print "There were $total_combos combinations with a total of ", $total_combos * 6, " points available\n";
print "The total points awarded were ", $p1_points + $p2_points + $p3_points, "\n";

sub scores ( $$$$$ ) {
    my $p1d1 = $_[0];
    my $p1d2 = $_[1];
    my $p1d3 = $_[2];
    my $p2d1 = $_[3];
    my $p3d1 = $_[4];

    # Player 1 scores 3d6
    my $p1_score = $p1d1 + $p1d2 + $p1d3;

    # Player 2 scores 1d20
    my $p2_score = $p2d1;

    # Player 3 scores pips equal to 5, 5, 5, 6, 21, 21 on a d6;
    my $p3_score = $p3d1;

    if ( $p1_score > $p2_score && $p1_score > $p3_score ) {
        return ( 6, 0, 0, $p1_score, $p2_score, $p3_score );
    } elsif ( $p2_score > $p1_score && $p2_score > $p3_score ) {
        return ( 0, 6, 0, $p1_score, $p2_score, $p3_score );
    } elsif ( $p3_score > $p1_score && $p3_score > $p2_score ) {
        return ( 0, 0, 6 , $p1_score, $p2_score, $p3_score);
    } elsif ( $p1_score == $p2_score && $p1_score > $p3_score ) {
        return ( 3, 3, 0, $p1_score, $p2_score, $p3_score );
    } elsif ( $p1_score == $p3_score && $p1_score > $p2_score ) {
        return ( 3, 0, 3, $p1_score, $p2_score, $p3_score );
    } elsif ( $p2_score == $p3_score && $p2_score > $p1_score ) {
        return ( 0, 3, 3, $p1_score, $p2_score, $p3_score );
    } elsif ( $p1_score == $p2_score && $p1_score == $p3_score ) {
        return ( 2, 2, 2, $p1_score, $p2_score, $p3_score );
    } else {
        print STDERR "No clear winner, no two way tie, no three way tie. What is going on?\n";
        print STDERR "Player 1: $p1d1 $p1d2 $p1d3 = $p1_score\n";
        print STDERR "Player 2: $p2d1 = $p2_score\n";
        print STDERR "Player 3: $p3d1 = $p3_score\n";
        exit;
    };
};
 
  • Like
Likes FactChecker and PeroK
  • #38
PeroK said:
PS I assigned the third player a fixed score of everything from 1-20 and there is no score that creates an advantage for 3D6.
That cannot be true: 3D6 will always beat 1 or 2 whereas D20 will sometimes lose.
 
  • #39
pbuk said:
That cannot be true: 3D6 will always beat 1 or 2 whereas D20 will sometimes lose.
A third player score of 1 or 2 leaves the contest between 3D6 and D20 level. In terms of outright wins.

PS the third player must score at least 3 to influence the contest.
 
  • Like
Likes pbuk
  • #40
jbriggs444 said:
Complete enumeration of the probability space for the two-way competition is way cheaper than that.
Indeed. For non-linear problems (and you can't get much more non-linear than win/lose) Monte-Carlo methods are not in general worthwhile.

jbriggs444 said:
I did a complete enumeration for a 3-way competition and only needed 25,920 cases. My intuition about 3d6 beating 1d20 in a three way match against (5, 5, 5, 6, 21, 21) was faulty.
I suspect 3d6 may score better against [2, 2, 2, 36] (particularly if you only count clear wins) but I can't be bothered to fire up a Linux instance at the moment to test your Perl script :-p

Your post would have received a like if it hadn't been in Perl :rolleyes:
 
  • #41
pbuk said:
I suspect 3d6 may score better against [2, 2, 2, 36] (particularly if you only count clear wins) but I can't be bothered to fire up a Linux instance at the moment to test your Perl script :-p
You suspect wrongly!
 
  • Like
Likes pbuk
  • #42
PeroK said:
A third player score of 1 or 2 leaves the contest between 3D6 and D20 level. In terms of outright wins.

PS the third player must score at least 3 to influence the contest.
Yes of course, I missed that point.
PeroK said:
You suspect wrongly!
Yes, because of the above, although for this case d20 and 3d6 should be equal because of the same point?

In fact [2, 2, 2, 36] will win 1/4 of the time with d20 and 3d6 each 3/8 (not counting ties)?
 
  • Like
Likes PeroK
  • #43
pbuk said:
Yes of course, I missed that point.

Yes, because of the above, although for this case d20 and 3d6 should be equal because of the same point?

In fact [2, 2, 2, 36] will win 1/4 of the time with d20 and 3d6 each 3/8 (not counting ties)?
If we take player 3 scores from 1 to 20 inclusive and run 100,000 games, the wins for D20 and 3D6 are:

47354 47644
47666 47388
47456 47454
47484 47313
47265 46809
46984 45773
46870 43375
45993 40052
44605 35698
42625 29718
40302 23573
37067 17194
33381 11238
28932 7031
24434 3637
19949 1559
15091 378
9910 0
5084 0
0 0

The low scores leave the contest fairly even, but from 3 onwards 3D6 loses more winning games than D20. You could actually compute the probabilities fairly easily, and prove the matter. I might try that now.
 
  • Like
Likes jbriggs444
  • #44
pbuk said:
Yes of course, I missed that point.

Yes, because of the above, although for this case d20 and 3d6 should be equal because of the same point?

In fact [2, 2, 2, 36] will win 1/4 of the time with d20 and 3d6 each 3/8 (not counting ties)?
Counting ties...
Code:
C:\>test2.pl
Player 1 (3d6)           scores 38880 points
Player 2 (1d20)          scores 38880 points
Player 3 (2,2,2,36)      scores 25920 points

Player 1 (3d6)           rolled a mean of 10.5 pips per roll
Player 2 (1d20)          rolled a mean of 10.5 pips per roll
Player 3 (2,2,2,36)      rolled a mean of 10.5 pips per roll

There were 17280 combinations with a total of 103680 points available
The total points awarded were 103680
 
  • #45
pbuk said:
Your post would have received a like if it hadn't been in Perl :rolleyes:
Real programmers can write Fortran in any language.
 
  • Haha
  • Wow
Likes Master1022, FactChecker and pbuk
  • #46
PeroK said:
You could actually compute the probabilities fairly easily, and prove the matter. I might try that now.
Here are the probabilities:

Player 3 scores 1, D20 wins 0.4750, 3D6 wins 0.4750
Player 3 scores 2, D20 wins 0.4750, 3D6 wins 0.4750
Player 3 scores 3, D20 wins 0.4750, 3D6 wins 0.4745
Player 3 scores 4, D20 wins 0.4748, 3D6 wins 0.4725
Player 3 scores 5, D20 wins 0.4738, 3D6 wins 0.4669
Player 3 scores 6, D20 wins 0.4715, 3D6 wins 0.4553
Player 3 scores 7, D20 wins 0.4669, 3D6 wins 0.4345
Player 3 scores 8, D20 wins 0.4588, 3D6 wins 0.4005
Player 3 scores 9, D20 wins 0.4458, 3D6 wins 0.3542
Player 3 scores 10, D20 wins 0.4271, 3D6 wins 0.2979
Player 3 scores 11, D20 wins 0.4021, 3D6 wins 0.2354
Player 3 scores 12, D20 wins 0.3708, 3D6 wins 0.1718
Player 3 scores 13, D20 wins 0.3338, 3D6 wins 0.1134
Player 3 scores 14, D20 wins 0.2919, 3D6 wins 0.0683
Player 3 scores 15, D20 wins 0.2465, 3D6 wins 0.0359
Player 3 scores 16, D20 wins 0.1988, 3D6 wins 0.0150
Player 3 scores 17, D20 wins 0.1498, 3D6 wins 0.0039
Player 3 scores 18, D20 wins 0.1000, 3D6 wins 0.0000
Player 3 scores 19, D20 wins 0.0500, 3D6 wins 0.0000
Player 3 scores 20, D20 wins 0.0000, 3D6 wins 0.0000
 
  • #47
pbuk said:
Indeed. For non-linear problems (and you can't get much more non-linear than win/lose) Monte-Carlo methods are not in general worthwhile.
I disagree. In fact, those are the situations where theoretical calculations get so tricky that Monte-Carlo methods have a significant advantage. Even if one can get an analytical answer, I would not completely trust it if it did not agree with a Monte-Carlo simulation. I have seen examples in this forum where a very complicated thread eventually (after several days) arrived at the same answer that a 10 minute Monte-Carlo simulation gave.
pbuk said:
I suspect 3d6 may score better against [2, 2, 2, 36] (particularly if you only count clear wins) but I can't be bothered to fire up a Linux instance at the moment to test your Perl script :-p
It is easy to install in Windows. In fact, my experience is that some tools that I used on Windows machines had Perl as part of their installation.
pbuk said:
Your post would have received a like if it hadn't been in Perl :rolleyes:
Boo! I have known people who have the silliest complaints about Perl. Perl has some significant advantages for many scripting applications.
 
  • #48
FactChecker said:
I disagree. In fact, those are the situations where theoretical calculations get so tricky that Monte-Carlo methods have a significant advantage. Even if one can get an analytical answer, I would not completely trust it if it did not agree with a Monte-Carlo simulation. I have seen examples in this forum where a very complicated thread eventually (after several days) arrived at the same answer that a 10 minute Monte-Carlo simulation gave.
Here's a simple example of what I mean. The UK national lottery draw is six unique numbers 1..59 so the chance of a winning ticket is trivially 1 in ## {59 \choose 6} = 45,057,474 ##. How many Monte Carlo trials would you need to reliably get close to the analytic solution?

The problem in the OP is another example: the symmetry argument leads instantly to the correct 50:50 answer, and @jbriggs444's complete enumeration verifies that with only 25,920 evaluations. A Monte Carlo method would require many more trials and would be no easier to program than the complete enumeration.

Even when the solution space is sufficiently large that complete enumeration is not feasible, a divide and conquer approach will often lead to an exact solution.

But yes, when analytic, enumerative and divide and conquer and similar methods fail then Monte Carlo may be all that's left - but unless there is some smoothness to the problem you can't be sure that you haven't over- or under-estimated the frequency of 'unicorns'.
 
  • #49
pbuk said:
Here's a simple example of what I mean. The UK national lottery draw is six unique numbers 1..59 so the chance of a winning ticket is trivially 1 in ## {59 \choose 6} = 45,057,474 ##. How many Monte Carlo trials would you need to reliably get close to the analytic solution?
Yes. Trivial problems are easier to solve analytically. I wish that I lived in a trivial world.

Now, suppose that every even number, n, tentatively picked, was rejected with a probability of 1/n. I can modify the Monte-Carlo simulation in a minute. How easy is the analytic solution? There are a million things that can, and do, occur like that.
 
Last edited:
  • #50
FactChecker said:
Now, suppose that every even number, n, tentatively picked, was rejected with a probability of 1/n. I can modify the Monte-Carlo simulation in a minute. How easy is the analytic solution?
If you think about it, the only way to get any accuracy would be to calculate the probability for each individual ball using a Monte Carlo method (with only 39 outcomes with the minimum frequency (for 2) better than 1 in 78 this should be computable with very high confidence of accuracy) and then use an analytic method to calculate the probability of any given choice. If you just go looking for that needle in the haystack you are still going to need billions of trials to reliably get anywhere near.

FactChecker said:
Yes. Trivial problems are easier to solve analytically. I wish that I lived in a trivial world.
And anlytically solvable problems can be solved analytically and feasibly enumerable problems can be solved by complete enumeration; in neither case are they better solved by Monte Carlo. Your argument is analagous to 'I have to bang in a lot of nails so whenever I need to fix a screw or a pop rivet I reach for the hammer'.
 
Back
Top