Section 2: The Multiplication Rule Consider the game of tossing a coin, then rolling a die, then...

12
Section 2: The Multiplication Rule • Consider the game of tossing a coin, then rolling a die, then picking a card. One possible event would be (H, 2, 2clubs). How many events are in the sample space? • One way to visualize this counting problem is to construct a possibility tree, where each intermediate leaf branches out successively according to the type of event generated at that stage. 6.2.1

Transcript of Section 2: The Multiplication Rule Consider the game of tossing a coin, then rolling a die, then...

Page 1: Section 2: The Multiplication Rule Consider the game of tossing a coin, then rolling a die, then picking a card. One possible event would be (H, 2, 2clubs).

Section 2: The Multiplication Rule

• Consider the game of tossing a coin, then rolling a die, then picking a card. One possible event would be (H, 2, 2clubs). How many events are in the sample space?

• One way to visualize this counting problem is to construct a possibility tree, where each intermediate leaf branches out successively according to the type of event generated at that stage.

6.2.1

Page 2: Section 2: The Multiplication Rule Consider the game of tossing a coin, then rolling a die, then picking a card. One possible event would be (H, 2, 2clubs).

Coin - Die - Card Possibility Tree(Start)

Heads Tail

1 2 3 4 5 6 1 2 3 4 5 6

2c...As 2c...As ... 2c...As

6.2.2

Page 3: Section 2: The Multiplication Rule Consider the game of tossing a coin, then rolling a die, then picking a card. One possible event would be (H, 2, 2clubs).

The Multiplication Rule

• The total number of ways of generating output from this last example is obtained by counting the number of leaves at the end of the tree. Clearly in this case the number is 2652 = 624 events.

• The Multiplication Rule: If event1 can be done e1 ways and event2 can be done e2 ways, then the number of ways to complete event1 AND event2 is e1e2 ways.

• The key observations is that AND leads us to multiply the counts.

6.2.3

Page 4: Section 2: The Multiplication Rule Consider the game of tossing a coin, then rolling a die, then picking a card. One possible event would be (H, 2, 2clubs).

License Plates

• Suppose Maryland issued auto license plates using the following scheme:

Letter Letter Letter Digit Digit Digit(where Letter = A,B,...,Z and Digit = 0,1,2,...,9).

• How many possible license plates could be issued without duplication?

Answer: 26

• How about Letter Digit Letter Digit Letter Digit?

Answer: 26

6.2.4

Page 5: Section 2: The Multiplication Rule Consider the game of tossing a coin, then rolling a die, then picking a card. One possible event would be (H, 2, 2clubs).

Cartesian Products & Strings• If a set A has m elements and a set B has n

elements, how many elements are in A B?

• We view this as taking an element from A and then taking an element from B, the multiplication rule applies: |A B| = |A||B| = mn.

• If is an alphabet, how many elements in 6?

• We model this as: __ __ __ __ __ __, where each slot can be filled in one of the elements of .Therefore |6| = |||||||||||| = ||6.

• In general, we see that |n| = ||n.

6.2.5

Page 6: Section 2: The Multiplication Rule Consider the game of tossing a coin, then rolling a die, then picking a card. One possible event would be (H, 2, 2clubs).

Permutations

• A permutation of a collection of objects is an ordering of the objects in a row.

• Equivalently, a permutation is a one-to-one and onto mapping of a set to itself.

List: abcde acdbe

abcde

abcde

BijectiveFunction:

6.2.6

Page 7: Section 2: The Multiplication Rule Consider the game of tossing a coin, then rolling a die, then picking a card. One possible event would be (H, 2, 2clubs).

Counting Permutations

• To count how many permutations (orderings) of n things there are, consider it in terms of filling in slots:

n (n-1) (n-2) ... 3 2 1 .

• We denote this product n(n1)(n2)... 321 as n! (read “n factorial”).

• Hence the number of different orderings of 6 distinct books on a shelf is 6! = 654321 = 720.

• We define 0! = 1 because it makes things work.

6.2.7

Page 8: Section 2: The Multiplication Rule Consider the game of tossing a coin, then rolling a die, then picking a card. One possible event would be (H, 2, 2clubs).

More Counting Permutations• How many orderings of the letters of the word

COMPUTER are there? C O M P U T E R

Answer: 8! = 40,320

• How many orderings of the letters of the word COMPUTER are there if the letters CO must stay together in this order? CO M P U T E R

Answer: 7! = 5,040

• What is the probablilty the CO will appear in a given permutation of the letters of COMPUTER?

Answer: 7!/8! = 7!/(87!) = 1/8.

6.2.8

Page 9: Section 2: The Multiplication Rule Consider the game of tossing a coin, then rolling a die, then picking a card. One possible event would be (H, 2, 2clubs).

Circular Permutations• Permutations are a linear ordering. However, we

can ask how many ways can we order things around a circle (or other closed polygon).

• In this case, the number of ways to arrange n things in a circle (square, hexagon, etc.) is (n1)! since placing the first element does not matter.

• Consider ABCDE around a circle: A E B

D C

E D A

C B

D C E

B A

C B D

A E

B A C

E D

6.2.9

Page 10: Section 2: The Multiplication Rule Consider the game of tossing a coin, then rolling a die, then picking a card. One possible event would be (H, 2, 2clubs).

Partial Permutations• What happens if we don’t want to list out all n

elements in a linear permutation. Suppose we only want the first r elements, where r < n.

______ ______ ______ ... ______ n0 n1 n2 nr1)

• Total = n(n1)(n2)...(nr+1) = n(n1)(n2)...(nr+1)[(nr)!/(nr)!] = n!/(nr)!

• We denote the partial permutation P(n,r).

• Theorem: P(n,r) = n(n1)...(nr+1) = n!/(nr)!

6.2.10

Page 11: Section 2: The Multiplication Rule Consider the game of tossing a coin, then rolling a die, then picking a card. One possible event would be (H, 2, 2clubs).

Evaluating of Partial Permutations• How many 5-letter strings can be formed from the

letters of COMPUTER?

Answer: P(8,5) = 8!/(85)! = 8!/3! = 87654

• How many 6-character license plates can be made if a character can be a letter or digit, but no character can repeat?

Answer: P(36,6) = 36!/30! = 363534333231

• When do you use which formula:– Use n!/(nr)! when the form of the answer counts.– Use the expanded product to actually calculate.

6.2.11

Page 12: Section 2: The Multiplication Rule Consider the game of tossing a coin, then rolling a die, then picking a card. One possible event would be (H, 2, 2clubs).

Summary• Multiplication Rule: If there are m ways to do A

and n ways to do B, then there are (mn) ways to do A and B. (order matters & repetition allowed)

• Permutations (order matters & NO repetition): – There are n! linear orderings of n things.– There are n!/n = (n1)! circular orderings of n things.– There are P(n,r) = n!/(nr)! orderings of r things from

a total of n things.

6.2.12