Topics
Probability vs likelihood?
Other topics
An overview Probability and Statistics:
- Probability theory is mainly concerned with predicting the likelihood of future events,
- Statistics analyzes the frequency of past events.
Approaches: Frequentist vs Bayesian
There are two approaches (or interpretations) to probability:
Frequentist (aka objective or frequency probabilities):
- Associated with random physical systems where a given event type tends to occur at a persistent rate, or relative frequency, in a long run of trials
- Physical systems include: coin flips, roulette wheel, dice rolls etc.
- This tutorial (and poker) falls here.
Bayesian (aka evidential probabilities):
- Assignable to any statement (regardless of whether a random process is involved) as a way to represent its subjective plausibility (i.e. the degree to which the statement is supported by available evidence.)
- Often, evidential probabilities are degrees of belief; defined in terms of willingnesses to gamble at certain odds
Key Terminology Tree (Examples in Appendix)
- The Experiment: Imagine an experiment that can be repeated under identical conditions.
- Independent trials: Each repetition of the experiment is independent from the last.
- Outcome: Each independent trial may produce a different outcome
- Sample space: The set of all possible outcomes (results of an experiment)
- Event: A well-defined subset of the sample space
- Sample space: The set of all possible outcomes (results of an experiment)
- Outcome: Each independent trial may produce a different outcome
- Independent trials: Each repetition of the experiment is independent from the last.
Symbols in probability
- And, : Events and both occur
- Or, : Either event or event occurs
- Given that, : is denoted as
1. Calculating probabilities
1.1. Probability of a Single Event
- P(A) = \frac{\text{Number of outcomes corresponding to A}}{\text{Sample space (total no. of outcomes)}}
- For a standard deck of cards, the probability of drawing an Ace is ~7.69%:
- Let . Then
# Create function that returns probability percent rounded to one decimal place
def event_probability(event_outcomes, sample_space):
probability = (event_outcomes / sample_space) * 100
return round(probability, 1)
# Sample space
num_cards = 52
# Determine the probability of drawing an Ace
num_aces = 4 # number of outcomes whe¡¡re an "Ace" is drawn
ace_probability = event_probability(num_aces, num_cards)
# Determine the probability of drawing a heart
num_hearts = 13
hearts_probability = event_probability(num_hearts, num_cards)
# Determine the probability of drawing a face card
num_face_cards = 12
face_card_probability = event_probability(num_face_cards, num_cards)
# Determine the probability of drawing the queen of hearts
num_queen_of_hearts = 1
queen_of_hearts_probability = event_probability(num_queen_of_hearts, num_cards)
print('From a deck of cards, here are the probabilities of drawing a(n)...:')
print('Ace\t\t', str(ace_probability) + '%')
print('Heart\t\t', str(hearts_probability) + '%')
print('Face card\t', str(face_card_probability) + '%')
print('Queen of Hearts\t', str(queen_of_hearts_probability) + '%')From a deck of cards, here are the probabilities of drawing a(n)...:
Ace 7.7%
Heart 25.0%
Face card 23.1%
Queen of Hearts 1.9%2. Probabilities with permutations and combinations (with and without replacement)
2.1. Permutations (without replacement/repetition)
- The number of ways a subset of a specified size can be arranged (ordered) from a given set, without replacement/repetition.
- I.e. Order matters (e.g. 1234 is different to 2134)
- and no repeats (e.g. 1123 is not possible)
- In simple terms: “How many distinct ways to arrange (unique) things into a sequence, out of (unique) things, without repeating any item?”
- Example: 4 digit PIN with no repeated digits:
- General formula:
- Where is the number of things to choose FROM (10 digits available)
- And is the number of things you ACTUALLY CHOOSE (choosing 4 digits for the PIN)
- Terminology: The -permutation of ; or -perm-
2.2. Combinations (without replacement/repetition)
- The number of ways a subset of a specified size can be drawn from a given set
- I.e. Order doesn’t matter (so AKQ5 is no different to 5QAK)
- and no repeats (e.g. AK55 is not possible)
- In simple terms: “How many ways to choose (unique) things from (unique) things ()”
- General formula:
- Where is the number of things to choose from (13 cards available in a suit)
- And is the number of things you actually choose (choosing 4 cards)
- Terminology: The -combination of , or or -choose-
- Note: Numerator is the permutations formula, while the denominator is the factorial of the number of cards that you will actually choose.
2.3. Permutations (with replacement/repetition)
- Same as above, but we can replace/repeat items now
- Once again, order matters
- But this time repetition is allowed
- In simple terms: “How many distinct ways to arrange things into a sequence, out of (unique) things?”
- Example: 4 digit PIN (can repeat digits):
- General formula:
- Where is the number of things to choose from (10 digits available)
- And is the number of things you actually choose (choosing 4 digits for the PIN)
- Terminology: The number of -tuples over (set containing elements)
2.4. Combinations (with replacement/repetition)
- Same as above, but we can replace/repeat items now
- Once again, order doesn’t matter
- But this time, repetition is allowed
- In simple terms: “How many ways to choose things from (unique) things”
- General formula:
- Where is the number of things to choose from (13 cards available in a suit)
- And is the number of things you actually choose (choosing 4 cards)
- Terminology: The -combination of , or -multichoose-
# How many combinations of Pocket Aces exist in the deck?
import math
n = 4 # no. of aces in deck
k = 2 # no. of cards in a "starting hand" or "pocket" (aka "hole cards")
# Determine permutations and print result - I.e. number of ways to arrange 2 cards (given you have 4 cards); no replacements
ace_permutations = math.factorial(n) / math.factorial(n-k) # [AB, AC, AD, BA, BC, BD, CA, CB, CD, DA, DB, DC]
print(ace_permutations, '--> Ace permutations (w/o replacement) (i.e. order of Aces matters!)')
# Determine number of combinations - I.e. number of ways to choose 2 cards out of 4 cards; no replacements
ace_combinations = ace_permutations / math.factorial(k) # [AB, AC, AD, BC, BD, CD]
print(ace_combinations, '--> Ace combinations (w/o replacement) (i.e. the number of unique Ace pairs in the deck; order irrelevant)')12.0 --> Ace permutations (w/o replacement) (i.e. order of Aces matters!)
6.0 --> Ace combinations (w/o replacement) (i.e. the number of unique Ace pairs in the deck; order irrelevant)# How many pocket pairs (starting hands) can be dealt in Texas Hold'em?
n = 52 # no. of cards in a deck
k = 2 # no. of cards in a "starting hand" or "pocket" (aka "hole cards")
# Determine Combinations
pocket_permutations = math.factorial(n) / math.factorial(n-k)
pocket_combinations = pocket_permutations / math.factorial(k)
print(pocket_combinations)1326.03. Types of events
Recall: An event is a well-defined subset of the sample space. Events can be dependent or independent
3.1. Independent vs Dependent events
- A and B are independent if knowing whether one event (e.g. ) has occurred gives no information about (/has no impact on) whether the other event () occurred. The following are hence true:
- A dependent event impacts the probability other event(s). Some examples of dependent events:
- Flush Draw:
- Your hand:
- Community cards:
- Question: Write a function to calculate the probability of a flush on the River (i.e. a card being drawn)
- Flush Draw:
# Parameters
cards = 52
hole_cards = 2
turn_community_cards = 4
# Sample space: the remaining cards to compute the Single Event (River Flush) probability
cards -= hole_cards + turn_community_cards
# Outcomes
diamonds = 13
diamonds_drawn = 4 # so far
# In poker, (favourable) cards that complete a draw are known as "outs"
outs = diamonds - diamonds_drawn
# Flush probability (using our function to compute probs defined above)
river_flush_probability = event_probability(outs, cards)
print(str(river_flush_probability) + "%")19.6%- Another dependent event
- Open-Ended Straight Draw:
- Your hand:
- Community cards:
- Question: Write a function to calculate the probability of a straight on the River (i.e. either a or a card being drawn, suit doesn’t matter)
- Open-Ended Straight Draw:
# Parameters
cards = 52
hole_cards = 2
turn_community_cards = 4
# Sample space: the remaining cards to compute the Single Event (River Flush) probability
cards -= hole_cards + turn_community_cards
# Outcomes
remaining_eights = 4
remaining_kings = 4
outs = remaining_eights + remaining_kings
# Straight probability
river_straight_probability = event_probability(outs, cards)
print(str(river_straight_probability) + "%")17.4%
4. Multiple events
4.1. Mutually exclusive events
4.2. Non-mutually exclusive events
4.3. Independent event intersections
4.4. Dependent event intersections`
Expected value
Appendix
Examples for Terminology Tree (2 and 3 are vague)
- A last example is the experiment where you toss a die. You can toss the die multiple times and all of these throws can have different outcomes: 6 to be exact, since your die has 6 numbers (1,2,3,4,5,6). An event “The sum of the results of the two toss is equal to 10” can consist of 10, while the event “the number is even” can consist of 2, 4, or 6.
- A somewhat cliché example would be flipping a coin. In this case, the experiment is, in fact, the flipping of a coin. You can toss the coin multiple times, and all these trials might have different outcomes. As there are two possible outcomes -heads or tails- the sample space is 2. However, the event “tossing a coin” can, for example, consist of one outcome “Heads”. Similarly, when you toss a coin twice, your event “the first toss results in a Heads” might have an outcome “Heads-Heads” or “Heads-Tails”.
- Another example that is maybe less straightforward is an experiment where you spin a globe and you stop it by putting your finger on it. You can spin the globe multiple times and all these times might have different outcomes - You can either land your finger on land or on water. That means that the sample space is 2. An event “my finger is on land” might have an outcome “Land - Water” or “Land - Land”.
Doubts
- Do semantics really matter that much (specifically, the hierarchical relationships between the words “outcome”, “sample space”, and “event”)?