Counting Principles. Counting examples Ex 1: A small sandwich café has 4 different types of bread,...

Preview:

Citation preview

Counting Counting PrinciplesPrinciples

Counting examplesCounting examples• Ex 1: A small sandwich café has 4 different types

of bread, 5 different types of meat and 3 different types of cheese. If a sandwich is made by one bread, one meat and one cheese, how many different sandwiches can the café make?– Solution: (4)(5)(3)=60

• Ex 2: A businessman wants to travel from Houston to Dallas by either airplane or bus. There are 5 different airlines and 4 different bus companies that offer tickets. How many different travel plans are there for the businessman?– Solution: 5+4=9

Basic Counting PrinciplesBasic Counting Principles• Multiplication Principle

– Event A can occur in m different ways, and after event A has occurred, event B can occur in n different ways. Then the number of ways that the two events occur is m·n.

• Addition Principle– Let event A and B be mutually exclusive events. If

event A can occur in m different ways and event B can occur in n different ways, then the number of ways that event A or B occurs is m+n.

– Two events are mutually exclusive if they have no outcomes in common. (aka: they cannot both happen)

PermutationPermutation• A permutation is an arrangement of

n unique elements in a definite order.• Ex: permutations of letters a, b, c:

– abc, acb, bac, bca, cab, cba– Total of 6 different ways of

arrangements. (aka: 6 permutations)

FactorialFactorial• n! = n(n-1)(n-2)…(3)(2)(1)• Ex: How many ways can you arrange

the three distinct letters a, b and c?• Solution: 3! = 6

Example: PermutationExample: Permutation• A classroom has 20 students. A

three people committee contains a president, a vice president and a spirit icon. How many different ways can this committee be formed?– Solution: (20)(19)(18) = 6840

PermutationPermutation• It is useful, on occasion, to order a subset of a

collection of elements rather than the entire collection. For example, you might want to choose and order r elements out of a collection of n elements. Such an ordering is called a permutation of n elements taken r at a time.

CombinationCombination• When you count the number of possible

permutations of a set of elements, order is important. As a final topic in this section, you will look at a method of selecting subsets of a larger set in which order is not important. Such subsets are called combinations of n elements taken r at a time.

• For instance, the combinations {A,B,C} and {B,C,A} are equivalent because both sets contain the same three elements, and the order in which the elements are listed is not important. So, you would count only one of the two sets.

Permutation vs CombinationPermutation vs Combination• From a group of 10

people, 3 will receive prizes. One will receive $30, one will receive $20 and one will receive $10. How many different ways can the three people be chosen to receive these prizes?

• From a group of 10 people, 3 will receive prizes. The three people will each receive $20. How many different ways can the three people be chosen to receive these prizes?

CombinationCombination

• It reads as n choose r.• Other notations:

n r

nC

r

Example: CombinationsExample: Combinations• A standard poker hand

consists of five cards dealt from a deck of 52. How many different poker hands are possible? (After the cards are dealt, the player may reorder them, and so order is not important.).

Example: CombinationsExample: Combinations• You are forming a 12-member swim team

from 10 girls and 15 boys. The team must consist of five girls and seven boys. How many different 12-member teams are possible?

CombinationCombination• Some very

important properties of combination:

0! 1

10

n n

k n k

n n

n

Five Special Five Special Counting CasesCounting Cases

Case 1: Adjacent ObjectsCase 1: Adjacent Objects• How many different ways can the

letters A, B, C, D and E be arranged if B has to follow right behind A?– Trick: Treat “AB” as one object.– Solution: 4! = 24

ExampleExample• A family of 6 members are to be

seated in a row of 6 chairs. – How many ways can they sit if the mom

and dad want to sit next to each other?– Solution: (2!)(5!) = 240

– How many ways can they sit if the mom and dad do NOT want to sit next to each other?

– Solution: 6! – 240 = 480

Case 2: Alike ObjectsCase 2: Alike Objects• In how many distinguishable ways can the

letters in BANANA be written?– Note: There are 3 A’s and 2 N’s, they are not

distinct letters.

6!

603! 2!

Alike ObjectsAlike Objects

ExampleExample• How many ways can the letters in

MISSISSIPPI be arranged?– Total of 11 letters– Repeated letters: 4 I, 4 S, 2 P.

11!

346504! 4! 2!

ExampleExample• If you start from

point A, and you can only move either up or right for one unit each time. How many different paths are there to point B?

7!35

3! 4!

Case 3: Flippable StringsCase 3: Flippable Strings• Four small cubes of colours red,

green, blue and black are glued together to form a colourful rectangular prism. How many ways can these four cubes be glued together?– Note: Same arrangement after flipping– Trick: (n!)/2– Solution: (4!)/2 = 12

ExampleExample• Six pieces of pearls of different

shapes are connected together by a string to form a little hanging string for decoration purpose. In how many ways can this string be made?– Solution: (6!)/2 = 360

Case 4: Round TableCase 4: Round Table• Four people are sitting around a

round table for dinner. In how many ways can these four people be seated?– Note: Same arrangement after rotation– Trick: (n-1)!– Solution: (4-1)! = 6

ExampleExample• Eight people are sitting around a

table for a poker game with their poker faces on. How many ways can these eight people be seated in the game?– Solution: (8-1)! = 5040

Case 5: KeychainCase 5: Keychain• How many ways can 4 keys be

arranged on a keychain ring?– Note: Flippable round table– Trick: (n-1)!/2– Solution: (4-1)!/2 = 3– Special note: Please do not put only one

key on a keychain ring.

ExampleExample• Seven pieces of different pearls are

placed around a circular wire to form a necklace. In how many ways can this necklace be made?– Solution: (7-1)!/2 = 360

Recommended