26
Counting Counting Principles Principles

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

Embed Size (px)

Citation preview

Page 1: Counting Principles. Counting examples Ex 1: A small sandwich café has 4 different types of bread, 5 different types of meat and 3 different types of

Counting Counting PrinciplesPrinciples

Page 2: Counting Principles. Counting examples Ex 1: A small sandwich café has 4 different types of bread, 5 different types of meat and 3 different types of

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

Page 3: Counting Principles. Counting examples Ex 1: A small sandwich café has 4 different types of bread, 5 different types of meat and 3 different types of

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)

Page 4: Counting Principles. Counting examples Ex 1: A small sandwich café has 4 different types of bread, 5 different types of meat and 3 different types of

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)

Page 5: Counting Principles. Counting examples Ex 1: A small sandwich café has 4 different types of bread, 5 different types of meat and 3 different types of

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

Page 6: Counting Principles. Counting examples Ex 1: A small sandwich café has 4 different types of bread, 5 different types of meat and 3 different types of

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

Page 7: Counting Principles. Counting examples Ex 1: A small sandwich café has 4 different types of bread, 5 different types of meat and 3 different types of

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.

Page 8: Counting Principles. Counting examples Ex 1: A small sandwich café has 4 different types of bread, 5 different types of meat and 3 different types of

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.

Page 9: Counting Principles. Counting examples Ex 1: A small sandwich café has 4 different types of bread, 5 different types of meat and 3 different types of

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?

Page 10: Counting Principles. Counting examples Ex 1: A small sandwich café has 4 different types of bread, 5 different types of meat and 3 different types of

CombinationCombination

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

n r

nC

r

Page 11: Counting Principles. Counting examples Ex 1: A small sandwich café has 4 different types of bread, 5 different types of meat and 3 different types of

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.).

Page 12: Counting Principles. Counting examples Ex 1: A small sandwich café has 4 different types of bread, 5 different types of meat and 3 different types of

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?

Page 13: Counting Principles. Counting examples Ex 1: A small sandwich café has 4 different types of bread, 5 different types of meat and 3 different types of

CombinationCombination• Some very

important properties of combination:

0! 1

10

n n

k n k

n n

n

Page 14: Counting Principles. Counting examples Ex 1: A small sandwich café has 4 different types of bread, 5 different types of meat and 3 different types of

Five Special Five Special Counting CasesCounting Cases

Page 15: Counting Principles. Counting examples Ex 1: A small sandwich café has 4 different types of bread, 5 different types of meat and 3 different types of

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

Page 16: Counting Principles. Counting examples Ex 1: A small sandwich café has 4 different types of bread, 5 different types of meat and 3 different types of

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

Page 17: Counting Principles. Counting examples Ex 1: A small sandwich café has 4 different types of bread, 5 different types of meat and 3 different types of

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!

Page 18: Counting Principles. Counting examples Ex 1: A small sandwich café has 4 different types of bread, 5 different types of meat and 3 different types of

Alike ObjectsAlike Objects

Page 19: Counting Principles. Counting examples Ex 1: A small sandwich café has 4 different types of bread, 5 different types of meat and 3 different types of

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!

Page 20: Counting Principles. Counting examples Ex 1: A small sandwich café has 4 different types of bread, 5 different types of meat and 3 different types of

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!

Page 21: Counting Principles. Counting examples Ex 1: A small sandwich café has 4 different types of bread, 5 different types of meat and 3 different types of

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

Page 22: Counting Principles. Counting examples Ex 1: A small sandwich café has 4 different types of bread, 5 different types of meat and 3 different types of

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

Page 23: Counting Principles. Counting examples Ex 1: A small sandwich café has 4 different types of bread, 5 different types of meat and 3 different types of

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

Page 24: Counting Principles. Counting examples Ex 1: A small sandwich café has 4 different types of bread, 5 different types of meat and 3 different types of

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

Page 25: Counting Principles. Counting examples Ex 1: A small sandwich café has 4 different types of bread, 5 different types of meat and 3 different types of

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.

Page 26: Counting Principles. Counting examples Ex 1: A small sandwich café has 4 different types of bread, 5 different types of meat and 3 different types of

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