1 Outline 1. Why we need counting rules 2. Multiplicative counting rule 3. Partitions 4....

40
1 Outline 1. Why we need counting rules 2. Multiplicative counting rule 3. Partitions 4. Permutations 5. Combinations 6. Examples Lecture 3

Transcript of 1 Outline 1. Why we need counting rules 2. Multiplicative counting rule 3. Partitions 4....

Page 1: 1 Outline 1. Why we need counting rules 2. Multiplicative counting rule 3. Partitions 4. Permutations 5. Combinations 6. Examples Lecture 3.

1

Outline

1. Why we need counting rules 2. Multiplicative counting rule3. Partitions4. Permutations5. Combinations6. Examples

Lecture 3

Page 2: 1 Outline 1. Why we need counting rules 2. Multiplicative counting rule 3. Partitions 4. Permutations 5. Combinations 6. Examples Lecture 3.

2

1. Why we need Counting Rules

• A probability is a ratio.

– The denominator records the number of possible outcomes in the “universe” of the experiment.

– The numerator records the number of possible outcomes that match some description (an “event”).

– The probability is the ratio of these numbers.

Lecture 3

Page 3: 1 Outline 1. Why we need counting rules 2. Multiplicative counting rule 3. Partitions 4. Permutations 5. Combinations 6. Examples Lecture 3.

3

1. Why we need Counting Rules

• Sometimes, each of these numbers is easy to count – as with last week’s example of 2 coin tosses.

– There are 4 possible outcomes: HH, HT, TH, TT– Event = one head in two tosses.

Lecture 3

Page 4: 1 Outline 1. Why we need counting rules 2. Multiplicative counting rule 3. Partitions 4. Permutations 5. Combinations 6. Examples Lecture 3.

4

1. Why we need Counting Rules

• But sometimes the numbers are so large that we cannot count all the relevant outcomes.– How many different poker hands (sets of 5 cards

drawn randomly from a deck of 52 cards) are there?

• On those occasions, we use Counting Rules. Perhaps these should be called “So you don’t have to Count Rules.”

Lecture 3

Page 5: 1 Outline 1. Why we need counting rules 2. Multiplicative counting rule 3. Partitions 4. Permutations 5. Combinations 6. Examples Lecture 3.

5

Multiplicative Counting Rule

• From many sets to one set – how many ways are there to choose one item from each of k sets of size ni?

Lecture 3

Page 6: 1 Outline 1. Why we need counting rules 2. Multiplicative counting rule 3. Partitions 4. Permutations 5. Combinations 6. Examples Lecture 3.

6

Multiplicative Counting Rule

• You have k sets of size ni.

• You choose one element from each set.• There are n1 ways to do this for Set 1.

• There are n2 ways to do this for Set 2. Etc.

• Total # of ways of doing this is:n1 * n2 *… nk

Lecture 3

Page 7: 1 Outline 1. Why we need counting rules 2. Multiplicative counting rule 3. Partitions 4. Permutations 5. Combinations 6. Examples Lecture 3.

7

Counting Rules - Partitions

• From one set to many sets – how many ways are there to choose ni items from one big set to put into each of k sets of size ni?

Lecture 3

Page 8: 1 Outline 1. Why we need counting rules 2. Multiplicative counting rule 3. Partitions 4. Permutations 5. Combinations 6. Examples Lecture 3.

8

Counting Rules - Partitions

• Note that we have selected 5 subsets of elements – four that go into the small circles and one that stays at home in the big circle.

Lecture 3

Page 9: 1 Outline 1. Why we need counting rules 2. Multiplicative counting rule 3. Partitions 4. Permutations 5. Combinations 6. Examples Lecture 3.

9

Counting Rules – Partitions

• You have one group with N elements to be divided into k groups with ni in each group.

• The # of ways to do this is:

N!n1!n2!...nk!

Lecture 3

Page 10: 1 Outline 1. Why we need counting rules 2. Multiplicative counting rule 3. Partitions 4. Permutations 5. Combinations 6. Examples Lecture 3.

10

Counting Rules - Permutations

• From one big set to one smaller set – how many ways are there to choose n items from one big set to put into one smaller set when the order of the items matters?

Lecture 3

Page 11: 1 Outline 1. Why we need counting rules 2. Multiplicative counting rule 3. Partitions 4. Permutations 5. Combinations 6. Examples Lecture 3.

11

Counting Rules - Permutations

