Probability in the Game of Craps
Table of Contents
Definining the Game
Craps is a dice game. The most basic bet in craps is the Pass Line Bet (or betting “with the dice”). It works as follows1. In the first roll (the “come out roll”), you roll a pair of dice and sum their outcomes:
- You win if you roll a 7 or 11
- You lose if you roll a 2, 3, or 12
- For any other roll (4, 5, 6, 8, 9, 10), you neither win nor lose but establish a “point”
- Once you’ve rolled a point you can only win the game if you roll the same point again before rolling a 7. If you roll a 7 first, you lose (aka to “seven out” or to “crap out”)
Probability Space of Two-Dice Throws
In probability theory, a probability space or a probability triple (\(\Omega, \mathcal {F}, P \)), is a mathematical construct that provides a formal model of a random process or “experiment”. Let’s review each component.
Theory
-
\(\Omega \): represents the sample space, that is to say, the set of all possible outcomes or elementary events from the relevant experiment. In this case, the experiment is throwing two dice, and the elementary events are given by every possible combination of the 2 throws. Each die has 6 values, so the sample space has cardinality 36 (6x6).
-
\(\mathcal {F}\): represents the event space. Events are relevant subsets of the sample space that we wish to study. For example, rolling a 3 is the event given by the subset of outcomes \( \{(1-2), (2-1)\} \), of cardinality 2.
-
\(P\): represents the probability function, which assigns a number from 0 to 1 to each event in the event space. \( P(\Omega)=1 \).
Computation
The computation of the probability space can be done in Python with a single function that returns the three components defined above.
# imports
import itertools # used to create the sample space as a product of two lists
# define the function
def compute_probability_space(die1, die2):
"""
Compute the probability space of two-dice throws.
Params:
- die1: list containing the six face values of the first die
- die2: list containing the six face values of the second die
Returns:
- sample_space: list with all possible combinations of rolls
- event_space: dict with events as keys and outcomes as values
- probabilities: dict with events as keys and probabilities as values
Raises: AssertionError if the probability of the sample space isn't 1
"""
sample_space = list(itertools.product(die1, die2))
event_space, probabilities = {}, {}
for roll in sample_space:
if sum(roll) in probabilities.keys():
event_space[sum(roll)].append(roll)
probabilities[sum(roll)] += 1
else:
event_space[sum(roll)] = [roll]
probabilities[sum(roll)] = 1
omega = 0
n = len(sample_space)
for k in probabilities.keys():
omega += probabilities[k]
probabilities[k] = str(probabilities[k]) + "/" + str(n)
assert omega == n # P(Omega) = P(sample space) = 1
return sample_space, event_space, probabilities
# call the function
die1 = die2 = [1, 2, 3, 4, 5, 6]
Omega, F, P = compute_probability_space(die1, die2)
print(Omega) # sample space
# [(1, 1), (1, 2), (1, 3), (1, 4), (1, 5), (1, 6), (2, 1), (2, 2), (2, 3),
# (2, 4), (2, 5), (2, 6), (3, 1), (3, 2), (3, 3), (3, 4), (3, 5), (3, 6),
# (4, 1), (4, 2), (4, 3), (4, 4), (4, 5), (4, 6), (5, 1), (5, 2), (5, 3),
# (5, 4), (5, 5), (5, 6), (6, 1), (6, 2), (6, 3), (6, 4), (6, 5), (6, 6)]
print(F) # event space
# {2: [(1, 1)], 3: [(1, 2), (2, 1)], 4: [(1, 3), (2, 2), (3, 1)], 5: [(1, 4),
# (2, 3), (3, 2), (4, 1)], 6: [(1, 5), (2, 4), (3, 3), (4, 2), (5, 1)],
# 7: [(1, 6), (2, 5), (3, 4), (4, 3), (5, 2), (6, 1)], 8: [(2, 6), (3, 5),
# (4, 4), (5, 3), (6, 2)], 9: [(3, 6), (4, 5), (5, 4), (6, 3)], 10: [(4, 6),
# (5, 5), (6, 4)], 11: [(5, 6), (6, 5)], 12: [(6, 6)]}
print(P) # probability
# {2: '1/36', 3: '2/36', 4: '3/36', 5: '4/36', 6: '5/36', 7: '6/36',
# 8: '5/36', 9: '4/36', 10: '3/36', 11: '2/36', 12: '1/36'}
Tabulation
We can summarize this probability space as follows.
Event | Outcomes | Prob |
---|---|---|
2 | {(1-1)} | 1/36 |
3 | {(1-2), (2-1)} | 2/36 |
4 | {(1-3), (2-2), (3-1)} | 3/36 |
5 | {(1-4), (2-3), (3-2), (4-1)} | 4/36 |
6 | {(1-5), (2-4), (3-3), (4-2), (5-1)} | 5/36 |
7 | {(1-6), (2-5), (3-4), (4-3), (5-2), (6-1)} | 6/36 |
8 | {(2-6), (3-5), (4-4), (5-3), (6-2)} | 5/36 |
9 | {(3-6), (4-5), (5-4), (6-3)} | 4/36 |
10 | {(4-6), (5-5), (6-4)} | 3/36 |
11 | {(5-6), (6-5)} | 2/36 |
12 | {(6-6)} | 1/36 |