CHAPTER 2 Counting

advertisement
CHAPTER 2
Counting
Examples of Counting Problems



Let A={a,b,c}. How many subsets
of A are there?
A penny and a nickel are tossed.
How many possible outcomes are
there?
An experiment consists of flipping
a coin and then rolling a die. How
many different possible outcomes
are there?
Answers: 8, 4, and 12. These are easy
because the sets being counted are small.
Answers



The eight subsets of A are F, {a},
{b},{c},{a,b},{a,c},{b,c},A.
The four possible outcomes are HH,
HT, TH, TT.
The twelve possible outcomes are
(H,1),(H,2),(H,3),…,(H,6),(T,1),…,
(T,6).
A Harder Problem



Of 100 college freshmen, 30 are
taking mathematics, 50 are taking
English and10 are taking both math
and English. The 30 taking math
include the 10 taking both and
likewise for the 50 taking English.
How many are taking English or
math or both?
How many are taking neither?
Solution
Let M denote the set of students taking
math, let E be the set taking English and
let U be the universal set consisting of all
100 students. Refer to the Venn diagram.
U
E
M
Solution
(continued)

n( E  M )  n( E )  n( M )  n( E  M )
n( E  M )  50  30  10  70

n(( E  M )c )  n(U )  n( E  M )
n(( E  M )c )  100  70  30
Addition Principle
If A and B are finite sets,
n( A  B)  n( A)  n( B)  n( A  B)
Subtraction Principle
(Complement Principle)
n( A  B c )  n( A)  n( A  B)

If A is finite,

In particular, if U is finite,
n( B c )  n(U )  n( B)
Example


How many students are taking English but
not math?
Answer:
n( E  M c )  n( E )  n( E  M )  50  10  40
The Multiplication Principle
A local restaurant advertises a fixed
price dinner that includes your
choice of appetizer, entree, and
dessert. If there are 2 appetizers, 3
entrees, and 2 desserts, how many
different dinner combinations are
there?
Tree Diagram
Let A1, A2 denote the appetizers, E1, E2, E3 the
entrees, and D1, D2 the desserts.
D1
D2
E1
A1
D1
E2
E3
D2
D1
D2
D1
D2
E1
A2
D1
E2
E3
D2
D1
D2
The number of outcomes is the number of final
nodes,
in this case 12.
The Multiplication Principle
(continued)



An “experiment” consists of a
sequence of steps S1, S2, …, Sk.
Each Si has ni outcomes, regardless
of the outcomes of previous steps.
Then the experiment has n1  n2  ...  nk
outcomes in all.
Example
Selecting a Sequence with Replacement




How many sequences of two cards
from a standard 52 card deck are
there if the second card is allowed
to be the same as the first?
Answer: 52×52=2704.
How many sequences of k cards are
there if repetitions are allowed?
Answer: 52k.
Example
Selecting a Sequence without Replacement





How many sequences of 2 cards
from a standard deck are there if
repetitions are not allowed?
Answer: 52×51=2652
How many sequences of k cards are
there if repetitions are not allowed?
Answer: 52×51×…×(52-k+1)
Note: k≤52
General Rule
Selecting with Replacement




How many sequences of two objects
from a set of n objects are there if
repetitions are allowed?
Answer: n×n
How many sequences of k out of n
objects are there if repetitions are
allowed?
Answer: n×n×…×n=nk
General Rule
Selecting without Replacement





How many sequences of two objects
out of a set of n objects are there if
repetitions are not allowed?
Answer: n×(n-1)
How many sequences of k out of n
objects are there if repetitions are
not allowed?
Answer: n×(n-1)×…×(n-k+1)
Note: k≤n
Permutations


Let S be a set of n objects. A
permutation of length k from S is a
nonrepeating sequence of length k from
S.
The number of permutations of length k
from a set of n objects is, for k≤n,
Pn,k  n(n  1)  (n  k  1)
The Factorial Function





If k=n, Pn,n=n×(n-1) ×…×2×1
Also written n!=1×2×…×(n-1)×n
Pronounced “n factorial”.
Examples: 1!=1; 2!=2; 3!=6;
4!=24; 5!=120, 6!=720.
By definition, 0!=1. This makes
formulas work out nicely.
Example



