1. PERMUTATIONS AND COMBINATIONS Sum and product rules

advertisement
Math 274
Combinatorics
Spring 2015
1. PERMUTATIONS AND COMBINATIONS
Sum and product rules
Sum Rule: Suppose we have k mutually disjoint sets of objects S1 , S2 , . . ., Sk . Then the total
number of objects is
|S1 | + |S2 | + . . . + |Sk |.
Note: An ‘object’ is whatever we want to count: can be an event, such as the occurrence of an
ace in a poker hand.
Example: (1) My Math 194 class has 34 students. Bill’s Math 194 class has 29 students. The two
classes go to a computer demonstration together. Altogether there are 34 + 29 = 63 students.
(2) My Math 194 class has 34 students. Susan’s Physics 221 class has 128 students. The two classes
go to a movie together. We cannot tell how many students attend the movie without further
information, because the sets may not be disjoint.
So, note that it is important to make reasonable assumptions when working on combinatorial
problems.
General Product Rule: Suppose the objects we wish to count can be constructed by a k-step
process, where there are always ni choices at the ith step of the process. If any two different
sequences of choices lead to distinct objects then the total number of objects is
n = n1 n2 . . . nk .
Example: (1) Suppose we throw a red die and a green die. How many possible outcomes?
Solution:
Roll red die:
6 possibilities
Roll green die:
6 possibilities
So, total of 6 × 6 = 36 outcomes.
(2) Suppose we throw two indistinguishable white dice. How many possible outcomes?
Solution: We can’t use the product rule here because two different sequences of choices can lead
to the same outcome: 2 then 4 gives same outcome as 4 then 2. (By other methods, e.g.
distributions, answer is 21.)
General Product Rule really consequence of two more fundamental rules.
Basic Product Rule: For finite sets S1 , S2 , . . ., Sk we have |S1 ×S2 ×. . . ×Sk | = |S1 | |S2 | . . . |Sk |.
Bijection Rule: If we have a bijection S → T then |S| = |T |.
Often use sum and product rules together:
Example: I have 13 Math, 3 French and 7 History books. In how many ways can I select two
books not in the same area?
Solution:
M & F:
13 × 3 = 39
M & H:
13 × 7 = 91
H & F:
3 × 7 = 21
Gives total of 151 selections.
Note: ‘Select’ or ‘choose’ means without regard to order: so it doesn’t matter if select Math book
then French book or vice versa. If order matters, word ‘arrange’ usually used.
Example: How many distinguishable nonempty collections can be formed from 7 identical red
balls and 5 identical white balls?
Solution: Consider all collections, including empty one. Can have 0, 1, . . ., 7 red balls: 8 choices.
Can have 0, 1, . . ., 5 white balls: 6 choices. So altogether 8 × 6 = 48 collections, and 1 is
empty, so 47 nonempty collections.
Mark Ellingham
1
Vanderbilt University
Math 274
Combinatorics
Spring 2015
In last example, when subtract off one empty collection, are using the sum rule (using fact that
empty + nonempty = total).
Example: [Correct as of 2015] Alabama car licence plates have a number between 1 and the
number of counties in Alabama, followed by a two letters, followed by a sequence of digits,
for a total of seven characters altogether. What is the maximum number of plates that can
be made (ignoring considerations such as fact that some counties will run out before others in
real life) if Alabama has 67 counties?
Solution: Two cases:
DLLDDDD
9.262 .104
DDLLDDD
(67 − 9).262 .103 = 58.262 .103
2
3
So total is (90 + 58).26 .10 = 100, 048, 000.
Permutations (also known as arrangements)
Example: In how many ways can 7 different books be arranged on a shelf?
Solution:
1st book
7 choices
2nd book
6 choices
..
.
7th book
1 choice
So., by the Product Rule, there are 7.6.5.4.3.2.1 = 7! = 5040 ways.
In general: The number of permutations (arrangements) of n distinct objects is
n(n − 1)(n − 2) . . . 3.2.1 = n!
We may not want to arrange all of the objects.
Example: Twenty horses run in a race. In how many ways can the first, second and third prizes
be awarded?
Solution: 20.19.18 = 6840: there are 20 possible first-prize winners, then 19 second-prize winners,
then 18 third-prize winners.
In general: The number of arrangements of r objects chosen from n objects (r-permutations of
an n-set) is
(n)r = n Pr = P (n, r) = n(n − 1)(n − 2) . . . (n − r + 1)
n(n − 1) . . . (n − r + 1) (n − r)(n − r − 1) . . . 1
=
(n − r)(n − r − 1) . . . 1
= n!/(n − r)!
Notice: earlier formula is a special case of this with r = n; we divide by 0! = 1.
Can use P (n, r) to solve problems even when not in exact form above.
Example: In how many ways can 6 people chosen from 10 people be arranged in a ring? If one
arrangement can be rotated to give a second, the two arrangements are to be considered the
same. (But reflected arrangements are different.)
Solution: Let number be N . Find N indirectly as follows: think of straight line arrangement as
first arranging in a circle, then breaking the circle. So by Product Rule
# straight line arr. = (# circ. arr.) × (# breaks),
i.e. P (10, 6) = 6N .
So the number of circular arrangements is
N = P (10, 6)/6 = 10.9.8.7.6.5/6 = 10.9.8.7.5 = 25 200.
Mark Ellingham
2
Vanderbilt University
Math 274
Combinatorics
Spring 2015
In general: The number of circular arrangements of r objects chosen from a set of n distinct
objects, where rotationally equivalent arrangements are considered to be the same, is P (n, r)/r.
We also want to be able to count arrangements when some of the objects are identical.
Example: In how many ways can 3 identical red balls, 4 identical green balls and 5 identical blue
balls be arranged in a row?
Solution: Suppose number is N . Suppose we take such an arrangement and make it into an
arrangement of 12 distinct objects by numbering the red balls, the green balls and the blue
balls.
Choose red,green,blue arrangement
N ways
Label red balls
3! ways
Label green balls
4! ways
Label blue balls
5! ways
So, end up with a total of N.3!.4!.5! ways. But this must be just the number of ways to arrange
12 distinct objects, i.e. 12!. So
12.11.10.9.8.7.6
12!
=
= 11.10.9.4.7 = 27 720.
3!4!5!
6.24
In general: Suppose we have q1 identical objects of type 1, q2 of type 2, . . ., qt of type t, with
n = q1 + q2 + . . . + qt being the total number of objects. Then the number of distinguishable
arrangements is
n!
q1 !q2 ! . . . qt !
We will see another way of attacking problems like this later.
N=
We also can count arrangements where unlimited repetitions are allowed:
Example: We have an unlimited supply of yellow, white and purple poker chips. In how many
ways can we build a stack of 7 chips?
Solution: There are 3 choices for each of 7 positions, so answer is 37 = 2187.
In general: The number of ways to arrange r objects chosen from an unlimited supply of objects
of n types is nr (n choices for each of r positions).
There are many other arrangement problems - treat them individually.
Combinations (also known as selections)
Example: In how many ways can we choose a committee of 5 people from 11 people?
Solution: If we have chosen the 5 people, we can then arrange them in 5! ways. Thus, the number
of arrangements of 5 people from 11, which we know is P (11, 5), is 5! times the number of ways
to choose 5 people from 11. Thus, the number of ways to choose the 5 people is
11.10.9.8.7
P (11, 5)
=
= 11.2.3.7 = 462.
5!
5.4.3.2.1
In general: The number of ways to select r objects from n distinct objects (the r-combinations of
an n-set) is
n!
n C = C(n, r) = n = P (n, r) =
.
r
r
r!
(n − r)!r!
n
n
Important note:
=
. Can prove in two ways: using formula above, or noticing that
r
n−r
choosing r objects we want amounts to same thing as choosing the n − r we don’t want.
Mark Ellingham
3
Vanderbilt University
Download