1 Methods of Enumeration: Part 1: Probability
1 Methods of Enumeration: Part 1: Probability
Part 1: Probability
Real world is full of uncertain situations in which we cannot predict the outcome with certainty.
Sometimes it happens because we do not have some kind of information. Then the situation can be
improved if we obtain this information. However, there are situations with uncertainty that cannot
be removed at all, e.g., like in lotteries or financial market. In order to improve understanding of
these naturally uncertain situations, we study them by using probability methods.
Before we start learning what probability is, we need to get familiar with different counting techniques.
Methods of enumeration
Multiplication Principle: If the first task of an experiment can result in n1 possible outcomes
and for each such outcome, the second task can result in n2 possible outcomes, then there are n1 n2
possible outcomes for the two tasks together.
Example: A student has lunch in the Northern Lights every day, suppose that he can choose
one king of protein (meat, chicken, fish or tofu) and one kind of a side (mashed potatoes, roasted
potatoes, fries, broccoli, rice or spaghetti). For how many days can the student eat a different lunch
dish everyday?
Answer: There are 4 ways to choose protein and there are 6 ways to choose a side dish, so there
are 4 6 = 24 different lunch dishes.
Example: A person needs to choose a 4-digit credit card PIN. How many different PIN codes
exist?
Answer: There are 10 ways to choose each digit, hence, there are 10 10 10 10 = 104 different
ways to do so.
Question: How many ways to order a deck of 52 cards?
Answer: There are 52 ways to choose the 1st card, 51 ways to choose the 2nd card, 50 ways to
choose the 3rd card, ..., 2 ways to choose the 51st card and 1 way to choose the last card. Thus,
52 51 50 ... 2 1 = 52!
Definition: Suppose that n positions are to be filled with n different objects. There are n! =
n (n 1) ... 2 1 different ways to arrange them. Each of the n! arrangements is called a
permutation of these n objects.
Common agreement: 0! = 1.
Example: A person needs to choose a 10-digit code, however, none of the digits can be repeated
twice. How many different codes there are?
Answer: We need to arrange 10 digits, so there are 10! different permutations.
Question: Suppose that a person needs to choose a 4-digit PIN, however, none of the digits can
be repeated twice. How many different PIN codes there are?
Answer: There are 10 ways to choose the 1st digit, 9 ways to choose the 2nd digit, 8 ways to choose
the 3rd digit and 7 ways to choose the last digit. In total, there are 10 9 8 7 ways to choose
a PIN. Notice that
10 9 8 7 =
10!
.
6!
Definition: If only k positions are to be filled with objects selected from n different objects (k n),
n!
.
then the number of possible ordered arrangements is n Pk = (nk)!
Example: What is the number of 5-letter codes in 26-letter alphabet if it is required that all letters
must be different?
Answer:
26 P5
26!
21!
= 26 25 24 23 22.
Example: Suppose there are three students: Alan (A), Bill (B) and Carol (C). They need to choose
a president of the group and a vice-president. How many different pairs are possible?
Answer: 3 P2 =
3!
1!
Question: Now suppose we do not care about who exactly is a president and who is a vice-president,
we want to know how many different ways to form the group government are there.
Answer: Intuitively, you can see that we count each group twice, because as a final result we should
have AB, AC and BC, i.e., 3 different ways.
In order to deal more formally with the situations similar to one when the order is not important,
we will use the following formula:
Definition: If only k positions are to be filled with objects selected from n different objects (k n),
n!
then the number of possible unordered arrangements is n Ck = k!(nk)!
.
Example: What is the number of possible five-card hands drawn from a deck of 52 cards?
Answer: Notice that we do not care in which order the cards came to our hands, we care only about
52!
52!
the final result, thus, we use the above formula and obtain 52 C5 = 5!(525)!
= 5!47!
.
Theorem: n Ck =
n!
k!(nk)!
n!
(n(nk))!(nk)!
=n Cnk .
Problem 1: There are 15 balls in the urn: 5 white and 10 black. We randomly pick 6 balls from
the urn without replacement. What is probability that exactly 4 balls will be black?
Answer: This problem can be divided into three steps.
1. It is clear that we do not care in which order these balls come to us. Thus, the number of
ways to randomly pick 6 balls from 15 is 15 C6 . These are ALL possible outcomes.
2. The number of ways to extract 4 black balls out of 10 is
10 C4 .
3. The rest balls should be white (6 4 = 2). The number of ways to randomly pick 2 white
balls out of 5 is 5 C2 .
Now notice that the number of ways to extract 6 balls out of our urn and have exactly 4 of them
black is 10 C4 5 C2 . Intuitively, it is clear that the probability of each outcome is the same. Thus,
the probability of the event of our interest equals to the proportion of outcomes that satisfy us in
5 C2
.
all possible outcomes, i.e., 10 C154
C6
This problem might look very theoretical, however, it is not. For example, you might be interested
in the probability of guessing 3 numbers out of 5 in the powerball lottery. By analogy with the
5 C3
above example, you can obtain that it is 64 C692
.
C5
Problem 2: Alan and Bob are playing into aero-hockey and betting 50$ each on who will win the
game (who scores 7 first). Suppose that when the score is 6 : 4, the machine breaks down. How
should they split the money?
Answer: There is an infinite number of ways to split the money. However, what would be the fair
way to do so?
Should they split 100$ equally? Alan will disagree with it. He has almost won the game!
Should all money be given to Alan? Bob will disagree with it because he has not lost the game.
Should they split it in proportion 6 : 4? But how is it different from 3 : 1 the proportion of how
many games the rival has to win?
Two famous 17th century mathematicians, Pascal and Fermat, came to conclusion that the players
should split the money according to their probabilities of winning the game. Thus, we are interested
in finding the probability of Alan winning this game.
First, we need to describe all possible outcomes. Suppose that the probability of scoring is the same
for both players (0.5). Denote by A if Alan scores and B is Bob scores. What are possible ways to
end the game?
A, BA, BBA, BBB
What is the probability of each of these outcomes?
Alan might win the next score with probability 0.5, so P (A) = 0.5.
Bob wins the next score with probability 0.5 and Alan might win the game after with probability
0.5, so P (BA) = 0.5 0.5 = 0.25.
By analogy, Bob wins the next score with probability 0.5, the score after the next with probability
0.5, and Alan wins the last score with probability 0.5, making it P (BBA) = 0.53 = 0.125.
Finally, Bob wins three scores in a row with probability P (BBB) = 0.125.
Thus, you might notice that Alan wins in three out of four outcomes of the game, implying that
the probability of Alan winning is the sum of the corresponding probabilities of the outcomes, i.e.,
0.5 + 0.25 + 0.125 = 0.875.
Probability
Example: Suppose that a person is asked to choose any number from 1, 2 and 3. Thus, the outcome
space is = {1, 2, 3} and all possible events are A = {, , {1}, {2}, {3}, {1, 2}, {1, 3}, {2, 3}}.
Here is a formal definition of probability:
Note: Bertrand paradox shows importance of the choice of the probability model.
Theorem: The following formulas hold:
1. P (Ac ) = 1 P (A)
2. P (A B) = P (A) + P (B) P (A B)
3. If A B, then P (A) P (B)
4. P ((A B)c ) = P (Ac B c )
5. P ((A B)c ) = P (Ac B c )
Proof:
1. We know that A Ac = and A Ac = (by definition of Ac ), thus,
1 = P () = P (A Ac ) = P (A) + P (Ac ) P (Ac ) = 1 P (A).
1 1 1
2
+ = .
2 2 3
3
2
1
= .
3
3
2
6
= 13 . On the
Independence
Definition: Events A and B are called independent if and only if P (A B) = P (A)P (B). We
denote it as A
B.
Example: Suppose that A = {1, 3, 5} and B = {1, 2, 3} when we roll a fair die. Are A and B
independent?
P (A B) = P ({1, 3}) =
P (A)P (B) =
1
3
1 1
1
1
= 6=
2 2
4
3
The probability of each outcome is 14 . Thus, P (A) = 12 and P (B) = 12 , so P (A)P (B) = 14 . Notice
B.
that A B = {HT } P (A B) = 14 = P (A)P (B). Hence, A
Definition: Events A1 , A2 , ..., An are called mutually independent if and only if for any k n
and any sequence of indices i1 , i2 , ..., ik such that ip 6= iq if p 6= q
P
kp=1 Aip
k
Y
P (Aip ).
p=1
Conditional Probability
Sometimes it is more comfortable to work with the probabilities and take into account some available
information.
Definition: The conditional probability of event A given event B, such that P (B) > 0, is defined
.
by P (A|B) = P P(AB)
(B)
Example: Your friend rolls a fair die and tells you that the number is even. Your are interested
in the probability that the number is not greater than three.
Denote the event that the number is even as B and the event that the number is not greater than
three as A. You want to calculate P (A|B):
P (A|B) =
P (A B)
1
P ({2})
=
= .
P (B)
P ({2, 4, 6})
3
Example: There are 100 students at the University that offers majors in economics and literature.
Students also need to complete a sport requirement. They can choose between tennis and basketball.
There are 55 students in the econ major and 45 students in literature. 35 students from econ play
tennis, while in the literature department 10 students play basketball. You meet a random student
from the econ department. What is the probability that this student plays basketball? What is the
probability that a random tennis player is in the literature department?
Economics
Literature
Total
Thus, we find P (B|E) =
P (BE)
P (E)
0.2
0.55
Tennis
0.35
0.35
0.7
4
11
Basketball
0.2
0.1
0.3
and P (L|T ) =
Total
0.55
0.45
1
P (LT )
P (T )
0.35
0.7
= 12 .
(B)
Note: If A
B, then P (A|B) = P P(AB)
= P (A)P
= P (A). It means that if events are indepen(B)
P (B)
dent, they do not affect probabilities of each other.
7
Example: We know that the probability that an economist plays tennis is P (T |E) = 11
and the
probability that a student is an economist is P (E) = 0.55. Thus, the probability that a random
7
7
11
= 20
.
student is an economist who plays tennis is P (E T ) = P (T |E)P (E) = 11
20
Definition: A sequence of events A1 , A2 , ... is called a partition of the outcome space if and
only if
1. for any i 6= j: Ai Aj = (the events do not intersect);
2. Ai = .
Example: You roll a fair die and = {1, 2, 3, 4, 5, 6}. There are several different partitions
possible. For example, A1 = {1}, A2 = {2, 4} and A3 = {3, 5, 6} is a partition. Another example is
B1 = {1, 3, 5} and B2 = {2, 4, 6}.
Law of total probability: Suppose that A1 , A2 , ..., An is a partition of . Then for any event B
the following is true:
P (B) = P (B|A1 )P (A1 ) + P (B|A2 )P (A2 ) + ... + P (B|An )P (An ).
Example: Suppose that women constitute 52% of population. It is known that 5% of men and
0.25% of women suffer from color blindness. What is the probability that a random person in the
population has color blindness?
Denote B an event that a person suffers from color blindness, M an event that a person is a man
and W an event that a person is a woman. Then
P (B) = P (B|M )P (M ) + P (B|W )P (W ) = 0.05 0.48 + 0.0025 0.52 = 0.0253.
Bayes rule: P (A|B) =
P (B|A)P (A)
.
P (B)
Example: You know that a person has color blindness. What is the probability that this person
is a man?
P (M |B) =
0.05 0.48
P (B|M )P (M )
=
0.9486.
P (B)
0.0253
Example: A polygraph declares a truthful answer to be lie in 1% of the cases and a lie to be lie
with probability of 99%. Suppose that it is known that a suspect lies 1% of the time. An answer
was declared to be lie. What is the probability that it is a lie?
Denote L an event that the answer is a lie, T an event that the answer is a truth, DL an event
that the answer was declared to be a lie by the polygraph and DT an event that the answer was
declared to be a truth by the polygraph.
P (L|DL) =
P (DL|L)P (L)
0.99 0.01
0.99 0.01
=
=
=
P (DL)
P (DL)
P (DL|L)P (L) + P (DL|T )P (T )
1
0.99 0.01
= .
=
0.99 0.01 + 0.01 0.99
2