• From one bigger set of N items, you select one smaller set of n items. Order matters – as in a horse race: A , B, C is different than C, B, A.

PN = N! (N-n)!

Lecture 3

n

Page 12: 1 Outline 1. Why we need counting rules 2. Multiplicative counting rule 3. Partitions 4. Permutations 5. Combinations 6. Examples Lecture 3.

12

Counting Rules - Combinations

• From one big set to one smaller set – how many ways are there to choose n items from one big set to put into one smaller set when the order of the items doesn’t’ matter?

Lecture 3

Page 13: 1 Outline 1. Why we need counting rules 2. Multiplicative counting rule 3. Partitions 4. Permutations 5. Combinations 6. Examples Lecture 3.

13

Counting Rules – Combinations

• From one bigger set of N items, you select one smaller set of n items. Order does not matter – if you put lettuce in your cart first and juice second, or juice first and lettuce second, you still go home with both.

N = CN = N!n!(N-n)!

Lecture 3

n

Page 14: 1 Outline 1. Why we need counting rules 2. Multiplicative counting rule 3. Partitions 4. Permutations 5. Combinations 6. Examples Lecture 3.

14

Permutations vs. Combinations

• If order doesn’t matter, there will be fewer ways to select n items from a set of N.

• Then, the denominator will be bigger, and the resulting ratio will be smaller.

PN = N! N = CN = N!(N-n)! n!(N-n)!

Lecture 3

n n

Page 15: 1 Outline 1. Why we need counting rules 2. Multiplicative counting rule 3. Partitions 4. Permutations 5. Combinations 6. Examples Lecture 3.

15

Counting Rules – Example 1

• Dr. Mousekin currently has 20 rats in his laboratory representing 3 strains: Wistar, Sprague-Dawley, and Long-Evans. There are 6 Wistar, 8 Sprague-Dawleys, and 6 Long-Evans rats. 75% of the Sprague-Dawley rats are female, all the Long-Evans rats are female, and all the Wistars are male.

Lecture 3

Page 16: 1 Outline 1. Why we need counting rules 2. Multiplicative counting rule 3. Partitions 4. Permutations 5. Combinations 6. Examples Lecture 3.

16

Counting Rules – Example 1

• a. The rats are randomly selected to participate in 3 experiments with the first experiment requiring 4 subjects, the second 10 subjects, and the third 6 subjects. How many ways are there to assign rats to experiments if there are no further restrictions?

Lecture 3

Page 17: 1 Outline 1. Why we need counting rules 2. Multiplicative counting rule 3. Partitions 4. Permutations 5. Combinations 6. Examples Lecture 3.

17

Counting Rules – Example 1

Expt #1 – n=4Expt #2 – n=10Expt #3 – n=6

Here, we are dividing up all the rats among 3 groups. This is a partition.

# ways = 20! = 38,798,760 4!10!6!

Lecture 3

Page 18: 1 Outline 1. Why we need counting rules 2. Multiplicative counting rule 3. Partitions 4. Permutations 5. Combinations 6. Examples Lecture 3.

18

Counting Rules – Example 1

b. The rats are individually housed in a long metal rack with 20 cages in a row. What is the probability that all the rats of the same sex are housed consecutively?

This question asks “what is the probability…” – not “how many ways are there…” Be sensitive to that difference!

Lecture 3

Page 19: 1 Outline 1. Why we need counting rules 2. Multiplicative counting rule 3. Partitions 4. Permutations 5. Combinations 6. Examples Lecture 3.

19

Counting Rules – Example 1

• How many ? Answer: 6 S-D + 6 L-E = 12♀

• We need to work out– how many ways of ordering the rats there are in total– how many ways there are of ordering the sexes; and– how many ways there are of ordering the rats in each sex

group?

Lecture 3

Page 20: 1 Outline 1. Why we need counting rules 2. Multiplicative counting rule 3. Partitions 4. Permutations 5. Combinations 6. Examples Lecture 3.

20

Counting Rules – Example 1

• How many ways are there of ordering the rats in total (with no restrictions of any kind)?

• Answer: 20!

• There are 20 ways to choose the first rat. For each of those 20 ways, there are 19 ways to choose the second rat. For each of the (20*19) ways of choosing the first two rats, there are 18 ways of choosing the third rat, and so on…

Lecture 3

Page 21: 1 Outline 1. Why we need counting rules 2. Multiplicative counting rule 3. Partitions 4. Permutations 5. Combinations 6. Examples Lecture 3.