King Arthur sits on the North side of the
round table. The 12 knights are seated
around the table. How many possible
arrangements are there?
Answer: 12!=479,001,600.
If Lancelot always sits on Arthur’s left or
right, there are 2×11!=79,833,600
possible arrangements (by the
multiplication principle.)
Another Formula for Pn,k
n!
Pn ,k 
(n  k )!
Combinations



Let S be a set with n elements. A
combination of k elements of S is a
subset of S with k elements.
A set is not the same thing as a
sequence. {a,b,c} and {c,b,a} are
the same set. (a,b,c) and (c,b,a)
are different sequences.
Therefore, a combination is not the
same as a permutation.
Poker


A five-card draw poker hand is dealt all at
once and seen only by the person holding
the hand. Therefore, the order of the
cards is irrelevant to the betting. A hand
is a combination of 5 of the 52 cards.
A five-card stud poker hand is dealt one
card at a time and some of the cards are
seen by other players. The order of the
cards may affect the betting. A hand is a
permutation of 5 of the 52 cards.
Counting Combinations



Two-stage experiment resulting in a
permutation of k out of n objects:
Stage 1- select a combination of k
out of n objects. Let Cn,k denote the
number of possible outcomes.
Stage 2- arrange the k selected
objects in some order. Pk,k=k! is
the number of outcomes.
Counting Combinations
(continued)

By the multiplication principle,
Pn ,k  Cn ,k Pk ,k


We know Pn,k and Pk,k, so
n!
 Cn ,k  k!
(n  k )!
Solving for the unknown,
n!
 Cn , k
k!(n  k )!
Draw Poker


How many 5-card draw hands are there in
poker? I.e., how many subsets of 5
objects are there in a set of 52 objects?
Answer:
C52,5 

52!
52  51  50  49  48  47! 52  51  50  49  48


 2,598,960
47! 5!
47!5!
5  4  3  2 1
Suggestion: Use the Cn,k button on your
calculator. Don’t try to evaluate by hand.
Stud Poker


How many 5-card stud hands are
there in poker? I.e., how many
permutations of 5 objects from a
set of 52 are there?
Answer:
P52,5=C52,5×5!=2,598,960×120
=311,875,200.
A Property of Cn,k
If S is a set of n elements, then the
number of subsets with k elements
is the same as the number of
subsets with n-k elements because
there is a one to one
correspondence between sets of
size k and their complements of size
n-k. I.e., Cn,k=Cn,n-k. This can also
be derived algebraically.
Another Example of the Multiplication
Principle


A license plate is a sequence of 3 letters
followed by a sequence of 3 numerals.
Repetitions are allowed. How many
license plates are possible?
Answer: There are 263 possible
arrangements of the three letters and 103
possible arrangements of the three
numerals. Therefore, there are 263×
103=17,576,000 possible license plates.
The Binomial Theorem

The numbers Cn,k occur in the binomial
theorem. Sometimes called the binomial
coefficients.
Example: (a  b)1  a  b  C1,0 a1b0  C1,1a0b1

Example:

(a  b)2  a 2  2ab  b2  C2,0a 2b0  C2,1a1b1  C2,2a0b2

In general, using summation notation,
n
( a  b)   C n , k a n  k b k
n
k 0
How Many Subsets Does a Set Have?


Let S be a set with n elements.
The number of subsets of S is
n
Cn ,0  Cn ,1  Cn , 2  Cn ,3  ...  Cn ,n 1  Cn ,n   Cn ,k
k 0

Expand 2n=(1+1)n by the binomial
n
n
theorem:
n
nk k
(1  1)   Cn ,k 1 1   Cn ,k
k 0

k 0
Therefore, S has 2n subsets, including the
empty set and S itself.
Example


How many subsets does the set of
cards in a standard deck have?
Answer: 252, which is approximately
1016.
Thought Experiment



Your class has n students. You send your
principal a coded message telling her
which students are going to flunk. The
message is a sequence of 0’s and 1’s,
where a 1 in position i of the sequence
indicates that student number i will flunk.
Use the multiplication principle to
determine how many such messages
there are.
Comment on the answer.
Download