Kernel: Python 3
In [2]:
The goblin problem
In Dungeons and Dragons, the amount of damage a goblin can withstand is the sum of two six-sided dice. The amount of damage you inflict with a short sword is determined by rolling one six-sided die.
Suppose you are fighting a goblin and you have already inflicted 4 points of damage. What is your probability of defeating the goblin with your next successful attack?
(Where "defeat" means that the goblin can withstand no more damage.)
Note: You can solve this problem with paper and pencil or computationally; you can solve it using Bayes's Theorem, combinatorics, or using the Pmf class.
In [6]:
1 0.16666666666666666
2 0.16666666666666666
3 0.16666666666666666
4 0.16666666666666666
5 0.16666666666666666
6 0.16666666666666666
In [8]:
2 0.027777777777777776
3 0.05555555555555555
4 0.08333333333333333
5 0.1111111111111111
6 0.1388888888888889
7 0.16666666666666669
8 0.1388888888888889
9 0.1111111111111111
10 0.08333333333333333
11 0.05555555555555555
12 0.027777777777777776
In [10]:
2 0.0
3 0.0
4 0.0
5 0.1333333333333333
6 0.16666666666666663
7 0.19999999999999998
8 0.16666666666666663
9 0.1333333333333333
10 0.09999999999999998
11 0.06666666666666665
12 0.033333333333333326
In [13]:
-2 0.0
-1 0.0
0 0.0
1 0.1333333333333333
2 0.16666666666666663
3 0.19999999999999998
4 0.16666666666666663
5 0.1333333333333333
6 0.09999999999999998
7 0.06666666666666665
8 0.033333333333333326
In [16]:
0.5499999999999998