Professional Documents
Culture Documents
Dennis Wong
Basic Probability
An experiment is a procedure that yields one of a given set of possible outcomes.
Solution: There are 36 outcomes for rolling 2 dice: {(1, 1), (1, 2), …, (6, 6)}
There are 4 ways to roll a 5: {(1, 4), (2, 3), (3, 2), (4, 1)}. Thus the probability that a
single roll produces a 5 is 4/36.
Basic Probability
Question: In the last example, why didn’t we say there were 11
different possible outcomes corresponding to the sum of the dice: {2,
3, . . . , 12}, thus probability of getting a 5 is 5 / 11?
{(1, 1, 3), (1, 3, 1), (3, 1, 1), (1, 2, 2), (2, 1, 2), (2, 2, 1)}
Basic Probability
Example 3: What is the probability of obtaining a 4 of a kind in a 5 card poker hand?
Solution: We have two counting problems: we must count the number of different 5
card hands (the sample space) and the number of hands with 4 of a kind (the event).
Example 4: What is the probability of obtaining a full house in a 5 card poker hand?
Solution: A full house consists of a 3 of a kind and 2 of a kind:
P(50, 5) = 50 ∙ 49 ∙ 48 ∙ 47 ∙ 46 = 254251200.
p(E) = 1 - p(E)
We could count the number of length 10 binary strings that have at least 2
zeros, but it is easier to count those that do not have at least 2 zeros.
So |E| = C(10, 0) + C(10, 1) = 11. |S| is given by the number of length 10 binary
10
strings: 2 = 1024.
(1): 0 ≤ p(xi) ≤ 1
(2): p(x1) + p(x2) + … + p(xn) = 1
The function p from the set of all outcomes of the sample space S
p(E) = ∑ p(s)
s∈E
Example: A single die is loaded so that the 3 appears twice as often as each of the
other numbers. The five other outcomes are equally as likely. What is the
Solution: First we must determine the probability distribution for this experiment.
Then we want to find p(E) where E = {1, 3, 5}.
Example: You flip a fair coin 3 times. What is the probability that there are
an odd number of tails? What if we know the event F - that the first flip is
tails?
The probability the first flip is tails is 1/2. The number of outcomes with an
odd number of tails where the first one is tails is 2: TTT, THH. There are 8
possible outcomes, so p(E ∩ F) = 1/4. Thus
Conditional Probability
Example: You are at the casino playing blackjack. In a standard deck of 52
cards, what is the probability that you get a blackjack given that your first
card is a King?
Solution: The event E is you get a blackjack. The event F is that your first
card is a King. We want to compute the conditional probability p(E | F). The
probability of getting a king first is given by p(F) = 1/13. What is p(E | F)?
The total number of outcomes is 52 · 51. To get a blackjack with the first
card a king, we require the second card to be an ace. There are 4 ways to
get a king on the first card, and 4 ways to get an ace with the second card.
Thus p(E ∩ F) =16 / (52 ∙ 51). Thus
Solution: We want to compute the probabilities of winning the large prize if we keep the
same door or if we switch doors.
Initially, the probability of selecting the prize is 1/3. Even when a door is opened to reveal
nothing, this does not change the probability that your initial choice was correct. NOTE: the
probability of winning does not increase to 1/2 just because a door has been opened (since
a door with a prize is never revealed).
Now given that the door you chose has 1/3 chance of winning, this means that there is a
2/3 chance that the prize is behind the other two doors. This means that after a door has
been opened to reveal nothing, the other door must have a 2/3 chance of holding the prize.
Another way to think about it: if you picked wrong initially which is 2 out of 3 times, then if
you switch doors you will win.
The Monty Hall 3 door puzzle
Behind door 1 Behind door 2 Behind door 3 Stay with door #1 Switch door
Car Goat Goat Win Lose
Goat Car Goat Lose Win
Goat Goat Car Lose Win
Independence
Suppose you flip a coin twice and you know the outcome of the first flip is
tails (event F). Does this outcome have any effect on the probability that the
second flip is also a tails (event E)? If not, then we say that the events are E
So let’s verify that the coin flips above are independent. The probability that
the first flip is tails: p(F) = 2/4. The probability that the second flip is tails:
p(F) = 2/4. The probability that both are tails:
Bernoulli Trials
Suppose that an experiment can have only two possible outcomes - like flipping
a coin. Each performance of such an experiment is called a Bernoulli trial,
named after James Bernoulli.
In general, the two possible outcomes are success and failure, where p denotes
Example: Consider a bit generator that produces a 1 with probability 0.6, and a 0
with probability 0.4. What is the probability that the generator will produce a
length 8 bitstring with exactly two 1’s?
2 6
Solution: C(8, 2) 0.6 0.4