Module 6 - Probability
Module 6 - Probability
Non-deterministic
Deterministic
Deterministic Phenomena
• There exists a mathematical model that allows “perfect”
prediction the phenomena’s outcome.
• Many examples exist in Physics, Chemistry (the exact
sciences).
Non-deterministic Phenomena
• No mathematical model exists that allows “perfect”
prediction the phenomena’s outcome.
Non-deterministic Phenomena
• may be divided into two groups.
1. Random phenomena
– Unable to predict the outcomes, but in the long-
run, the outcomes exhibit statistical regularity.
2. Haphazard phenomena
– unpredictable outcomes, but no long-run,
exhibition of statistical regularity in the
outcomes.
Phenomena
Non-deterministic
Deterministic
Haphazard
Random
Haphazard phenomena
– unpredictable outcomes, but no long-run,
exhibition of statistical regularity in the
outcomes.
– Do such phenomena exist?
– Will any non-deterministic phenomena exhibit
long-run statistical regularity eventually?
Random phenomena
– Unable to predict the outcomes, but in the long-
run, the outcomes exhibit statistical regularity.
Examples
1. Tossing a coin – outcomes S ={Head, Tail}
Unable to predict on each toss whether is Head or
Tail.
In the long run can predict that 50% of the time
heads will occur and 50% of the time tails will occur
2. Rolling a die – outcomes
S ={ , , , , , }
={1, 2, 3, 4, 5, 6}
An Event , E
The event, E, is any subset of the sample space, S. i.e. any set
of outcomes (not necessarily all outcomes) of the random
phenomena
Venn
S diagram
E
The event, E, is said to have occurred if after the outcome has
been observed the outcome lies in E.
S
E
Examples
AB
A B
The event A B occurs if the event A occurs or
the event and B occurs .
AB
A B
Intersection
AB
A B
The event A B occurs if the event A occurs and
the event and B occurs .
AB
A B
Complement
A
A
The event A occurs if the event A does not
occur
A
A
In problems you will recognize that you are working with:
A B
A B
If two events A and B are are mutually
exclusive then:
1. They have no outcomes in common.
They can’t occur at the same time. The outcome
of the random experiment can not belong to both
A and B.
A B
Finite Probability
• An experiment is a procedure that yields one of a given set of possible
outcomes. The sample space of the experiment is the set of possible
outcomes. An event is a subset of the sample space. Laplace’s definition of
the probability of an event with finitely many possible outcomes will now be
stated.
Example 1: Balls-and-Urn
• An urn contains four blue balls and
five red balls. What is the probability
that a ball chosen at random from
the urn is blue?
• Solution: To calculate the
probability, note that there are nine
possible outcomes, and four of
b1
these possible outcomes produce a b2
b7 b9
blue ball. Hence, the probability b3 b5
b8
that a blue ball is chosen is 4/9. b4 b6
• Solution: There are a total of 36 equally likely possible outcomes when two
dice are rolled. (The product rule can be used to see this; because each die
has six possible outcomes, the total number of outcomes when two dice are
rolled is 62 = 36.) There are six successful outcomes, namely, (1, 6), (2, 5), (3,
4), (4, 3), (5, 2), and (6, 1), where the values of the first and second dice are
represented by an ordered pair. Hence, the probability that a seven comes
up when two fair dice are rolled is 6/36 = 1/6.
• EXAMPLE 3: In a lottery, players win a large prize when they pick four digits
that match, in the correct order, four digits selected by a random
mechanical process. A smaller prize is won if only three digits are matched.
What is the probability that a player wins the large prize? What is the
probability that a player wins the small prize?
Solution: There is only one way to choose all four digits correctly. By the product rule, there are 10 4 =
10,000 ways to choose four digits. Hence, the probability that a player wins the large prize is 1/10,000 =
0.0001. Players win the smaller prize when they correctly choose exactly three of the four digits.
Exactly one digit must be wrong to get three digits correct, but not all four correct. By the sum rule, to
find the number of ways to choose exactly three digits correctly, we add the number of ways to choose
four digits matching the digits picked in all but the ith position, for i = 1, 2, 3, 4. To count the number of
successes with the first digit incorrect, note that there are nine possible choices for the first digit (all
but the one correct digit), and one choice for each of the other digits, namely, the correct digits for
these slots. Hence, there are nine ways to choose four digits where the first digit is incorrect, but the
last three are correct. Similarly, there are nine ways to choose four digits where the second digit is
incorrect, nine with the third digit incorrect, and nine with the fourth digit incorrect. Hence, there is a
total of 36 ways to choose four digits with exactly three of the four digits correct. Thus, the probability
that a player wins the smaller prize is 36/10,000 = 9/2500 = 0.0036.
Probabilities of Complements and Unions of
Events
Probabilistic Reasoning
A bit string of length four is generated at random so that each of the 16 bit
strings of length four is equally likely. What is the probability that it contains at
least two consecutive 0s, given that its first bit is a 0? (We assume that 0 bits
and 1 bits are equally likely.)
Solution
Let E be the event that a bit string of length four contains at least two consecutive
0s, and let F be the event that the first bit of a bit string of length four is a 0.
The probability that a bit string of length four has at least two consecutive 0s,
given that its first bit is a 0, equals p(E | F ) = p(E ∩ F ) p(F )
Because E ∩ F = {0000, 0001, 0010, 0011, 0100}, we see that p(E ∩ F ) = 5/16.
Because there are eight bit strings of length four that start with a 0, we have p(F )
= 8/16 = 1/2. Consequently,
Example 2
What is the conditional probability that a family with two children has two
boys, given they have at least one boy? Assume that each of the possibilities
BB, BG, GB, and GG is equally likely, where B represents a boy and G
represents a girl. (Note that BG represents a family with an older boy and a
younger girl while GB represents a family with an older girl and a younger boy.)
Solution
• Let E be the event that a family with two children has two boys, and let F be
the event that a family with two children has at least one boy. It follows that
E = {BB}, F = {BB, BG, GB}, and E ∩ F = {BB}. Because the four possibilities
are equally likely, it follows that p(F ) = 3/4 and p(E ∩ F ) = 1/4. We conclude
that
Independence
Suppose a coin is flipped three times, as described in the introduction to our
discussion of conditional probability. Does knowing that the first flip comes up
tails (event F) alter the probability that tails comes up an odd number of times
(event E)? In other words, is it the case that p(E | F ) = p(E)? This equality is valid
for the events E and F, because p(E | F ) = 1/2 and p(E) = 1/2. Because this equality
holds, we say that E and F are independent events. When two events are
independent, the occurrence of one of the events gives no information about
the probability that the other event occurs. Because p(E | F ) = p(E ∩ F )/p(F ),
asking whether p(E | F ) = p(E) is the same as asking whether p(E ∩ F ) = p(E)p(F ).
The events E and F are independent if and only if p(E ∩ F ) = p(E)p(F ).
Example
Suppose E is the event that a randomly generated bit string of length four
begins with a 1 and F is the event that this bit string contains an even number
of 1s. Are E and F independent, if the 16 bit strings of length four are equally
likely?
Solution
There are eight bit strings of length four that begin with a one: 1000, 1001,
1010, 1011, 1100, 1101, 1110, and 1111. There are also eight bit strings of length
four that contain an even number of ones: 0000, 0011, 0101, 0110, 1001, 1010,
1100, 1111. Because there are 16 bit strings of length four, it follows that p(E) =
p(F ) = 8/16 = 1/2. Because E ∩ F = {1111, 1100, 1010, 1001}, we see that p(E ∩
F ) = 4/16 = 1/4.
Because p(E ∩ F ) = 1/4 = (1/2)(1/2) = p(E)p(F ), we conclude that E and F are
independent.
Other Probabilities
Example
• A fair coin is flipped 3 times. Let S be the sample space of 8
possible outcomes, and let X be a random variable that
assignees to an outcome the number of heads in this outcome.
• X(TTT) = 0
X(TTH) = X(HTT) = X(THT) = 1
X(HHT) = X(THH) = X(HTH) = 2
X(HHH) = 3
Event space of
all possible
Worlds in which P(A) = Area of
worlds A is true reddish oval
Its area is 1
Worlds in which A is False
Example
• What is the probability that, if we flip a coin three times, that we get
an odd number of tails?
(TTT), (TTH), (THH), (HTT), (HHT), (HHH), (THT), (HTH)
Each outcome has probability 1/8,
p(odd number of tails) = 1/8+1/8+1/8+1/8 = ½
Visualizing
Sample Space
• 1. Listing
• S = {Head, Tail}
• 2. Venn Diagram
• 3. Contingency Table
• 4. Decision Tree Diagram
Venn Diagram
Experiment: Toss 2 Coins. Note Faces.
Tail Event
TH
HH HT
Outcome
TT
S
H TH
T
T TT
S = {HH, HT, TH, TT} Sample Space
May the light of wisdom be with you!
Thank you!