21

Counting Rules – Example 1

• how many ways are there of ordering the sexes?

• There are two sexes, so there are 2! = 2 ways of ordering them.

• There are 2 ways of picking the first sex. For each of those, there is 1 way of picking the second sex – hence, 2 * 1 = 2! = 2 ways.

Lecture 3

Page 22: 1 Outline 1. Why we need counting rules 2. Multiplicative counting rule 3. Partitions 4. Permutations 5. Combinations 6. Examples Lecture 3.

22

Counting Rules – Example 1

• how many ways are there of ordering the rats in each sex group?

• There are 8 rats and 12 rats. The 8 male rats ♂ ♀

can be ordered in 8! ways. The 12 female rats can be ordered in 12! ways.

Lecture 3

Page 23: 1 Outline 1. Why we need counting rules 2. Multiplicative counting rule 3. Partitions 4. Permutations 5. Combinations 6. Examples Lecture 3.

23

Counting Rules – Example 1

• Now we can compute the probability:

P = 8! 12! 2! = .00001588 20!

Lecture 3

Page 24: 1 Outline 1. Why we need counting rules 2. Multiplicative counting rule 3. Partitions 4. Permutations 5. Combinations 6. Examples Lecture 3.

24

Counting Rules – Example 1

c. Dr. Mousekin now conducts 3 more experiments with these rats, using 4, 6, and 4 subjects respectively. Each experiment, taken individually, must have the same # of male and female rats. How many ways can this be done?

Lecture 3

Page 25: 1 Outline 1. Why we need counting rules 2. Multiplicative counting rule 3. Partitions 4. Permutations 5. Combinations 6. Examples Lecture 3.

25

Counting Rules – Example 1

12 8 10 6 7 3 2 2 3 3 2 2 or…

12! * 8!2!3!2!5! 2!3!2!1! or…

8 7! * 12 7! = 279417600 7 2!3!2! 7 2!3!2!

Lecture 3

( () ( (( () ) ) ) )

( () )

Page 26: 1 Outline 1. Why we need counting rules 2. Multiplicative counting rule 3. Partitions 4. Permutations 5. Combinations 6. Examples Lecture 3.

26

Counting Rules – Example 1

d. The company from which Dr. Mousekin gets his rats maintains a large stock of rats in which the proportion of rats from the 3 strains is .30, .60, and .10, for W, S-D, and L-E, respectively. Of the W rats, 70% are , while 36% of the L-♀

E rats are , and the two sexes are equally ♀

represented among S-D rats. You randomly select a rat and it is a male. What is the probability that it is a S-D?

Lecture 3

Page 27: 1 Outline 1. Why we need counting rules 2. Multiplicative counting rule 3. Partitions 4. Permutations 5. Combinations 6. Examples Lecture 3.

27

Counting Rules – Example 1

P(W) = .3 P( │W) = .7♀ P( │W) = .3♂

P(SD) = .6 P( │SD) = .5♀ P( │SD) = .5♂

P(LE) = .1 P( │LE) = .36♀ P( │LE) = .54♂

P(SD│M) = P(SD∩M) P(M)

= (.6)(.5) (.6)(.5) + (.3)(.3) + (.1)(.64)

Lecture 3

Page 28: 1 Outline 1. Why we need counting rules 2. Multiplicative counting rule 3. Partitions 4. Permutations 5. Combinations 6. Examples Lecture 3.

28

Lecture 3

W

SD

LE

♂.3

.6

.1

.7

.3

.5

.5

.36

.64

.21

.09

.30

.30

.036

.064

P(♂) = .30 + .09 + .064

Page 29: 1 Outline 1. Why we need counting rules 2. Multiplicative counting rule 3. Partitions 4. Permutations 5. Combinations 6. Examples Lecture 3.

29

Counting Rules – Example 1

P( ) = .30 + .09 + .064 = .454♂

P(SD│M) = .30 = .64.454

Lecture 3

Page 30: 1 Outline 1. Why we need counting rules 2. Multiplicative counting rule 3. Partitions 4. Permutations 5. Combinations 6. Examples Lecture 3.

30

Counting Rules – Example 2

A bag contains 4 red marbles numbered 1-4, 6 green marbles numbered 5-10, and 2 blue marbles numbered 11-12.

a. Six marbles are randomly drawn. What is the probability that an equal # of each color are drawn?

Lecture 3

Page 31: 1 Outline 1. Why we need counting rules 2. Multiplicative counting rule 3. Partitions 4. Permutations 5. Combinations 6. Examples Lecture 3.

31

Counting Rules – Example 2

This is a probability question, so we’ll end up with an answer between 0 and 1.

First step: how many ways are there to draw 6 marbles from a set of 12?

12!6!6!

Note: we’ve partitioned the 12 into two sets of 6 – one drawn, and one not drawn.

Lecture 3

Page 32: 1 Outline 1. Why we need counting rules 2. Multiplicative counting rule 3. Partitions 4. Permutations 5. Combinations 6. Examples Lecture 3.

32

Counting Rules – Example 2

Next, how many ways are there to draw 2 marbles from the set of 4 red ones?

4!2!2!

For each of those ways, how many ways are there to draw 2 green marbles from 6?

6!2!4!

Lecture 3

Page 33: 1 Outline 1. Why we need counting rules 2. Multiplicative counting rule 3. Partitions 4. Permutations 5. Combinations 6. Examples Lecture 3.

33

Counting Rules – Example 2

Finally, how many ways are there to draw 2 blue marbles from a set of 2?

2!2!0!

Note that we need 2 marbles of each color – 2 red AND 2 green AND 2 blue. AND = multiply.

4! * 6! * 2! 2!2! 2!4! 2!0!

Lecture 3

Page 34: 1 Outline 1. Why we need counting rules 2. Multiplicative counting rule 3. Partitions 4. Permutations 5. Combinations 6. Examples Lecture 3.

34

Counting Rules – Example 2

Thus, probability of drawing 2 marbles of each color when you draw 6 marbles is:

4! 6! 2!2!2! 2!4! 2!0!

12! 6!6!

= .0974.

Lecture 3

( )( (

(

) )

)

Page 35: 1 Outline 1. Why we need counting rules 2. Multiplicative counting rule 3. Partitions 4. Permutations 5. Combinations 6. Examples Lecture 3.

35

Counting Rules – Example 2

b. You divide all the marbles equally among 3 friends. What is the probability that one friend gets both the blue marbles?

First, how many ways are there of dividing 12 marbles into 3 groups of 4?

12!4!4!4!

Lecture 3

Page 36: 1 Outline 1. Why we need counting rules 2. Multiplicative counting rule 3. Partitions 4. Permutations 5. Combinations 6. Examples Lecture 3.

36

Counting Rules – Example 2

Second, how many ways are there to draw 2 blue marbles from 2 blue marbles?

2!2!0!

Third, how many ways of dividing the remaining 10 marbles into one set of 2 (for the friend who also gets 2 blue ones) and 2 sets of 4?

10!2!4!4!

Lecture 3

Page 37: 1 Outline 1. Why we need counting rules 2. Multiplicative counting rule 3. Partitions 4. Permutations 5. Combinations 6. Examples Lecture 3.

37

Counting Rules – Example 2

The desired probability is:

2! 10! 2!0! 2!4!4!

12! 4!4!4!

But note: this is the probability FOR EACH FRIEND!

Lecture 3

Page 38: 1 Outline 1. Why we need counting rules 2. Multiplicative counting rule 3. Partitions 4. Permutations 5. Combinations 6. Examples Lecture 3.

38

Counting Rules – Example 2

The ratio on preceding slide works out to .0909.

Since this is the probability for each friend, the total probability of the event (any one friend gets both blue marbles) is:

3 * .0909 = .2727

Lecture 3

Page 39: 1 Outline 1. Why we need counting rules 2. Multiplicative counting rule 3. Partitions 4. Permutations 5. Combinations 6. Examples Lecture 3.

39

Counting Rules – Example 2

c. All 12 marbles are randomly lined up. What is the probability that the first and last marbles are either green or both even-numbered?

Now, order matters – there is a first and a last marble in the sequence. (Tip: the fact that the marbles are numbered is a clue in the question that order will matter somewhere.)

Lecture 3

Page 40: 1 Outline 1. Why we need counting rules 2. Multiplicative counting rule 3. Partitions 4. Permutations 5. Combinations 6. Examples Lecture 3.

40

Counting Rules – Example 2We know from Additive Rule of Probability:

P(Green or both even) = P(G) + P(E) – P(GE)

(P6)(P10) + (P6)(P10) - (P3)(P10)

P12

30(10!) + 30(10!) - 6(10!) = .409 479001600

Lecture 3

2 10 2 10 2 10

12