Download 5-2

Survey
yes no Was this document useful for you?
   Thank you for your participation!

* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project

Document related concepts
no text concepts found
Transcript
Simple Arrangements &
Selections
Copyright © Peter Cappello 2011
Combinations & Permutations
• A permutation of n distinct objects is an arrangement, or
ordering, of the n objects.
• An r-permutation of n distinct objects is an arrangement
using r of the n objects.
• An r-combination of n objects is an unordered selection, or
subset, of r of the n objects.
Copyright © Peter Cappello 2011
Notation
• P(n, r) denotes the number of r-permutations of n distinct
objects.
• C(n, r) denotes the number of r-combinations of n distinct
objects.
• It is spoken “n choose r”.
• The C(n, r) are known as “binomial coefficients” (for
reasons that will become clear later).
Copyright © Peter Cappello 2011
Formula for P(n, r)
• By the product rule,
• P(n, 1) = n; P(n, 2) = n(n - 1); P(n, 3) = n(n - 1)(n - 2); …
• P(n, n) = n!
• n choices for the 1st position
• (n - 1) choices for the 2nd position, …,
• 1 choice for the nth position.
• P(n, r) = n(n - 1) . . . n - (r - 1) )
= n(n - 1) . . . (n - (r - 1)) (n - r)!/(n - r)!
= n!/(n - r)!
Copyright © Peter Cappello 2011
Formula for C(n, r)
• All r-permutations can be counted by the product rule:
1. pick the r elements to be ordered: C(n, r)
2. Order the r elements: P(r, r) = r!
• That is, P(n, r) = C(n, r) P(r, r) = n!/(n - r)!
• Thus, C(n, r) = n!/(r!(n - r)!)
Copyright © Peter Cappello 2011
C(n, r) = C(n, n - r).
Give a counting argument for this.
Copyright © Peter Cappello 2011
Example
How many ways can 7 women & 3 men be arranged in a row, if
the 3 men must be adjacent?
Copyright © Peter Cappello 2011
How many ways can 7 women & 3 men be arranged in a row,
if the 3 men must be adjacent?
Treat the men as a block.
1.
There are P(8, 8) ways to arrange the 7 women + 1 block.
2. There are P(3, 3) ways to arrange the men.
By the product rule, there are 8!3! ways.
Copyright © Peter Cappello 2011
Example
How many ways are there to arrange the alphabet so that
there are exactly 5 letters between a & b?
Copyright © Peter Cappello 2011
How many ways are there to arrange the alphabet so that there
are exactly 5 letters between a & b?
1. Pick the position of the left letter of a & b: C(20, 1)
(This forces the position of the other letter.)
2. Pick the order of a & b: P(2, 2)
3. Arrange the other letters: P(24, 24).
By the product rule: C(20, 1)P(2, 2)P(24, 24)
Copyright © Peter Cappello 2011
Example
How many 6-digit numbers without repetition are there so
that the digits are nonzero, and 1 & 2 do not appear
consecutively?
Copyright © Peter Cappello 2011
How many 6-digit numbers without repetition are there so
that the digits are nonzero, and 1 & 2 do not appear
consecutively?
It is simpler to do this indirectly:
• There are P(9, 6) ways to arrange 6 nonzero digits
without repetition.
• Subtract the number of ways to arrange the digits so
that 1 & 2 are consecutive:
Copyright © Peter Cappello 2011
1.
There are C(5, 1) ways to pick the leftmost position
where the 1 or 2 go.
2.
There are P(2, 2) ways to order 1 & 2.
3.
There are P(9 - 2, 4) ways to order the other 4 digits.
The number of ways to do this thus is:
P(9, 6) - C(5, 1)P(2, 2)P(7, 4).
Copyright © Peter Cappello 2011
Example
How many ways are there to arrange the letters in the word
MISSISSIPPI?
Copyright © Peter Cappello 2011
How many ways are there to arrange the letters in the word
MISSISSIPPI?
Since the letters are not distinct, the answer is less than
P(11,11) = 11!
1. Pick the 1 position where the M goes: C(11,1)
2. Pick the 4 positions where the Is go: C(10,4)
3. Pick the 4 positions where the Ss go: C(6,4)
4. Pick the 2 positions where the Ps go: C(2,2)
There are C(11,1) C(10,4) C(6,4) C(2,2) ways.
Copyright © Peter Cappello 2011
Example
How many committees of 4 people can be chosen from a set of
7 women and 4 men such that there are at least 2 women?
Copyright © Peter Cappello 2011
There are at least 2 women?
If we
1. pick 2 women
2. pick 2 more people without restriction,
we get: C(7, 2)C(9,2).
• This is wrong; some committees are counted more than once.
• Use a tree diagram to identify this product rule misuse .
Copyright © Peter Cappello 2011
The Set Composition Rule
•
When using the product rule, each component must be
selected in a distinct stage.
• In the incorrect counting process, we cannot tell which women
were picked in stage 1, & which were picked in stage 2.
Copyright © Peter Cappello 2011
To fix this: Use the addition rule
Partition the set of committees into:
• those with 2 women: C(7, 2)C(4, 2)
• those with 3 women: C(7, 3)C(4, 1)
• those with 4 women: C(7, 4)C(4, 0)
There thus are
C(7, 2)C(4, 2) + C(7, 3)C(4, 1) + C(7, 4)C(4, 0) such
committees.
Copyright © Peter Cappello 2011
Example
How many ways are there to arrange As & Us such that the
3rd U appears as the 12th letter in a 15 letter sequence?
Copyright © Peter Cappello 2011
Example Solution
How many ways are there to arrange As & Us such that the
3rd U appears as the 12th letter in a 15 letter sequence?
In the 1st 11 letters, U appears exactly 2 times.
Copyright © Peter Cappello 2011
Use the product rule:
1. Pick the positions of the 1st 2 Us: C(11, 2)
2. Put As in the 9 open positions: 1
3. Put the 3rd U in position 12: 1
4. Pick the 3 letters that follow the 12th: 23.
Copyright © Peter Cappello 2011