Odds of two dice roll

31.4k Views Asked by At

If we roll two dice, what are the odds that we roll one five OR the sum of the rolled dice equals an odd number?

The odds of rolling one five from two dice rolls is $\frac{1}{36}$. The odds of rolling an odd number from the sum of two rolls requires that we roll one even number from one die and an odd number from another die. The odds of this happening are $\frac{1}{2}$.

Therefore, the odds of either even occuring should be: $\frac{1}{36} + \frac{1}{2} = \frac{19}{36}$

However, this is incorrect. Apparently the answer is $\frac{23}{36}$. I do not understand why. I wrote a python script to evaluate my odds:

import random

def rolldice(count):
    return [random.randint(1, 6) for i in range(count)]

def compute_odd(dice):
    return sum(dice) % 2 == 1

def has_num_only(dice, num):
    return dice.count(num) == 1

g_iEvents = 0
g_iSimulations = 8888

for i in range(g_iSimulations):
    dice = rolldice(2)
    if compute_odd(dice) or has_num_only(dice, 5):
        g_iEvents += 1

print( float(g_iEvents) / float(g_iSimulations) )
print( g_iEvents )
print( g_iSimulations )

After several runs, I keep getting the answer of 61% - Therefore this is showing that both answers are incorrect.

4

There are 4 best solutions below

1
On BEST ANSWER

When you roll 2 dice there are 36 equally likely options, starting at double one, $(1,1)$, and going all the way to double six, $(6,6)$. Of these, there are 11 equally likely ways to roll a $5$, $(1,5), (2,5), (3,5), (4,5), (5,5), (6,5), (5,1), (5,2), (5,3),(5,4),(5,6)$, so the odds of rolling a 5 is $\frac{11}{36}$.

Similarly there are 18 equally likely ways to roll an odd number (I'll let you think about which combinations these are), so the odds of rolling an odd number are $\frac{18}{36}=\frac{1}{2}$.

At this point you may think the odds of rolling a $5$ or and odd number should be $\frac{11}{36}+\frac{18}{36}=\frac{29}{36}$, however this is not the case. Note that six of the rolls contain both a $5$ and are odd:

$(2,5), (4,5), (6,5), (5,2), (5,4),(5,6)$

If we just add the two probabilities, we'll count these situations twice, even though they're no more likely to occur than any other combination! In reality there are only $11+18-6=23$ dice rolls which contain a $5$ or are odd (see if you can list them), and so the odds of rolling either a $5$ or an odd combination is $\frac{11}{36}+\frac{18}{36}-\frac{6}{36}=\frac{23}{36}$.

This is a simple application of the "principle of inclusion and exclusion", which you may want to look up.

3
On

We need to interpret the question.

We will be happy if we get an odd sum or if we get at least one five, or if both events happen. We want to find the probability of being happy.

In "set" notation, let $A$ be the event "odd sum" and let $B$ be the event "at least one $5$. We want $\Pr(A\cup B)$. By a formula you may be familiar with, we have $$\Pr(A\cup B)=\Pr(A)+\Pr(B)-\Pr(A\cap B).$$ We compute the three probabilities on the right.

For $\Pr(A)$, we can make a list of all the outcomes on the red and green die that yield an odd sum. Or we can use a simpler argument. We find $\Pr(A)=\frac{1}{2}$.

For $\Pr(B)$, it is easiest to find the probability of no $5$. There are $5$ ways the green die can yield something other than a $5$, and for each such way there are $5$ ways that the red can give a non-$5$. So the probability of not getting any $5$ is $\frac{25}{36}$. Thus $\Pr(B)=\frac{11}{36}$.

For $\Pr(A\cap B)$, make a list. We get an odd sum and at least one $5$ in the following ways: $(5,2),(2,5), (5,4), (4,5), (5,6), (6,5)$. Thus $\Pr(A\cap B)=\frac{6}{36}$. (One could show this faster!)

Our required probability is therefore $\frac{1}{2}+\frac{11}{36}-\frac{6}{36}$.

3
On
n = 0
fives = 0
odds = 0

for i in range (1,7) :
    for j in range (1,7) :
        n = n + 1
        if (i is 5) or (j is 5) :
            fives = fives + 1
        elif ( (i +j) % 2 == 1 ) :
            odds = odds + 1 
print fives
print odds
print  n

$ python dice.py

11
12
36

0
On

Are you looking for probability or Odds?

The formula for finding odds is: favorable outcome/unfavourable outcome.

The probability of rolling an odd number is 18/36 but the odds would be 18/(18-36) or 18:18 which would give you 1:1 odds. If my explanation is lacking, there is a good explanation on this site:

http://stats.seandolinar.com/statistics-probability-vs-odds/