Professional Documents
Culture Documents
Aaron Tan
1
Combinations r-Combinations with Repetition Pascal’s Formula and the Binomial Theorem
12. Counting and Probability 2 This lecture is based on Epp’s book chapter 9.
Hence, the section numbering is according to the book.
9.5 Counting Subsets of a Set: Combinations
• r-combination, r-permutation, permutations of a set with repeat elements,
partitions of a set into r subsets
3
Combinations r-Combinations with Repetition Pascal’s Formula and the Binomial Theorem
Example 1 – 3-Combinations
5
Combinations r-Combinations with Repetition Pascal’s Formula and the Binomial Theorem
6
Combinations r-Combinations with Repetition Pascal’s Formula and the Binomial Theorem
4
The number of ways to perform step 1 is . 2
The number of ways to perform step 2 is 2!
Hence,
4
P(4, 2) = 2
2!
4
2
= P(4, 2) / 2!
= 12 / 2 = 6
9
Combinations r-Combinations with Repetition Pascal’s Formula and the Binomial Theorem
𝑛
Theorem 9.5.1 Formula for 𝑟
10
Combinations r-Combinations with Repetition Pascal’s Formula and the Binomial Theorem
11
Combinations r-Combinations with Repetition Pascal’s Formula and the Binomial Theorem
13
Combinations r-Combinations with Repetition Pascal’s Formula and the Binomial Theorem
Four-step process: 11
Step 1: Choose a subset of 4 positions for the S’s. 4
7
Step 2: Choose a subset of 4 positions for the I’s. 4
3
Step 3: Choose a subset of 2 positions for the P’s. 2
1
Step 4: Choose a subset of 1 position for the M. 1
11 7 3 1
× × × = 𝟑𝟒𝟔𝟓𝟎
4 4 2 1
14
Combinations r-Combinations with Repetition Pascal’s Formula and the Binomial Theorem
15
Combinations r-Combinations with Repetition Pascal’s Formula and the Binomial Theorem
16
Combinations r-Combinations with Repetition Pascal’s Formula and the Binomial Theorem
Definition: Multiset
An r-combination with repetition allowed, or
multiset of size r, chosen from a set X of n elements is
an unordered selection of elements taken from X with
repetition allowed.
If X = 𝑥1 , 𝑥2 , ⋯ , 𝑥𝑛 , we write an r-combination with
repetition allowed as 𝑥𝑖1 , 𝑥𝑖2 , ⋯ , 𝑥𝑖𝑟 where each 𝑥𝑖𝑗
is in X and some of the 𝑥𝑖𝑗 may equal each other.
18
Combinations r-Combinations with Repetition Pascal’s Formula and the Binomial Theorem
[1, 3, 4]: x | | x | x
[2, 4, 4]: | x | | xx
21
Combinations r-Combinations with Repetition Pascal’s Formula and the Binomial Theorem
(a) 𝑛 = 3, 𝑟 = 20.
𝑟 + (𝑛 − 1) 20 + 2 22 22 ∙ 21
= = = = 231
𝑟 20 20 2
22
Combinations r-Combinations with Repetition Pascal’s Formula and the Binomial Theorem
23
Combinations r-Combinations with Repetition Pascal’s Formula and the Binomial Theorem
24
Combinations r-Combinations with Repetition Pascal’s Formula and the Binomial Theorem
Pascal’s Formula
Pascal’s Formula
Suppose n and r are positive integers with r n. Then
𝑛+1 𝑛 𝑛
= +
𝑟 𝑟−1 𝑟
Pascal’s
triangle is a
geometric
version of
Pascal’s
formula.
Pascal’s Formula
Combinatorial Proof
Combinatorial Proof
27
Combinations r-Combinations with Repetition Pascal’s Formula and the Binomial Theorem
Pascal’s Formula
Algebraic proof:
Combinatorial proof:
28
Combinations r-Combinations with Repetition Pascal’s Formula and the Binomial Theorem
𝑛 𝑛
𝑟
= 𝑛−𝑟
𝑛 𝑛
Example 8 – Deduce 𝑟
= 𝑛−𝑟
29
Combinations r-Combinations with Repetition Pascal’s Formula and the Binomial Theorem
Combinatorial Proof
𝑛 𝑛
Example 9 – For 0 ≤ 𝑘 ≤ 𝑛, 𝑘
= 𝑛−𝑘
30
Combinations r-Combinations with Repetition Pascal’s Formula and the Binomial Theorem
Combinatorial Proof
𝑛 𝑛−1
Example 10 – For 0 ≤ 𝑘 ≤ 𝑛, 𝑘 𝑘
=𝑛 𝑘−1
31
Combinations r-Combinations with Repetition Pascal’s Formula and the Binomial Theorem
Combinatorial Proof
32
Combinations r-Combinations with Repetition Pascal’s Formula and the Binomial Theorem
Combinatorial Proof
33
Combinations r-Combinations with Repetition Pascal’s Formula and the Binomial Theorem
34
Combinations r-Combinations with Repetition Pascal’s Formula and the Binomial Theorem
a.
5
5 5−𝑘 𝑘
(𝑎 + 𝑏)5 = 𝑎 𝑏
𝑘
𝑘=0
5 5 5 5
= 𝑎5 + 1
𝑎5−1 𝑏1 + 2
𝑎5−2 𝑏2 + 3
𝑎5−3 𝑏3 + 4
𝑎5−4 𝑏4 + 𝑏 5
35
Combinations r-Combinations with Repetition Pascal’s Formula and the Binomial Theorem
b.
4
4 4−𝑘
(𝑥 − 4𝑦)4 = 𝑥 (−4𝑦)𝑘
𝑘
𝑘=0
4 4 4
= 𝑥4 + 1
𝑥 4−1 (−4𝑦)1 + 2
𝑥 4−2 (−4𝑦)2 + 3
𝑥 4−3 (−4𝑦)3 +(−4𝑦)4
36
Combinations r-Combinations with Repetition Pascal’s Formula and the Binomial Theorem
37
Probability Axioms and Expected Value Conditional Probability, Bayes’ Formula, and Independent Events
38
Probability Axioms and Expected Value Conditional Probability, Bayes’ Formula, and Independent Events
Probability Axioms
Probability Axioms
Probability Axioms
Let S be a sample space. A probability function P from the set of
all events in S to the set of real numbers satisfies the following
axioms: For all events A and B in S,
1. 0 P(A) 1
2. P() = 0 and P(S) = 1
3. If A and B are disjoint events (A B = ), then
P(A B) = P(A) + P(B)
39
Probability Axioms and Expected Value Conditional Probability, Bayes’ Formula, and Independent Events
Probability Axioms
Probability Axioms
Expected Value
Expected Value
42
Probability Axioms and Expected Value Conditional Probability, Bayes’ Formula, and Independent Events
Expected Value
𝑎𝑘 𝑝𝑘 = 𝑎1 𝑝1 + 𝑎2 𝑝2 + 𝑎3 𝑝3 + ⋯ + 𝑎𝑛 𝑝𝑛
𝑘=1
43
Probability Axioms and Expected Value Conditional Probability, Bayes’ Formula, and Independent Events
Expected Value
44
Probability Axioms and Expected Value Conditional Probability, Bayes’ Formula, and Independent Events
Expected Value
45
Probability Axioms and Expected Value Conditional Probability, Bayes’ Formula, and Independent Events
Expected Value
Expected Value
47
Probability Axioms and Expected Value Conditional Probability, Bayes’ Formula, and Independent Events
Linearity of Expectation
Linearity of Expectation
The expected value of the sum of random variables is
equal to the sum of their individual expected values,
regardless of whether they are independent.
For random variables 𝑋 and 𝑌 (which may be dependent),
𝐸 𝑋 + 𝑌 = 𝐸 𝑋 + 𝐸[𝑌]
𝐸 𝑐𝑖 ∙ 𝑋𝑖 = 𝑐𝑖 ∙ 𝐸[𝑋𝑖 ]
𝑖=1 𝑖=1
48
Probability Axioms and Expected Value Conditional Probability, Bayes’ Formula, and Independent Events
Linearity of Expectation
50
Probability Axioms and Expected Value Conditional Probability, Bayes’ Formula, and Independent Events
Conditional Probability
Conditional Probability
51
Probability Axioms and Expected Value Conditional Probability, Bayes’ Formula, and Independent Events
Conditional Probability
52
Probability Axioms and Expected Value Conditional Probability, Bayes’ Formula, and Independent Events
Conditional Probability
Conditional Probability
An urn contains 5 blue and 7 gray balls. Let us say that 2 balls
are chosen at random, one after the other, without
replacement.
a. Find the following probabilities and illustrate them with a tree diagram:
the probability that both balls are blue, the probability that the first ball
is blue and the second is not blue, the probability that the first ball is not
blue and the second ball is blue, and the probability that neither ball is
blue.
b. What is the probability that the second ball is blue?
c. What is the probability that at least one of the balls is blue?
d. If the experiment of choosing two balls from the urn were repeated
many times over, what would be the expected value of the number of
blue balls?
54
Probability Axioms and Expected Value Conditional Probability, Bayes’ Formula, and Independent Events
Conditional Probability
An urn contains 5 blue and 7 gray balls. Let us say that 2 balls
are chosen at random, one after the other, without
replacement.
Let
S denote the sample space of all possible choices of
two balls from the urn,
B1 be the event that the first ball is blue (then 𝐵1 is
the event that the first ball is not blue),
B2 be the event that the second ball is blue (then 𝐵2 is
the event that the second ball is not blue).
55
Probability Axioms and Expected Value Conditional Probability, Bayes’ Formula, and Independent Events
Conditional Probability
An urn contains 5 blue and 7 gray balls. Let us say that 2 balls are
chosen at random, one after the other, without replacement.
56
Probability Axioms and Expected Value Conditional Probability, Bayes’ Formula, and Independent Events
Conditional Probability
Conditional Probability
Conditional Probability
5 blue, 7 gray. b. What is the probability that the 2nd ball is blue?
𝑃 𝐵2 = 𝑃( 𝐵2 ∩ 𝐵1 ∪ 𝐵2 ∩ 𝐵1 )
= 𝑃 𝐵2 ∩ 𝐵1 + 𝑃 𝐵2 ∩ 𝐵1 by probability axiom 3
20 35 55 𝟓
= + = =
132 132 132 𝟏𝟐
59
Probability Axioms and Expected Value Conditional Probability, Bayes’ Formula, and Independent Events
Conditional Probability
5 blue, 7 gray. c. What is the probability that at least one ball is blue?
𝑃 𝐵1 ∪ 𝐵2 = 𝑃 𝐵1 + 𝑃 𝐵2 − 𝑃 𝐵1 ∩ 𝐵2
60
Probability Axioms and Expected Value Conditional Probability, Bayes’ Formula, and Independent Events
Conditional Probability
61
Probability Axioms and Expected Value Conditional Probability, Bayes’ Formula, and Independent Events
Conditional Probability
7 70 20
P(no blue balls) =
22
P(1 blue ball) = P(2 blue balls) =
132 132
62
Probability Axioms and Expected Value Conditional Probability, Bayes’ Formula, and Independent Events
Bayes’ Theorem
Bayes’ Theorem
Suppose that one urn contains 3 blue and 4 gray balls and a second
urn contains 5 blue and 3 gray balls. A ball is selected by choosing
one of the urns at random and then picking a ball at random from
that urn. If the chosen ball is blue, what is the probability that it
came from the first urn?
This problem can be solved by carefully interpreting all the
information that is known and putting it together in just the right
way.
Let
B be the event that the chosen ball is blue,
U1 the event that the ball came from the first urn, and
U2 the event that the ball came from the second urn.
63
Probability Axioms and Expected Value Conditional Probability, Bayes’ Formula, and Independent Events
Bayes’ Theorem
Bayes’ Theorem
3 of the 7 balls in the first urn are blue, 5 of the 8 balls in the second
urn are blue: 𝑃 𝐵 𝑈1 = 3 and 𝑃 𝐵 𝑈2 = 5
7 8
1
The urns are equally like to be chosen: 𝑃(𝑈1 ) = 𝑃(𝑈2 ) =
2
By formula 9.9.2
𝑃(𝐴 ∩ 𝐵) = 𝑃(𝐵|𝐴) ∙ 𝑃(𝐴)
3 1 3
𝑃 𝐵 ∩ 𝑈1 = 𝑃 𝐵 𝑈1 ∙ 𝑃 𝑈1 = ∙ =
7 2 14
5 1 5
𝑃 𝐵 ∩ 𝑈2 = 𝑃 𝐵 𝑈2 ∙ 𝑃 𝑈2 = ∙ =
8 2 16
𝐵 is a disjoint union of (𝐵 ∩ 𝑈1 ) and (𝐵 ∩ 𝑈2 ), so by probability axiom 3,
𝑃 𝐵 = 𝑃 𝐵 ∩ 𝑈1 ∪ 𝐵 ∩ 𝑈2
3 5 59
= 𝑃 𝐵 ∩ 𝑈1 + 𝑃 𝐵 ∩ 𝑈2 = + =
14 16 112 64
Probability Axioms and Expected Value Conditional Probability, Bayes’ Formula, and Independent Events
Bayes’ Theorem
Bayes’ Theorem
3 of the 7 balls in the first urn are blue, 5 of the 8 balls in the
second urn are blue.
3 59
From previous slide, 𝑃 𝐵 ∩ 𝑈1 = and 𝑃 𝐵 =
14 112
Bayes’ Theorem
𝑃(𝐴|𝐵𝑘 ) ∙ 𝑃(𝐵𝑘 )
𝑃 𝐵𝑘 𝐴 =
𝑃 𝐴 𝐵1 ∙ 𝑃 𝐵1 + 𝑃 𝐴 𝐵2 ∙ 𝑃 𝐵2 + ⋯ + 𝑃(𝐴|𝐵𝑛 ) ∙ 𝑃(𝐵𝑛 )
66
Probability Axioms and Expected Value Conditional Probability, Bayes’ Formula, and Independent Events
Bayes’ Theorem
A false negative result indicates that a patient does not have the
disease when the patient does have it.
67
Probability Axioms and Expected Value Conditional Probability, Bayes’ Formula, and Independent Events
Bayes’ Theorem
68
Probability Axioms and Expected Value Conditional Probability, Bayes’ Formula, and Independent Events
Bayes’ Theorem
69
Probability Axioms and Expected Value Conditional Probability, Bayes’ Formula, and Independent Events
Bayes’ Theorem
By Bayes’ Theorem,
𝑃(𝐴|𝐵1 ) ∙ 𝑃(𝐵1 )
𝑃 𝐵1 𝐴 =
𝑃 𝐴 𝐵1 ∙ 𝑃 𝐵1 + 𝑃(𝐴|𝐵2 ) ∙ 𝑃(𝐵2 )
(0.99) ∙ (0.005)
=
(0.99) ∙ (0.005) + (0.03) ∙ (0.995)
≅ 0.1422 ≅ 𝟏𝟒. 𝟐%
Thus the probability that a person with a positive test result
actually has the disease is approximately 14.2%.
70
Probability Axioms and Expected Value Conditional Probability, Bayes’ Formula, and Independent Events
Bayes’ Theorem
By Bayes’ Theorem,
ҧ 2 ) ∙ 𝑃(𝐵2 )
𝑃(𝐴|𝐵
𝑃 𝐵2 𝐴ҧ =
𝑃 𝐴ҧ 𝐵1 ∙ 𝑃 𝐵1 + 𝑃(𝐴|𝐵 ҧ 2 ) ∙ 𝑃(𝐵2 )
(0.97) ∙ (0.995)
=
(0.01) ∙ (0.005) + (0.97) ∙ (0.995)
≅ 0.999948 ≅ 𝟗𝟗. 𝟗𝟗𝟓%
Thus the probability that a person with a negative test result
does not have the disease is approximately 99.995%.
71
Probability Axioms and Expected Value Conditional Probability, Bayes’ Formula, and Independent Events
Independent Events
Independent Events
A is the event that a head is obtained on the first toss and B is the event
that a head is obtained on the second toss, then if the coin is tossed
randomly both times, events A and B should be independent in the sense
that P(A|B) = P(A) and P(B|A) = P(B).
Observe that:
If P(B) 0 and P(A|B) = P(A),
then P(A B) = P(A|B) P(B) = P(A) P(B) By the same argument,
If P(A) 0 and P(B|A) = P(B),
then P(A B) = P(B|A) P(A) = P(A) P(B)
Conversely,
If P(A B) = P(A) P(B) and P(A) 0, then P(B|A) = P(B).
Independent Events
73
Probability Axioms and Expected Value Conditional Probability, Bayes’ Formula, and Independent Events
Independent Events
Independent Events
Sample space S consists of the 4 outcomes {HH, HT, TH, TT} which
are not equally likely.
Let
E be the event that a head is obtained on the first toss
F be the event that a head is obtained on the second toss
P(E) = P(F) = 0.6.
75
Probability Axioms and Expected Value Conditional Probability, Bayes’ Formula, and Independent Events
Independent Events
P(no heads) =
76
Probability Axioms and Expected Value Conditional Probability, Bayes’ Formula, and Independent Events
Independent Events
Method 1:
P(at least one head) = P(one head) + P(two heads) = 0.48 + 0.36
= 0.84 = 84%
Method 2:
P(at least one head) = 1 – P(no heads) = 1 – 0.16 = 0.84 = 84%
77
Probability Axioms and Expected Value Conditional Probability, Bayes’ Formula, and Independent Events
79
Probability Axioms and Expected Value Conditional Probability, Bayes’ Formula, and Independent Events
80
Probability Axioms and Expected Value Conditional Probability, Bayes’ Formula, and Independent Events
81
Probability Axioms and Expected Value Conditional Probability, Bayes’ Formula, and Independent Events
Suppose that the eight heads occur on the first eight tosses and
that the remaining two tosses are tails. This is the event
H1 H2 H3 H4 H5 H6 H7 H8 T9 T10.
For simplicity, we denote it as HHHHHHHHTT.
By definition of mutually independent events,
P(HHHHHHHHTT) = (0.6)8(0.4)2
By commutative law for multiplication, if the eight heads occur on
any other of the ten tosses, the same number is obtained. Eg:
P(HHTHHHHHTH) = (0.6)2(0.4)(0.6)5(0.4)(0.6) = (0.6)8(0.4)2
82
Probability Axioms and Expected Value Conditional Probability, Bayes’ Formula, and Independent Events
Now there are as many different ways to obtain eight heads in ten
tosses as there are subsets of eight elements (the toss numbers
on which heads are obtained) that can be chosen from a set of
ten elements. This number is 10 8
.
Hence
10
P(eight heads) = 8
(0.6)8(0.4)2
83
Probability Axioms and Expected Value Conditional Probability, Bayes’ Formula, and Independent Events
By similar reasoning,
P(nine heads) = 10 9
(0.6) 9(0.4)
and
P(ten heads) = 1010
(0.6) 10
Therefore,
P(at least 8 heads) = P(8 heads) + P(9 heads) + P(10 heads)
10 10 10
= 8
(0.6)8(0.4)2 + 9
(0.6)9(0.4) + 10
(0.6)10
≅ 0.167 = 16.7%
Probabilities of the form 𝑛𝑘 𝑝𝑛−𝑘 (1 − 𝑝)𝑘 , where 0 ≤ 𝑝 ≤ 1,
are called binomial probabilities.
84
Next week’s lectures
Graphs and Trees
85
END OF FILE
86