Chapter 7
Discrete Probability
7.1 An Introduction to Discrete 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.
• The event space is the power set of the
sample space.
DEFINITION 1
• If S is a finite nonempty sample space of equally likely
outcomes, and E is an event, that is, a subset of S, then
|𝐸|
the probability of E is 𝑝 𝐸 = .
|𝑆|
Probabilities of Complements and
Unions of Events
THEOREM 1
• Let E be an event in a sample space S. The
probability of the event 𝐸ത = 𝑆 − 𝐸, the
complementary event of E, is given by
ത = 1 − 𝑝(𝐸).
𝑝(𝐸)
Example:-A sequence of 10 bits is randomly
generated. What is the probability that at least
one of these bits is 0?
• Solution: Let E be the event that at least one
of the 10 bits is 0. Then 𝐸ത is the event that all
the bits are 1s. Because the sample space S is
the set of all bit strings of length 10, it follows
that
PROBABILITY of a UNION of EVENTS
Theorem 2: Let E1 and E2 be events in the
sample space S. Then p(E1 ∪ E2) = p(E1) + p(E2)
− p(E1 ∩ E2).
Proof:
Conditional Probability
• To find the conditional probability of E given F,
we use F as the sample space. For an outcome
from E to occur, this outcome must also belong
to E ∩ F.
Definition:-Let E and F be events with p(F) > 0.
The conditional probability of E given F, denoted
by p(E | F), is defined as
𝑝(𝐸 ∩ 𝐹)
𝑝(𝐸 | 𝐹) = .
p(F)
Example:-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?
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
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.
5
16 5
Consequently, 𝑝(𝐸 | 𝐹) = =
1/2 8
Independence
Definition: The events E and F are independent if
and only if p(E ∩ F) = p(E)p(F).
• When two events are independent, the
occurrence of one of the events gives no
information about the probability that the other
event occurs.
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
𝑝(𝐸) = 𝑝(𝐹) = 8/16 = 1/2.
Because E ∩ F = {1111, 1100, 1010, 1001}, we see
that
𝑝(𝐸 ∩ 𝐹) = 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.
Random Variables
DEFINITION:- A random variable is a function from the
sample space of an experiment to the set of real numbers.
That is, a random variable assigns a real number to each
possible outcome.
EXAMPLE : Suppose that a coin is flipped three times.
Let X(t) be the random variable that equals the number of
heads that appear when t is the outcome.
Then X(t) takes on the following values:
• X(HHH) = 3,
• X(HHT ) = X(HTH ) = X(THH ) = 2,
• X(TTH ) = X(THT ) = X(HTT ) = 1,
• X(TTT ) = 0.
EXAMPLE : Let X be the sum of the numbers
that appear when a pair of dice is rolled. What
are the values of this random variable for the 36
possible outcomes (i, j ), where i and j are the
numbers that appear on the first die and the
second die, respectively, when these two dice
are rolled?
• Solution: The random variable X takes on the following
values:
• X((1, 1)) = 2,
• X((1, 2)) = X((2, 1)) = 3,
• X((1, 3)) = X((2, 2)) = X((3, 1)) = 4,
• X((1, 4)) = X((2, 3)) = X((3, 2)) = X((4, 1)) = 5,
• X((1, 5)) = X((2, 4)) = X((3, 3)) = X((4, 2)) = X((5, 1)) = 6,
• X((1, 6)) = X((2, 5)) = X((3, 4)) = X((4, 3)) = X((5, 2)) = X((6, 1))
= 7,
• X((2, 6)) = X((3, 5)) = X((4, 4)) = X((5, 3)) = X((6, 2)) = 8,
• X((3, 6)) = X((4, 5)) = X((5, 4)) = X((6, 3)) = 9,
• X((4, 6)) = X((5, 5)) = X((6, 4)) = 10,
• X((5, 6)) = X((6, 5)) = 11,
• X((6, 6)) = 12.
Quiz 2
1. What is the probability that a fair die comes up six when it
is rolled?
2. What is the probability that a randomly selected integer
chosen from the first 100 positive integers is odd?
3. What is the probability that when a coin is flipped six times
in a row, it lands heads up every time?
4. What is the probability that a positive integer not exceeding
100 selected at random is divisible by 5 or 7?
5. What is the conditional probability that a family with two
children has two boys, given the 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.)
Solutions for quiz
4. 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
𝑝 𝐸 ∩ 𝐹 1/4 1
𝑝(𝐸 | 𝐹) = = =
p(F) 3/4 3