1 Combinations & Counting II Samuel Marateck © 2009.

39
1 Combinations & Counting II Samuel Marateck © 2009

Transcript of 1 Combinations & Counting II Samuel Marateck © 2009.

Page 1: 1 Combinations & Counting II Samuel Marateck © 2009.

1

Combinations & Counting II

Samuel Marateck © 2009

Page 2: 1 Combinations & Counting II Samuel Marateck © 2009.

2

How many 4-letter words can we form from

the letters ABCD w/o replacements?

Page 3: 1 Combinations & Counting II Samuel Marateck © 2009.

3

How many 4-letter words can we form from

the letters ABCD?

This is an example of an ordered list without

replacements.

Page 4: 1 Combinations & Counting II Samuel Marateck © 2009.

4

How many 4-letter words can we form from

the letters ABCD w/o replacements?

4*3*2*1 or 4! or 24

Page 5: 1 Combinations & Counting II Samuel Marateck © 2009.

5

How many 2-letter words can we form from

the letters ABCD w/o replacements? This is

another example of an ordered list

Page 6: 1 Combinations & Counting II Samuel Marateck © 2009.

6

How many 2-letter words can we form from

the letters ABCD w/o replacements? This is

another example of an ordered list

4*3 or 12

Page 7: 1 Combinations & Counting II Samuel Marateck © 2009.

7

How many 3-letter words can we form from

the letters AAB w/o replacements? This is

yet another ordered list; but there are now

repetitions of one of the letters!

Page 8: 1 Combinations & Counting II Samuel Marateck © 2009.

8

How many 3-letter words can we form from

the letters AAB w/o replacements?

Let’s distinguish between the A’s by giving

them subscripts, A1 , A2 .

Page 9: 1 Combinations & Counting II Samuel Marateck © 2009.

9

Let’s distinguish between the A’s by givingthem subscripts, A1 , A2 . So the # of wordsthat can be formed is 3*2*1 or 6. They are: B A1 A2

B A2 A1

A2 B A1

A1 B A2

A2 B A1

A2 A1 B A1 A2 B

Page 10: 1 Combinations & Counting II Samuel Marateck © 2009.

10

If we don’t distinguish between the A’s, thewords that can be formed are:

B A A

A B A

A A BWe get the number of different words by dividing by the # of ways the A’s can be arranged or 2!

Page 11: 1 Combinations & Counting II Samuel Marateck © 2009.

11

How many 3-letter words can we form from

the letters AAB w/o replacements?

It’s 3!/2! or 3.

Page 12: 1 Combinations & Counting II Samuel Marateck © 2009.

12

How many distinct 11-letter words (ordered

lists) can we form from the letters in

mississippi w/o replacements?

Page 13: 1 Combinations & Counting II Samuel Marateck © 2009.

13

How many distinct 11-letter words can weform from the letters in mississippi w/oreplacements? There are 4 s’s, 4 i’s, 2 p’s and 1 m. The #of ways we can form words with the given repetitions of these letters is 11! How do we account for the repetitions?

Page 14: 1 Combinations & Counting II Samuel Marateck © 2009.

14

There are 4 s’s, 4 i’s, 2 p’s and 1 m. The #

of ways we can form words with repetitions

is 11! How do we account for the repetitions.

We divide by 4! * 4! * 2!

The answer is 11!/(4!*4!*2!)

Page 15: 1 Combinations & Counting II Samuel Marateck © 2009.

15

How many paths can we take from point A to B using the lines.

B

A

     

     

     

Page 16: 1 Combinations & Counting II Samuel Marateck © 2009.

16

The 2 directions we can go are North and East.

B

A

     

     

     

Page 17: 1 Combinations & Counting II Samuel Marateck © 2009.

17

This is an example of ordered listssince a path depends upon the

order of N’s and E’s B

A

     

     

     

Page 18: 1 Combinations & Counting II Samuel Marateck © 2009.

18

One of the paths is:NENENE

B

A

     

     

     

Page 19: 1 Combinations & Counting II Samuel Marateck © 2009.

19

Another path is:NENEEN

B

A

     

   

     

Page 20: 1 Combinations & Counting II Samuel Marateck © 2009.

20

How many E’s and N’s must eachpath contain?

B

A

     

     

     

Page 21: 1 Combinations & Counting II Samuel Marateck © 2009.

21

There must be 3 N’s and 3 E’s in any order in each path.

B

A

     

     

     

Page 22: 1 Combinations & Counting II Samuel Marateck © 2009.

22

This is an example of an ordered list w/o replacements but with

repetitions (of N and E). B

A

     

     

     

Page 23: 1 Combinations & Counting II Samuel Marateck © 2009.

23

The # of paths is therefore 6!/(3! 3!)

B

A

     

     

     

Page 24: 1 Combinations & Counting II Samuel Marateck © 2009.

24

6!/(3! 3!) = 6*5*4*3*2*1/(6*6) =

5*4 or 20

Page 25: 1 Combinations & Counting II Samuel Marateck © 2009.

25

Review

Ordered list with replacement. Example:

How many different lists of length k can we

get from tossing a coin. We can get 2

results, a head or tail.

Page 26: 1 Combinations & Counting II Samuel Marateck © 2009.

26

How many different lists of length k can we

get from tossing a coin. We can get 2

results, a head or tail.

Answer: 2k

Page 27: 1 Combinations & Counting II Samuel Marateck © 2009.

27

Ordered list without replacement. Example:

How many k different cards can we choose

from a deck of n cards?

Page 28: 1 Combinations & Counting II Samuel Marateck © 2009.

28

How many k different cards can we choose

from a deck of n cards?

Answer: n*(n-1)*(n-2)*(n-3)..(n – k +1).

3 cards from a 52 deck: 52*51*50

Page 29: 1 Combinations & Counting II Samuel Marateck © 2009.

29

Ordered list without replacement but with

repetition. Example:

How many 11-letter words can we make

from mississippi.

Page 30: 1 Combinations & Counting II Samuel Marateck © 2009.

30

Ordered list without replacement but with

repetition. Example:

How many 11-letter words can we make

from mississippi.

Answer: 11!/(4!*4!*2!)

Page 31: 1 Combinations & Counting II Samuel Marateck © 2009.

31

Unordered list without replacement.

Example:

How many committees of k people can we

choose from a pool of n?

Page 32: 1 Combinations & Counting II Samuel Marateck © 2009.

32

Unordered list without replacement.

Example:

How many committees of k people can we

choose from a pool of n? ( n k)

Page 33: 1 Combinations & Counting II Samuel Marateck © 2009.

33

What’s the probability of getting 2 kings,

1 queen, 3 jacks and another non-kqj in a

hand of 7 cards from a 52 card deck?

Page 34: 1 Combinations & Counting II Samuel Marateck © 2009.

34

What’s the probability of getting 2 kings,1 queen, 3 jacks and another non-kqj in ahand of 7 cards from a 52 card deck?

( 4 2) ( 4

1) ( 4 3) ( 40

1)/ ( 52 7)

Note that the sum of the bottom numbers, 2+1+3+1 = 7, the number of cards in a hand. Whereas the top numbers indicate the number of a given type in a deck.

Page 35: 1 Combinations & Counting II Samuel Marateck © 2009.

35

Unordered list with replacement (or

repetitions). Example:

Given an urn with red, green and blue

marbles, how many different combinations

of marbles can we get if we choose 5

marbles?

Page 36: 1 Combinations & Counting II Samuel Marateck © 2009.

36

Given an urn with red, green and bluemarbles, how many different combinationsof marbles can we get if we choose 5marbles?

Some of the combination are RRRRR,GGGGG, GRBBB. The last one is the sameas BBBGR, GBBBR or RGBBB, since orderdoes not count.

Page 37: 1 Combinations & Counting II Samuel Marateck © 2009.

37

Let’s look at RGBBB. We’ll let a 0 separate

the letters and a 1 for each letter. So we get

1010111. For RRRBB we get 1110110

since we need a 0 to separate the last B

from the non-existent G. There will always

be five 1’s and two 0’s.

Page 38: 1 Combinations & Counting II Samuel Marateck © 2009.

38

There will always be five 1’s and two 0’s.

The # of ways we can permute 7 objects

with five repetitions of one and two of the

other is 7!/(5!*2!) = 7*6/2 = 21.

Page 39: 1 Combinations & Counting II Samuel Marateck © 2009.

39

In general if we have we are choosing

n objects and k of them are different,

the number of combinations is:

(n + k -1)!/(n!*(k-1)!)