MULTIDISCIPLINRY NATURE OF THE ENVIRONMENTAL STUDIES.pptx
16 combinatroics-2
1. JC Liu MACM101 Discrete Mathematics
1
Lecture 16: Combinations (2)
The Binomial Theorem
Combinations with Repetition
Finite Probability (Intro.)
2. JC Liu MACM101 Discrete Mathematics
2
16.1. Binomial Theorem
Consider the n-fold product (a+b)n
:
(a+b)(a+b)…(a+b) = an
+ n⋅an–1
b + n(n–1)/2⋅an–2
b2
+…+ bn
∑=
−
⋅
=+
n
0k
kknn
ba
k
n
)ba(Binomial Theorem (Thm 1.1):
The coefficient of ak
bn–k
is C(n,k)
Example: (a+b)4
= a4
+4⋅a3
b+6⋅a2
b2
+4⋅ab3
+b4
Binomial coefficient
3. JC Liu MACM101 Discrete Mathematics
3
16.1. Binomial Theorem
Method 1: Given set A with n objects
• C(n,k) is the number of subsets with k objects
• Total number of subsets of A is 2n
Method 2: Binomial theorem:
• (1+1)n
=
0
( , ) ( ,0) ( ,1) ... ( , ) 2
n
n
k
C n k C n C n C n n
=
= + + + =∑
∑=
−
⋅
=+
n
0k
kknn
ba
k
n
)ba(Binomial Theorem (Thm 1.1):
The coefficient of ak
bn–k
is C(n,k)
4. JC Liu MACM101 Discrete Mathematics
4
16.1. Binomial Theorem
0
( 1) ( , ) ( ,0) ( ,1) ( ,2) ... ( 1) ( , ) ?
n
k n
k
C n k C n C n c n C n n
=
− = − + − + − =∑
∑=
−
⋅
=+
n
0k
kknn
ba
k
n
)ba(Binomial Theorem (Thm 1.1):
The coefficient of ak
bn–k
is C(n,k)
•(1-1)n
=
5. JC Liu MACM101 Discrete Mathematics
5
16.2. More Combinations
Q1: How many 11-letter words out of “m i s s i s s i p p i”?
Hint: There are 1 “m”, 4 “i”, 4 “s”, and 2 “p”;
calculate the answer by positioning the letters by type:
11!/(1! 4! 4! 2!) = 34650.
Q2: How many 11-letter words using “m”,”i”,”s”,”p”?
-- like Q1, but no limit on the number of each letter
-- duplication allowed
-- order matters (mmmisssimpi <> mimmsssimip)
Q3: How many 11-letter strings using “m”,”i”,”s”,”p” if ignoring order?
-- mmmisssimpi <> mimmsssimip
-- so we can consider alphabetized strings only
6. JC Liu MACM101 Discrete Mathematics
6
16.3. Combinations with Repetitions
Question: How many alphabetized strings are there
of length 3 containing letters a,b,c ?
• Duplication allowed
• Order doesn’t matter
Solution 1: 10
• aaa, aab, aac, abb, abc, acc, bbb, bbc, bcc, and ccc.
Solution 2: Partition
• The only thing that matters is the numbers of each: a,b,c.
• So, introduce 3 nonnegative counters na nb and nc.
• New problem: How many combinations are there such that
na+nb+nc=3? -- easy ?
• Answer is 10: (3,0,0) (2,1,0) … (0,0,3).
7. JC Liu MACM101 Discrete Mathematics
7
16.3. Combinations with Repetitions
Question: How many alphabetized strings are there
of length 3 containing letters a,b,c (note: duplication
allowed)?
Solution 1: List
• aaa, aab, aac, abb, abc, acc, bbb, bbc, bcc, and ccc.
• Total 10
Solution 2: Partition 3
• (3,0,0) (2,1,0) … (0,0,3).
• Visualize it – 3 spaces, divided by 2 separators
= (3,0,0) and = (2,1,0) … and
= (1,1,1) … and = (0,0,3).
• Answer: C(5,2) = 10
8. JC Liu MACM101 Discrete Mathematics
8
16.3. Combinations with Repetitions
Consider a list of k letters, out of a alphabet of n letters.
How many different, alphabetized lists are possible?
• Each letter can be used multiple times
• Order doesn’t matter
Let the 1st
letter occur k1 times, the 2nd
letter occur k2 times,…,
the nth
occur kn times.
• New problem: How many different ways to have k1+…+kn = k?
Consider k places for letters “”, with n–1 separators “”
• Say, k=5, n=3, then 3 (k1) +0 (k2) +2 (k3) = 5 is represented by
Answer: In general, there are C(n+k–1,k) ways.
9. JC Liu MACM101 Discrete Mathematics
9
16.3. Combinations with Repetitions
Consider a list of k letters, out of a alphabet of n letters.
How many different, alphabetized lists are possible?
• New problem: How many different ways to have k1+…+kn = k?
Answer: In general, there are C(n+k–1,k) ways.
Question: How many different non-negative solutions for
x1+x2+x3+x4=7?
Answer: C(4+7-1,7)=120
k=7, n=4
10. JC Liu MACM101 Discrete Mathematics
10
16.3. Combinations with Repetitions
Consider a list of k letters, out of a alphabet of n letters.
How many different, alphabetized lists are possible?
• New problem: How many different ways to have k1+…+kn = k?
Answer: In general, there are C(n+k–1,k) ways.
Question: A donut shop offers 20 kinds of donuts. Assume that there
are at least 12 of each kind. Then how many ways we can select 12
donuts ?
Answer: C(20+12-1,12) = 141,120,525
k=12, n=20 – so k can be < n, but still with repetition
11. JC Liu MACM101 Discrete Mathematics
11
Summarizing
When counting the number if selections of k elements
out of 1,…,n consider two crucial questions:
Repetition: Can an element be picked more than
once?
Order: Does the order of picking matter?
Ordering
matters?
Repetition allowed?
C(n,k),k)1kC(nNo
P(n,k)nYes
NoYes
k
−+
12. JC Liu MACM101 Discrete Mathematics
12
“How to Solve It”
Important observation:
The previous 4 cases are not answers by themselves.
Instead they are tools that you have to learn to use.
It is often not immediately clear which tool to use;
it is a skill to recognize which case you are dealing with.
Tricks of the trade:
When in doubt, try small examples.
Verify your answers (look at extremes like k=0 or n=k).
Practice, practice, practice.
13. JC Liu MACM101 Discrete Mathematics
13
“How to Solve It”
Important observation:
The previous 4 cases are not answers by themselves.
Instead they are tools that you have to learn to use.
It is often not immediately clear which tool to use;
it is a skill to recognize which case you are dealing with.
Tricks of the trade:
When in doubt, try small examples.
Verify your answers (look at extremes like k=0 or n=k).
Practice, practice, practice.
14. JC Liu MACM101 Discrete Mathematics
14
16.4. Intro. Finite Probability
Experiment: toss a fair coin, roll a fair die
Sample space S: all possible outcomes
• Toss coin 1 time: {H, T}
• Toss coin 2 times: {HH, HT, TH, TT}
• Same (or equal) likelihood of occurrence of each outcome
Event: A subset A of S
• Say, both are H
• Can be empty set
Then
• Pr(A) = The probability that A occurs = |A|/|S|
• For each a in S, we have Pr({a})= The probability of each outcome = 1/|
S|
• The equal likelihood assumption
15. JC Liu MACM101 Discrete Mathematics
15
16.4. Intro. Finite Probability
Recall:
• Suppose you flip a fair coin n times. How many different ways can
you get
• no heads?
• exactly one head?
• exactly two heads?
• exactly r heads?
• at least 2 heads?
• Probability of
• no heads?
• exactly one head?
• exactly two heads?
• exactly r heads?
• at least 2 heads?
• What is the experiment ?
• What is sample space S ?
• What is event A ?
• What is outcome a ?
• Think about lottery
16. JC Liu MACM101 Discrete Mathematics
16
9.4. Further Readings
1.3. Binomial Theorem
1.4. Combinations with Repetition
3.4. Finite probability
4.5 Fundamental theorem of arithmetic (side topic)