Kernel: Python 3 (system-wide)
Dice Roll Game
Simulations in Python
In [2]:
In [3]:
Then, we have to list all wanted results. Which is basically all possible set of pairs, and each set has two wanted result where the first pair adds up to 7 and the second pair adds up to 9, or vice-versa. And which we got:
Set 1 = (D1+D2==7 and D3+D4==9) or (D1+D2 ==9 and D3+D4==7) Set 2 = (D2+D3==7 and D1+D4==9) or (D2+D3 ==9 and D1+D4==7) Set 3 = (D2+D4==7 and D1+D3==9) or (D2+D4 ==9 and D1+D3==7)
In [8]:
In [12]:
0.07399
Computer the probability
In [13]:
(3, 6)
(4, 5)
(5, 4)
(6, 3)
In [15]:
(1, 6)
(2, 5)
(3, 4)
(4, 3)
(5, 2)
(6, 1)
In [17]:
0.07407407407407407
Conclusion
In [0]: