Chapters 1,2 - University of Washington math department

Math/Stat 394 Lecture Notes
Christopher Hoffman
1
Lecture 1
We begin by reviewing some basic techniques of counting
Multiplication Rule
If there are A possibilities for event 1 and for each outcome of event 1
there are B possibilities for event 2 then there are A · B possibilities for
events 1 and 2. A generalization of this principal is that if there are A1
possibilities for event 1 and for each outcome of event 1. And also for every
i and every outcome of events A1 through Ai−1 there are Ai possibilities for
event i. Then there are A1 · A2 . . . An possibilities for events 1 through n.
How many ways are there to order a list of 4 people? There are 4 choices
of the first person. For each choice of the first person there are 3 possible
choices of the second. For each choice of the first two there are two choices of
the third person. For any choice of the first three there is only one choice for
the fourth. Thus by the multiplication rule there are 4! = 4·3·2·1 = 24 ways
to order a list of 4 people. In general there are n! = n(n − 1)(n − 2) · · · 2 · 1
n!
ways to order a list of n people. This same argument tells us there are (n−k)!
ways to choose an ordered group of k elements from a group of n.
How many batting orders can a manager make out of 9 baseball players?
This is just the number of ordered lists of 9 elements which is 9!.
We often use the multiplication rule in reverse. If there are there are
A · B possibilities for events 1 and 2 and for each outcome of event 1 there
are B possibilities for event 2 then there are A possibilities for event 1.
How many ways are there to select a group of k elements out of a group
of n?
n!
There are (n−k)!
ways to choose an ordered group of k elements from a
group of n. (There are n choices for the first element, n − 1 choices for the
second all the way to n − k + 1 choices for the kth element.) For each group
of k elements there are k! orders that have the same k elements. Thus by
n!
ways to choose a subset of size k
the multiplication rule there are k!(n−k)!
out of a set of size n.
1
Binomial coefficients
Based on this we define the binomial coefficient
n
n!
=
.
k
k!(n − k)!
This is the number of ways to choose a set of k items from a group of size
n.
Six Russians and four Ukrainians compete in a chess tournament. The
results don’t tell who came in first second and third, etc., but only give the
country of the winner, the country of the runner up, etc. (The results might
be first place Ukrainian, second place Russian, . . . ) If there are no ties how
many possible results are there?
The set of results is determined by the places of the six Russians. The
number of ways this can happen is the same as the number of ways that you
can choose 6 items (the places that the Russian finish) out of a group of 10
(the total possible number of positions.) This is given by 10
6 .
This relates to probability because we often consider all of the possible
results equally likely. If we make that assumption and S is the set of all
possible results then we say the probability of a subset E ⊂ S is just P (E) =
|E|/|S|.
You have seven red balls and five green balls. How many ways are there
to arrange them in a row so that no two green balls are next to each other?
How many ways are there to arrange them in a row so that only one pair of
green balls are next to each other? (In these types of problems we cannot
distinguish between balls of the same color and only care about the sequence
of reds and greens that we see.)
There are eight possible locations to see green balls before the first red
ball, after the first red ball, after the second, . . . Since no two green balls
are allowed to be next to each other each of these can have only one green
ball. Thus to determine an ordering we need
to choose a set of five out of
the eight possible locations. There are 85 possible choices of locations for
the green balls.
For the second part we again have eight possible locations we can put
green balls. One of these will get two balls (the one pair that are next to each
other), four will get one ball and three will get none. There are 8 possible
locations for where to put the pair of balls. For each choice of where to put
the pair there are seven remaining locations where we could possibly put
green balls of which we need to choose 4. There are 74 possible choices of
locations for the remaining green balls. Thus there are 8 · 74 possible orders
that have exactly one pair of green balls next to each other.
2
2
Lecture 2
Last class we used two techniques to help count different sets. They were
• Multiplication Rule and
• Binomial Coefficiants
We can use both of those in the following problem.
A committee of 3 men and 3 women is to be formed from a group of 8
men and 6 women.
1. two men refuse to serve on the committee together
2. two women refuse to serve on the committee together and
3. one man and one woman refuse to serve on the committee together
To answer the question we first count the total number of ways to form
the committee then we subtract off the number that violate
the three re
strictions. There are 83 ways to select the 3 men and 63 ways to select the
3 women. Thus by the multiplication rule there are 83 63 ways to select
the 3 men and 3 women for the committee.
1. two men refuse to serve on the committee together
Call the two men who refuse to serve together John and Mike. If
both John and Mike areon the committee then there are 6 choices
for the other man and 63 ways to choose the women. Thus there are
6 · 63 ways to choose the committee with both John and Mike and
6
8 6
3 3 − 6 · 3 without both John and Mike.
2. two women refuse to serve on the committee together and
Call the two women who refuse to serve together Jane and Michelle. If
both Jane and Michelle are on the committee then there are 4 choices
for the other women and 83 ways to choose the men. Thus there are
4 · 83 ways to choose the committee with both Jane and Michelle and
8 6
8
−
4
·
3 3
3 without both Jane and Michelle.
3. one man and one woman refuse to serve on the committee together
Call the two people who refuse to serve together Mike and Michelle.
If both Mike and Michelle are on the committee then there are 52
choices for the other two women and 72 ways to choose the other
3
two men. Thus there are 52 · 72 ways to choose the committee with
both Mike and Michelle and 83 63 − 52 · 72 without both Mike and
Michelle.
Counting Poker Hands
A standard deck of cards consists of 52 cards with fours suits (clubs,
diamonds, hearts and spades) and 13 levels (ace, 2, 3, 4, 5, 6, 7, 8, 9, 10,
jack, queen, king) of cards. There are nine types of hands. From highest to
lowest they are
1. straight flush five cards of the same suit in a row
2. four of a kind four cards of the same level
3. full house three cards of one level and two of another
4. flush all five cards of the same suit (but not a straight flush)
5. straight all five cards in a row (but not a straight flush)
6. three of a kind three cards of one level and the other two of different
levels
7. two pairs two cards of one level, two cards of another level and one
card of a third level
8. one pair two cards of one level and the other three of different levels
9. high card none of the above
Note that they the categories are mutually exclusive. How many combinations of cards are there that create each type of hand?
In order to do this we use the multiplication rule repeatedly.
• straight flush A straight flush is determined by the lowest (or highest) card in the straight. The straight flush can start with any card
from an ace (A 2 3 4 5) through a 10 (10 J Q K A). So there are four
choices of suit and for each choice of suit there are 10 levels of cards.
Thus there are 40 = 4 · 10 ways to have a straight flush.
• four of a kind There are 13 ways to choose the four cards that are
of the same level. For each level there are 48 cards not of that level.
Thus there are 624 = 13 · 48 ways to make four of a kind.
4
• full house First we choose the levels. There are 13 levels of the three
of a kind and 12 choices of the pair. For each of those there are 43
ways to choose the cards in the triple and 42 ways to choose the pair.
Thus there are
4 4
13 · 12 ·
= 3744
3 2
hands that form a full house.
• flush First we calculate the number of hands that have all five cards
of the same suit. These are either flushes or straight flushes. Then
we subtract off the number of straight flushes to get the number of
flushes. To create a flush we first choose a suit. There are four choices
for that. Then for each suit there are 13
of 5 cards out of the
5 choices
13
13 cards in the suit. Thus there are 4 · 5 = 5148 hands that have
all five cards of the same suit. 40 of these are straight flushes and the
remainder are flushes. Thus there are 5108 ways to get a flush.
• straight First we calculate the number of hands that have all five
cards in a row. These are either straights or straight flushes. Then
we subtract off the number of straight flushes to get the number of
straights. To create a straight we first choose the level of the lowest
card in the straight. There are ten choices (ace through 10) for that.
This tells us the level of the five cards in the straight. Then for each
of the five levels there are 4 choices of suits. Thus there are 45 choices
of the suits of the five cards. Thus there are 10 · 45 = 10240 hands
that have all five cards in a row. 40 of these are straight flushes and
the remainder are straights. Thus there are 10200 ways to get a flush.
• three of a kind First we choose the level of the three of
a kind. There
4
are 13 choices of the level. For each level there are 2 choices of the
two cards that form the pair. Thus there are
4
13
3
choices of the cards that make up the three of a kind. For each of
these there are 48 choices for the remaining fourth card and 44 choices
for the fifth card. (They must be of different levels.) But we don’t
care about the order of the fourth and fifth card. Since there are two
possible orders we must divide the number of ordered hands by two.
Thus there are
4
13 ·
· 48 · 44/2 = 54, 912
3
5
hands that make three of a kind.
• two pairs First we choose the levels of the two pairs. There are 13
2
choices of the two levels. For each level there are 42 choices of the
two cards that form the pair. Thus there are
13 4 4
2
2 2
choices of the cards that make up the two pairs. For each of these
there are 44 choices for the remaining card. Thus there are
13 4 4
44 ·
= 123, 552
2
2 2
hands that make two pairs.
• one pair We will count the number of ways to have one pair and three
ordered cards which are not of the same level as each other and none
of the cards are of the same level as the pair. The number of choices of
the cards for the pair is 13 (the number of levels) times 42 the number
of ways to pick two cards of a given level. This is 78 = 13 · 42 . For
each of those there are 48 cards which could be the third card. Given
the pair and the third card there are 44 choices for the fourth card
and 40 for the third. Thus there are
78 · 48 · 44 · 40
choices of pairs and other three ordered cards so that the total hand
is a pair. For each of those 3 cards there are 6 = 3! orders so we are
counting each hand of five cards exactly 6 times. Thus there are
78 · 48 · 44 · 40/6 = 1, 098, 240
hands that form a pair.
• high card For this we count how many ways are there to create a hand
that have no two cards of the same level. These hands are either high
card, straight flush, straight or flush. 40 of these are straight flushes,
5108 are flushes and 10,200 are straights. It is easier to count the
number of ordered hands. For each pair of 5 cards there are 5! = 120
possible orders so in order to get the number of unordered hands we
have to divide the number of ordered hands by 120. There are 52
6
possible ways to choose the first card. We then have 48 (52-4) choices
for the second card that won’t make a pair. In a similar manner there
are 44, 40 and 36 choices for the third, fourth and fifth cards that
won’t make a pair. Thus there are
52 · 48 · 44 · 40 · 36
ordered hands without a pair and
1, 317, 888 = 52 · 48 · 44 · 40 · 36/120
unordered hands without a pair. Thus to find the number of high card
hands we need to subtract off the number of straight flushes (40), the
number of flushes (5108) and straights (10200). The number of high
card hands is
1, 317, 888 − 10, 200 − 5108 − 40 = 1, 302, 540.
There are 52
We should check that the number
5 different possible hands.
52
of the nine types of hands add up to 5 .
Texas hold-em
Each player gets two cards and then five are dealt to the table. How
many combinations of seven cards are there that make each of the types
of hands. This question is much more complicated because there are many
more hands that could qualify as multiple types of hands. (For example it
is possible to have five cards of the same suit and three cards of the same
level.)
7
3
Lecture 3
Multinomial coefficients
Last class we calculated the number of poker hands like three of a kind
or one pair. Today we will discuss another way to do this.
When we have three of a kind we have one rank which has 3 cards in
the hand, two ranks with one card, and ten ranks with no cards. How many
ways are there to do that? There are 13 ways to choose the rank with 3
cards. That leaves
us with 12 ranks to choose the two ranks with one card.
ways
to choose those. Thus there are 13 12
There are 12
2 choices of the
2
12 4
ranks and 13 2 3 (4)(4) ways to form a three of a kind hand.
We divided the 13 ranks in two three groups, one that has three cards
in the hand, two ranks that have one card in the hand and 10 ranks that
have no cards in the hand. There were
13 12
(13)!
(12)!
(13)!
=
·
=
1
2
1!(12)! 2!(10)!
1!2!(10)!
ways to do this.
Let’s look at another example. How many ways are there to divide 10
people into a group of 5, a group of 3 and a group of 2. (No person can be
in more than one group.) First we countthe number of ways that we can
choose a group of five people. That is 10
5 . For each choice of the group of
5 we must divide the remaining 5 into a group of 3 and 2. There are 53
5
(which is the same as 52 ) ways to do this. Thus there are 10
5
3 ways to
divide 10 people into groups of 5, 3 and 2.
More generally if k1 + k2 + · · · + kj = n then we can ask how many ways
there are to divide n people into distinct groups of k1 , k2 , . . . , kj . If we do
what we did above we see that
(k2 + · · · + kj )!
kj−1 + kj
n
n!
·
···
=
.
k1 !(k2 + · · · + kj )! k2 !(k3 + · · · + kj )!
kj−1 kj !
k1 !k2 ! · · · kj !
Based on these examples we define the multinomial coefficient
n
n!
=
.
k1 , k2 , · · · kj
k1 !k2 ! · · · kj !
This is the number of ways to define n = k1 + · · · + kj items into distinct
groups of sizes k1 through kj .
A police department has 100 officers show up for the Monday morning
shift. It needs to assign 70 officers to car patrols, 20 to foot patrols and
8
10 to bike patrols. How many ways are there to define the 100 officers into
those three groups?
We can use the multinomial coefficients. The answer is
100
100!
=
.
70, 20, 10
70!20!10!
We could have done this without multinomial
coefficients by first choosing
the 10 for the bike patrol. There are 100
ways
to choose them. Then there
10
90
are 90 officers left. There are 20 ways to choose the 20 officers for foot
patrol from the remaining 90. Thus there are
100 90
100!
90!
100!
100
=
=
=
10
20
(10!)(90!) (20!)(70!)
(10!)(20!)(70!)
70, 20, 10
ways to assign the officers.
Let’s go back and we calculate the number of poker hands.
1. 4 of a kind
Suppose we have four of a kind with 4 aces and one jack. Then we
are dividing the 13 ranks into three groups, one group of 1 rank (aces)
that we have four of, a second group of 1 rank (jacks) that we have
one of, and another
of 11 ranks (everything else) that we have none of.
13
There are 11,1,1 to choose those ranks. Once we have chosen those
ranks there are four choices for which suit the jack is but the suits for
the aces are forced on us. Thus we have
13
4
11, 1, 1
ways to form a four of a kind.
2. full house Suppose we have full house with 3 aces and two jacks.
Then we are dividing the 13 ranks into three groups, one group of 1
rank (aces) that we have three of, a second group of 1 rank (jacks)
that we have two of, and another
of 11 ranks (everything else) that we
13
have none of. There are 11,1,1 to choose those ranks. Once we have
chosen those ranks there are 42 = 6 choices for which suit the jacks
are and four choices for the suits of the aces. Thus there are
4
13
4
2 11, 1, 1
ways to form a full house.
9
3. three of a kind Suppose we have full house with 3 aces a jack and a
7. Then we are dividing the 13 ranks into three groups, one group of
1 rank (aces) that we have three of, and a group of 2 ranks (jacks and
sevens) that we have one of, and another
of 10 ranks (everything else)
13
that we have none of. There are 10,2,1
to choose those ranks. Once
4
we have chosen those ranks there are 3 = 4 choices for which suit
the aces are and four choices for the suits of the jack and the seven.
13
3
4
10, 2, 1
ways to form three of a kind.
4. two pairs Suppose we have two pairs with 2 aces, 2 jacks and a 7.
Then we are dividing the 13 ranks into three groups, one group of
2 rank (aces and jacks) that we have two of, and a group of 1 rank
(sevens) that we have one of, and another
of 10 ranks (everything else)
13
that we have none of. There are 10,2,1 to choose those ranks. Once
we have chosen those ranks there are 42 = 6 choices for which suits
the aces and jacks are, and four choices for the suits of the seven.
13
2
6 (4)
10, 2, 1
ways to form two pairs.
5. one pair Suppose we have 2 aces, one jacks, a 7 and a 3. Then we
are dividing the 13 ranks into two groups, one group of 1 rank (aces)
that we have two of, and a group of 3 rank (jacks, sevens and threes)
that we have one of, and another
of 9 ranks (everything else) that we
13
have none of. There are 9,3,1
to choose those ranks. Once we have
4
chosen those ranks there are 2 = 6 choices for which suits the aces
are, and four choices for the suits of the jack, seven and three.
13
3
6(4 )
9, 3, 1
ways to form one pair.
6. high card First we find the number of hands which have no pairs.
We break the ranks up into a group of 5 (that we have
one of) and
a group of 8 (that we have none of). So there are 13
5 choices of the
10
possible ranks. There are four choices of suit
for each of the five ranks
that we have one of. Thus there are 45 13
5 hands that have no pair
and
5 13
− # of straights − # of flushes − # of straight flushes
4
5
hand which are high card.
We can check that this worked out the same as it did when we used
binomial coefficients. You can always use whichever method you prefer.
There are 15 students in a class. They will be divided up into 3 groups
of 4 and one group of three to do presentations on topics A, B, C and D.
1. How many ways are there to assign the 15 students into three groups
of 4 and one of 3 to do the presentations?
2. How many ways are there to assign the students into three groups of
4 and one of 3 to do the presentations if 3 people are assigned to topic
C?
3. How many ways are there to divide the students into three groups of
4 and one of 3 without assigning the groups to topics?
All three have different answers. First we figure out which of these
corresponds to the multinomial coefficient.
In the third question we are not assigning topics to the groups. That
means we are not dividing the students up into a group of 3 and distinct
groups of four so the answer is not a multinomial coefficient. The first
involves first the decision of what topic has only three people and then
dividing the students up into distinct groups of 4, 4, 4 and 3. Thus it is not
given by a multinomial coefficient. The second question involves dividing
the students up into distinct groups of 4, 4, 4 (Topics A,B, and D) and a
group of
3 (Topic C). Thus the answer is given by the multinomial coefficient
15
4,4,4,3.
There are just as many ways of assigning the groups such that the group
of 3 is assigned to topic A, B, C or D. Thus the answer to the first question
15
is four times the answer to the second. Thus the answer is 4 4,4,4,3
.
For the third the groups of are not distinct. If first we assign the divide
the students into groups then for every choice of groups there are 24 choices
of ways to assign them to groups. Thus the answer to question 3 is the
15
answer to question one divided by 24 which is 4,4,4,3
/6.
11
10 basketball players on a team are divided into two teams of 5 for a
scrimmage. How many ways are there to divide the 10 into two teams of 5.
The team is divided into an A team and B team with 5 players each. How
many ways are there to do
that?
The second one is 10
5 . The first is half as big as the second (for each
division into two groupsof five there are two ways to label the teams A and
B) so there are (1/2) 10
5 ways to divide the players into two groups of five.
A dance class has 10 men and 12 women. The teacher needs to choose 5
pairs (of one man and one woman) for a recital. How many choices of pairs
are possible?
12
There are 10
5 choices for which men dance and 5 choices for which
women dance. Once we have picked the 10 dancers there are 5! choices of
how to pair them. (The first women can select from 5 partners, the second
women from four,...) Thus there are
12 10
(5!)
5
5
total ways to pick the pairs.
12
4
Lectures 4 and 5
Sample Space: The space of all possible outcomes of some experiment.
Examples of a sample space are
1. S1 = {g, b}. Is a child a girl or a boy?
2. S2 = {1, 2, 3, 4, 5, 6}. The results of a roll of a die.
3. S3 = {1, 2, 3, 4, 5, 6}100 . The results of a sequence of 100 rolls of a die.
4. S4 = [0, 1]. The fraction of people in Seattle with a college degree.
5. S5 = R+ . The amount of time spent waiting for a bus.
Event: An event is a subset of the sample space. Examples of an event
are
1. A1 = {g} ⊂ S1 . The child is a girl.
2. A2 = {2, 4, 5} ⊂ S2 . The results of a roll of a die is a 2, 4 or 5.
3. A3 = {x ∈ {1, 2, 3, 4, 5, 6}100 : ∃at least 25 i with xi = 3} ⊂ S3 . At
least 25 of the hundred rolls turn up 3.
4. A4 = [0, 1] ⊂ S4 . The whole sample set can be an event too.
5. A5 = (0, 5). The amount of time spent waiting for a bus is less than
five minutes.
Basic set theory rules
If E and F are two events we write EF = E ∩ F for their intersection
and E ∪ F for their union. We also write E \ F = E ∩ F C for all the elements
of E that are not in F .
Commutative Laws E ∪ F = F ∪ E and EF = F E
Associative Laws (E ∪ F ) ∪ G = E ∪ (F ∪ G)
Distributive Law (E ∪ F )G = EG ∪ F G
De Morgan’s Laws
!C
n
n
[
\
Ei
=
EiC
i=1
n
\
i=1
!C
Ei
=
i=1
n
[
i=1
13
EiC
Axioms of Probability
A probability is a function P : events → R which satisfies the following
rules.
1. 0 ≤ P (E) ≤ 1 for all events E
2. P (S) = 1
3. If Ei are disjoint (Ei Ej = ∅ for i 6= j) then
!
∞
∞
[
X
P
Ei =
P (Ei ).
1
1
Do there exist probabilities?
Yes. Let S be a finite set. Set P (E) = |E|
|S| for all E ⊂ S.
Does there exist a probability such that
1. S = [0, 1]
2. P ([a, b]) = b − a
3. is translation invariant and
4. is defined on “most” (or all) subsets of S?
The answer to this question is not at all obvious. This is the subject of
measure theory which is taught in 426, 521 and 524. This subject allows us to
create probabilities on all kinds of spaces including the set of all continuous
functions. This is useful for defining Brownian motion
Consequences of the axioms
1. For any event E we have that EE C = ∅ and E ∪ E C = S. By the
second and third axioms we get
1 = P (S) = P (E ∪ E C ) = P (E) + P (E C ).
2. If E = S then E C = ∅ we can use the line above to see that P (S C ) =
P (∅) = 1 − P (S) = 0.
3. If E ⊂ F then F = E ∪ (F ∩ E C ) and the union is disjoint Thus we
can use the first line to get
P (F ) = P (E) + P (F ∩ E C ) = P (E) + P (F ∩ E C ) ≥ P (E).
14
4. An example of the inclusion-exclusion principle.
P (E ∪ F ) = P (E \ F ) + P (EF ) + P (F \ E)
(1)
= P (E \ F ) + P (EF ) + P (F \ E) + P (EF ) − P (EF(2)
)
= P (E) + P (F ) − P (EF )
(3)
(4)
The inclusion exclusion principle will allow us to generalize this to
more than two sets.
Concrete Examples
Some members of a class are members of two groups. Fifty percent of
the class is a member of the first group and sixty percent are members of
the second and ninety percent are members of at least one group. What
fraction of the class is a member of both groups.
We let S be the students in the class and the event E the members of
the first group. The event F are the members of the second group. We are
trying to find P (EF ). Then the description above implies that P (E) = .6,
P (F ) = .5 and P (E ∪ F ) = .9. Then by inclusion exclusion we get that
.9 = P (E ∪ F ) = P (E) + P (F ) − P (EF ) = .6 + .5 − P (EF )
so P (EF ) = .2 and 20% of the class is in both groups.
15
5
Lecture 6
Last time we proved that for any E1 and E2
P (E1 ∪ E2 ) = P (E1 ) + P (E2 ) − P (E1 E2 ).
Later in this class we will talk about a formula for n elements.
Ten cards are dealt out from a standard deck of 52 cards. If all hands of
ten cards are equally likely what is the probability that
1. you get exactly 2 clubs and no jacks;
2. you get exactly 3 diamonds and no hearts;
3. you either get 2 clubs and no jacks or you get 3 diamonds and no
hearts?
Let E1 be the event that you get 2 clubs and no jacks and let E2 be
the event that you get 3 diamonds and no hearts. Then we need to find
P (E1 ), P (E2 ) and P (E1 ∪ E2 ).
It is easier to count ordered hands rather than unordered hands. (This
doesn’t change anything because for each hand of 10 cards there are 10!
possible ways it can be ordered so we will be just be multiplying numerator
52!
and denominator by 10!.) There are (52)(51) . . . (43) = 42!
total possible
ordered hands of ten cards.
To count the number of ways to satisfy the first
condition we first choose
choices
for their locations.
the positions of the two clubs. There are 10
2
For each choice of locations there are 12 clubs that aren’t a jack that could
go in the first position. Once you have chosen the first club there are 11
choices to go in the second position. After the clubs have been chosen
there are 36 possible cards which aren’t a club or a jack. Thus there are
(36)(35)
. . . (29) ways to pick an arrangement of 8 of these. Thus there are
10
2 (12)(11)(36)(35) . . . (29) ways to get exactly 2 clubs and no jacks out of
52!
42! total possible hands. Thus
10
2
P (E1 ) =
(12)(11)(36)(35) . . . (29)
52!
42!
.
To count the number of ways to satisfy the second condition
we first
choose the positions of the three diamonds. There are 10
choices
for
their
3
locations. For each choice of locations there are 13 diamonds that could go
in the first position. Once you have chosen the first club there are 12 choices
16
to go in the second position and 11 for the third. After the diamonds have
been chosen there are 26 possible cards which aren’t a diamond or a heart.
Thus there are (26)(25)
. . . (20) ways to pick an arrangement of 7 of these.
10
Thus there are 3 (13)(12)(11)(26)(25) . . . (20) ways to get exactly 2 clubs
52!
and no jacks out of 42!
total possible hands. Thus
10
3
P (E2 ) =
(13)(12)(11)(26)(25) . . . (20)
52!
42!
.
To calculate P (E1 ∪ E2 ) we must first calculate P (E1 E2 ) and then use
the formula
P (E1 ∪ E2 ) = P (E1 ) + P (E2 ) − P (E1 E2 ).
If both events happen then
we must have two clubs, three diamonds and five
10
choices for the arrangements of the suits. There
spades. There are 2,3,5
are (12)(11) choices for the clubs that don’t include the jack, (12)(11)(10)
choices for the diamonds that don’t include the jack, and (12)(11)(10)(9)(8)
choices for the spades that include the jack. Thus
10
2,3,5 (12)(11)(12)(11)(10)(12)(11)(10)(9)(8)
P (E1 E2 ) =
.
52!
42!
Plugging the three values for P (E1 ), P (E2 ) and P (E1 E2 ) into the equation
above gives us the value for P (E1 ∪ E2 ) .
Inclusion-Exclusion Principle
If the Ei are disjoint
!
n
n
[
X
P
Ei =
P (Ei ).
i=1
i=1
For any E1 and E2
P (E1 ∪ E2 ) = P (E1 ) + P (E2 ) − P (E1 E2 ).
We want to get a similar formula for the probability of n events.
By using induction it is possible to show that


!
n
n
[
X
X
(−1)k+1
P
Ei =
P (Ei1 Ei2 . . . Eik ) .
i=1
k=1
1≤i1 <i2 ...ik ≤n
17
We can also
Suse the inclusion-exclusion principle to get upper and lower
bounds on P ( ni=1 Ei ) . We have already seen that
!
n
n
[
X
P
Ei ≤
P (Ei )
i=1
i=1
which is the first term (k=1) in the inclusion-exclusion sum. This is an
upper bound on the probability of the union. For a lower bound we use the
first two terms (k=1,2) in the inclusion-exclusion sum
!
n
n
[
X
X
P
Ei ≥
P (Ei ) −
P (Ei Ej ).
i=1
i=1
i<j
Hat Problem
There are ten people who take off their hats when they enter a room.
When they leave a servant who doesn’t know who the hats belong to passes
out the hats to the people. If all the 10! possible ways to distribute the hats
are equally likely what is the probability that at least one man gets back his
own hat.
Let Ei be the event that person i gets back their own hat. For each i
there are 9! ways of passing out the hats so that person i gets their own
1
9!
= 10
. For each i1 < i2 there are 8! ways of passing
hat. Thus P (Ei ) = 10!
out the hats so that people i1 and i2 both get their own hats back. Thus
8!
1
P (Ei1 Ei2 ) = 10!
. More generally for any set i1 < i2 < · · · < ik
= (10)(9)
there are (10-k)! ways of passing out the hats so that people i1 , I2 , . . . ik all
for any i1 < i2 <
get their own hats back. Thus P (Ei1 Ei2 . . . Eik ) = (10−k)!
10!
· · · < ik .
By inclusion exclusion we have that


!
10
10
X
X
[
(−1)k+1
P (Ei1 Ei2 . . . Eik )
P
Ei
=
i=1
1≤i1 <i2 ...ik ≤10
k=1
=
=
10 X
k=1
10 X
k+1
(−1)
(10 − k)!
10!
(10 − k)!k! 10!
k+1
(−1)
k=1
=
10
X
(−1)k+1
k=1
−1
≈ e
10 (10 − k)!
k
10!
1
k!
.
18
If we considered the same problem with n people instead of 10 people we
get
!
n
n
[
X
1
P
=
Ei
(−1)k+1
k!
i=1
k=1
≈ e−1 .
As n gets large the probability converges to e−1 .
19
6
Lecture 7
You have 100 keys in a pile, one of which opens the door. You pick one key
at random from the pile and try it. If it opens the door you stop. If not you
put the key in a different pile and try again. What is the probability that
you stop after the kth key you try? What is the probability that you stop
after the kth key you try if you put the key back in the original pile?
We label the keys 1 through 100 calling the key that works to be key
100. We know the probability that we succeeded on the kth try by the time
we have tried k keys so we set our state space Ω ⊂ {1, 2, . . . 100}k to be all
sequences with all k elements distinct. The event E is the set of sequences
that have 100 (the working key) in the kth location. Then
|Ω| =
100!
(100 − k)!
So
P (E) =
and |E| =
99!
(100 − k)!
99!/(100 − k)!
99!
1
=
=
100!/(100 − k)!
100!
100
for any k ≤ 100.
In the second problem we set our state space Ω = {1, 2, . . . 100}k to be
all sequences with all k elements (not necessarily distinct). The event F is
the set of sequences that have 100 (the working key) in the kth location but
not before. Then
|Ω| = 100k and |E| = 99k−1
So
99k−1
1
P (E) =
=
k
100
100
99
100
k−1
for any integer k.
Birthday Problem
We try to find out what is the probability that there are two (or three or
four) people in the class with the same birthday. There are about 55 people
in the class. First we make some assumptions. There are 365 possible
birthdays (sorry to those of you born on Feb. 29) and that they are all
equally likely. This last assumption is not quite right, a person is about
20% more likely to have a birthday on October 5 than on April 5. This does
not make much of a difference.
Let E be the event that there is at least one day with at least two people
born on that day. Then E C is the event that all the birthdays are distinct.
We will calculate P (E C ) and then use the identity that P (E) = 1 − P (E C ).
20
Since we consider all sequences to be equally likely we want to know how
many sequences of 55 birthdays have no two in common and then divide that
by all possible sequences of 55 birthdays. The first birthday can be chosen
in any of the 365 possible days, the second can be any of the 364 other
days and so on until the 55th person who can be born on any of 311 days.
Thus the number of sequences of 55 birthdays with no two in common is
(365)(364)(311).
P (E C ) =
(365)(364)(311)
≈ .01
(365)55
and
P (E) = 1 − P (E C ) = 1 −
(365)(364)(311)
≈ .99
(365)55
How many people do you need before the probability of having two people
with the same birthday is at least one half?
Based on what we did before if we have k people the probability that no
two of them have the same birthday is approximately
P (E C ) ≈
(365)(364)(365 − k + 1)
.
(365)55
C
P (E ) =
k−1
Y
i=0
i
1−
365
.
We are interested in the time that the probability is first under .5 so that
is the same as the first time the log of the probability is under log(.5) ≈
−.695.
k−1
Y
i
1−
log(P (E C )) = log
365
i=0
k−1
X
i
=
log 1 −
365
i=0
k−1
X
i
≈
365
i=0
≈
k(k − 1)
2(365)
21
!
Solving for the lowest k such that log(P (E C )) ≤ −.695 we get that
k = 23.
What is the probability that three people in the class have the same
birthday? This is a difficult question so we will approximate.
Our first approximation is that we calculate the probability that there
is a day where exactly three people were born.
For this we let Bi be the event that there are exactly three people with
their birthday on the ith day of the year. First we will fix a day (May 1 which
corresponds to i = 121) and ask what is the probability that exactly three
people in the class of 55 have their birthdays on May 1. This is P (B121 ).
There are (55) possible triples of people in the class. Thus there
are (55)(364)52 sequences of birthdays that have exactly three people
born 3 on May 1. There are again (365)55 possible sequences of birthdays
so the probability that exactly 365 people are born on May 1 is
55
5
3 (364) 2
P (B121 ) =
≈ .000467.
(365)55
Thus the probability that there is a day with exactly 3 people born on that
day is less than
(365)P (B121 ) ≈ .171.
If we want to find a better estimate we can use inclusion exclusion.
22