Combinations Combinations are very similar to permutations with one key difference: Order does not...

54
Combinations Combinations are very similar to permutations with one key difference: Order does not matter.

Transcript of Combinations Combinations are very similar to permutations with one key difference: Order does not...

Page 1: Combinations Combinations are very similar to permutations with one key difference: Order does not matter.

Combinations

Combinations are very similar to permutations with one key difference:

Order does not matter.

Page 2: Combinations Combinations are very similar to permutations with one key difference: Order does not matter.

Combinations

Consider two very similar examples that illustrate this difference.

Example 1: You have selected 5 cities to visit on a vacation. How many possible itineraries do you have? (In how many different orders could you visit the 5 cities?

Example 2: You have a list of 15 cities that you want to visit, but you can only fit 5 into your schedule. How many different sets of 5 cities could you select?

Page 3: Combinations Combinations are very similar to permutations with one key difference: Order does not matter.

Combinations

The first example is a permutation problem, because order matters.

The second example is a combination, because we are looking only for a grouping, and order does

not matter.

Page 4: Combinations Combinations are very similar to permutations with one key difference: Order does not matter.

Combinations

Because the problems are similar, it might not surprise you that the

methods for solving them are also similar.

Page 5: Combinations Combinations are very similar to permutations with one key difference: Order does not matter.

Combinations

Let’s begin with an even simpler problem.

Example: You have 5 movies that you want to watch, but you only have time for 2 of them. How many different pairs of movies could you select?

Page 6: Combinations Combinations are very similar to permutations with one key difference: Order does not matter.

Combinations

Select 2 out of 5 movies.

We could start the problem the same way we would start a permutation problem.

You have 5 options for the first movie. After picking 1 movie, you have 4 options remaining for the second movie.

5*4 = 20, but we need to adjust this.

Page 7: Combinations Combinations are very similar to permutations with one key difference: Order does not matter.

Combinations

Select 2 out of 5 movies.

Label the movies as A, B, C, D, and E.

Consider the pairs where A is the first movie:

AB

ACADAE

Page 8: Combinations Combinations are very similar to permutations with one key difference: Order does not matter.

Combinations

Select 2 out of 5 movies.

Label the movies as A, B, C, D, and E.

Add the pairs where B is the first movie:

AB BA

AC BCAD BDAE BE

Page 9: Combinations Combinations are very similar to permutations with one key difference: Order does not matter.

Combinations

Select 2 out of 5 movies.

Label the movies as A, B, C, D, and E.

Add the pairs where C is the first movie:

AB BA CA

AC BC CBAD BD CDAE BE CE

Page 10: Combinations Combinations are very similar to permutations with one key difference: Order does not matter.

Combinations

Select 2 out of 5 movies.

Label the movies as A, B, C, D, and E.

Add the pairs where D is the first movie:

AB BA CA DA

AC BC CB DBAD BD CD DCAE BE CE DE

Page 11: Combinations Combinations are very similar to permutations with one key difference: Order does not matter.

Combinations

Select 2 out of 5 movies.

Label the movies as A, B, C, D, and E.

Add the pairs where E is the first movie:

AB BA CA DA EA

AC BC CB DB EBAD BD CD DC ECAE BE CE DE ED

Page 12: Combinations Combinations are very similar to permutations with one key difference: Order does not matter.

Combinations

Select 2 out of 5 movies.

Label the movies as A, B, C, D, and E.

Have you spotted the problem?

AB BA CA DA EA

AC BC CB DB EBAD BD CD DC ECAE BE CE DE ED

Page 13: Combinations Combinations are very similar to permutations with one key difference: Order does not matter.

Combinations

Select 2 out of 5 movies.

Label the movies as A, B, C, D, and E.

Every pair is listed twice.

AB BA CA DA EA

AC BC CB DB EBAD BD CD DC ECAE BE CE DE ED

Page 14: Combinations Combinations are very similar to permutations with one key difference: Order does not matter.

Combinations

Select 2 out of 5 movies.

Label the movies as A, B, C, D, and E.

We need to divide our answer by 2, to account for the pairs being counted twice.

AB BA CA DA EA

AC BC CB DB EBAD BD CD DC ECAE BE CE DE ED

Page 15: Combinations Combinations are very similar to permutations with one key difference: Order does not matter.

Combinations

Select 2 out of 5 movies.

Label the movies as A, B, C, D, and E.

(5*4) / 2 = 10 possible pairs of movies.

AB BA CA DA EA

AC BC CB DB EBAD BD CD DC ECAE BE CE DE ED

Page 16: Combinations Combinations are very similar to permutations with one key difference: Order does not matter.

CombinationsNow say you want to select 3 out of 5

movies.

Use the labels again for the movies, and begin by listing trios that start with A.

ABC ABD ABE ACB ACD ACE ADB ADC ADE AEB AEC AED

Page 17: Combinations Combinations are very similar to permutations with one key difference: Order does not matter.

CombinationsNow say you want to select 3 out of 5

movies.

Add the trios that begin with B:

ABC ABD ABE ACB ACD ACE ADB ADC ADE AEB AEC AED BAC BAD BAE BCA BCD BCE BDA BDC BDE BEA BEC BED

Page 18: Combinations Combinations are very similar to permutations with one key difference: Order does not matter.

CombinationsNow say you want to select 3 out of 5

movies.

Add the trios that begin with C:

ABC ABD ABE ACB ACD ACE ADB ADC ADE AEB AEC AED BAC BAD BAE BCA BCD BCE BDA BDC BDE BEA BEC BED CAB CAD CAE CBA CBD CBE CDA CDB CDE CEA CEB CED

Page 19: Combinations Combinations are very similar to permutations with one key difference: Order does not matter.

CombinationsNow say you want to select 3 out of 5

movies.

Add the trios that begin with D and E:

ABC ABD ABE ACB ACD ACE ADB ADC ADE AEB AEC AED BAC BAD BAE BCA BCD BCE BDA BDC BDE BEA BEC BED CAB CAD CAE CBA CBD CBE CDA CDB CDE CEA CEB CED DAB DAC DAE DBA DBC DBE DCA DCB DCE DEA DEB DEC EAB EAC EAD EBA EBC EBD ECA ECB ECD EDA EDB EDC

Page 20: Combinations Combinations are very similar to permutations with one key difference: Order does not matter.

CombinationsNow say you want to select 3 out of 5

movies.

How many times has each trio been counted?

ABC ABD ABE ACB ACD ACE ADB ADC ADE AEB AEC AED BAC BAD BAE BCA BCD BCE BDA BDC BDE BEA BEC BED CAB CAD CAE CBA CBD CBE CDA CDB CDE CEA CEB CED DAB DAC DAE DBA DBC DBE DCA DCB DCE DEA DEB DEC EAB EAC EAD EBA EBC EBD ECA ECB ECD EDA EDB EDC

Page 21: Combinations Combinations are very similar to permutations with one key difference: Order does not matter.

CombinationsNow say you want to select 3 out of 5

movies.

How many times has each trio been counted?

Not twice, not thrice, but 6 times!

ABC ABD ABE ACB ACD ACE ADB ADC ADE AEB AEC AED BAC BAD BAE BCA BCD BCE BDA BDC BDE BEA BEC BED CAB CAD CAE CBA CBD CBE CDA CDB CDE CEA CEB CED DAB DAC DAE DBA DBC DBE DCA DCB DCE DEA DEB DEC EAB EAC EAD EBA EBC EBD ECA ECB ECD EDA EDB EDC

Page 22: Combinations Combinations are very similar to permutations with one key difference: Order does not matter.

CombinationsNow say you want to select 3 out of 5

movies.

How many times has each trio been counted?

Look for example at the combination of A, B, and C.ABC ABD ABE ACB ACD ACE ADB ADC ADE AEB AEC AED BAC BAD BAE BCA BCD BCE BDA BDC BDE BEA BEC BED CAB CAD CAE CBA CBD CBE CDA CDB CDE CEA CEB CED DAB DAC DAE DBA DBC DBE DCA DCB DCE DEA DEB DEC EAB EAC EAD EBA EBC EBD ECA ECB ECD EDA EDB EDC

Page 23: Combinations Combinations are very similar to permutations with one key difference: Order does not matter.

CombinationsNow say you want to select 3 out of 5

movies.

How many times has each trio been counted?

We want to count this trio once, not 6 times.

ABC ABD ABE ACB ACD ACE ADB ADC ADE AEB AEC AED BAC BAD BAE BCA BCD BCE BDA BDC BDE BEA BEC BED CAB CAD CAE CBA CBD CBE CDA CDB CDE CEA CEB CED DAB DAC DAE DBA DBC DBE DCA DCB DCE DEA DEB DEC EAB EAC EAD EBA EBC EBD ECA ECB ECD EDA EDB EDC

Page 24: Combinations Combinations are very similar to permutations with one key difference: Order does not matter.

CombinationsNow say you want to select 3 out of 5

movies.

How many times has each trio been counted?

We want to count this trio once, not 6 times. As a result, we must divide by 6.ABC ABD ABE ACB ACD ACE ADB ADC ADE AEB AEC AED BAC BAD BAE BCA BCD BCE BDA BDC BDE BEA BEC BED CAB CAD CAE CBA CBD CBE CDA CDB CDE CEA CEB CED DAB DAC DAE DBA DBC DBE DCA DCB DCE DEA DEB DEC EAB EAC EAD EBA EBC EBD ECA ECB ECD EDA EDB EDC

Page 25: Combinations Combinations are very similar to permutations with one key difference: Order does not matter.

CombinationsNow say you want to select 3 out of 5

movies.

How many groups of 3 movies are possible?

(5*4*3) / 6 = 10 possible trios.

ABC ABD ABE ACB ACD ACE ADB ADC ADE AEB AEC AED BAC BAD BAE BCA BCD BCE BDA BDC BDE BEA BEC BED CAB CAD CAE CBA CBD CBE CDA CDB CDE CEA CEB CED DAB DAC DAE DBA DBC DBE DCA DCB DCE DEA DEB DEC EAB EAC EAD EBA EBC EBD ECA ECB ECD EDA EDB EDC

Page 26: Combinations Combinations are very similar to permutations with one key difference: Order does not matter.

CombinationsHow do you decide the extent of overcounting for these problems?

When we grouped 2 items, we had to divide by 2. When we grouped 3 items, we had to divide by 6. What about for 4 items?

Page 27: Combinations Combinations are very similar to permutations with one key difference: Order does not matter.

CombinationsHow do you decide the extent of overcounting for these problems?

When we grouped 2 items, we had to divide by 2. When we grouped 3 items, we had to divide by 6. What about for 4 items?

You can answer that by answering this question: In how many ways can you arrange 4 items? That’s how many times each group will be counted, and we need to divide by that factor.

Page 28: Combinations Combinations are very similar to permutations with one key difference: Order does not matter.

Combinations

Do you need to list every possible group in order to determine how

many times each group is counted?

Fortunately, no you do not need to list all possible groups. The number of times a group of 4 items will be counted, for example, is simply the number of permutations for 4 items. We already have a nice formula to use to calculate that number.

Page 29: Combinations Combinations are very similar to permutations with one key difference: Order does not matter.

Combinations

Example: You have a stack of 10 books that you want to read. On your next vacation you decide to take 4 of them with you. In how many ways

can you pick 4 books out of the 10?

Page 30: Combinations Combinations are very similar to permutations with one key difference: Order does not matter.

Combinations

Example: You have a stack of 10 books that you want to read. On your next vacation you decide to take 4 of them with you. In how many ways

can you pick 4 books out of the 10?

You could begin the same as you would with a permutation problem:

P(10, 4) = __10!__ = 10!

(10-4)! 6!

Page 31: Combinations Combinations are very similar to permutations with one key difference: Order does not matter.

Combinations

Pick 4 out of 10 books.

Next we need to consider how many times each group of 4 will have been counted, which is simply 4! times.

We need to divide by that factor to eliminate the overcounting.

Page 32: Combinations Combinations are very similar to permutations with one key difference: Order does not matter.

Combinations

Pick 4 out of 10 books.

10!

__6!__ = __10!__

4! 6! 4!

Page 33: Combinations Combinations are very similar to permutations with one key difference: Order does not matter.

Combinations

In general, the number of combinations of m items out of n is:

__n!__

__(n-m)!__ = ___n!____

m! (n-m)! m!

Page 34: Combinations Combinations are very similar to permutations with one key difference: Order does not matter.

Combinations

As with permutations, we have some common notations for combinations:

C(n, m)

nCm

Page 35: Combinations Combinations are very similar to permutations with one key difference: Order does not matter.

Combinations

Once again, it is common for graphing calculators and computer

spreadsheet programs to have a function for combinations.

Graphing calculators typically have a nCr function nearby the nPr function.

Page 36: Combinations Combinations are very similar to permutations with one key difference: Order does not matter.

Combinations

Go back to our original examples.

Example 1: You have selected 5 cities to visit on a vacation. How many possible itineraries do you have? (In how many different orders could you visit the 5 cities?

Example 2: You have a list of 15 cities that you want to visit, but you can only fit 5 into your schedule. How many different sets of 5 cities could you select?

Page 37: Combinations Combinations are very similar to permutations with one key difference: Order does not matter.

Combinations

Go back to our original examples.

Example 1 is a straight forward permutation problem. There are 5!, or 120 different ways to arrange the order of visiting 5 cities.

Page 38: Combinations Combinations are very similar to permutations with one key difference: Order does not matter.

Combinations

Go back to our original examples.

Example 2 is a combination problem where we are picking 5 out of 15 cities, and are not concerned with order.

C(15, 5) = __15!__

10! 5!

Page 39: Combinations Combinations are very similar to permutations with one key difference: Order does not matter.

CombinationsOn a graphing calculator:

•Enter 15, the total number of items

•Press MATH

•Move the cursor to the PRB section

•Move the cursor down to the nCr function

•Press ENTER

•Enter 5, the number of items being chosen

•Press ENTER

•You should see an answer of 3,003

Page 40: Combinations Combinations are very similar to permutations with one key difference: Order does not matter.

CombinationsExample: From a list of 5 candidates

for student council representative, you are asked to vote for 2. In how

many ways can you do this?

Page 41: Combinations Combinations are very similar to permutations with one key difference: Order does not matter.

CombinationsExample: From a list of 5 candidates

for student council representative, you are asked to vote for 2. In how

many ways can you do this?

You are being asked to pick 2, not rank them, so this is a combination problem.

C(5, 2) = 10

Page 42: Combinations Combinations are very similar to permutations with one key difference: Order does not matter.

CombinationsExample: From a list of 5 candidates

for student council representative, you are asked to vote for 3. In how

many ways can you do this?

Page 43: Combinations Combinations are very similar to permutations with one key difference: Order does not matter.

CombinationsExample: From a list of 5 candidates

for student council representative, you are asked to vote for 3. In how

many ways can you do this?

You are being asked to pick 3, not rank them, so this is a combination problem.

C(5, 3) = 10

Page 44: Combinations Combinations are very similar to permutations with one key difference: Order does not matter.

CombinationsExample: From a list of 5 candidates

for student council representative, you are asked to vote for 3. In how

many ways can you do this?

You are being asked to pick 3, not rank them, so this is a combination problem.

C(5, 3) = 10 Notice anything interesting?

Page 45: Combinations Combinations are very similar to permutations with one key difference: Order does not matter.

CombinationsIt appears that C(5, 2) = C(5, 3).

How could this be?

Page 46: Combinations Combinations are very similar to permutations with one key difference: Order does not matter.

CombinationsC(5, 2) = C(5, 3)

Compare the formulas:

__5!__ vs. __5!__

3! 2! 2! 3!

They’re the same thing! But why?

Page 47: Combinations Combinations are very similar to permutations with one key difference: Order does not matter.

CombinationsC(5, 2) = C(5, 3)

This is another version of the old glass half full / glass half empty scenario.

Page 48: Combinations Combinations are very similar to permutations with one key difference: Order does not matter.

CombinationsC(5, 2) = C(5, 3)

This is another version of the old glass half full / glass half empty scenario.

Choosing which 2 candidates out of 5 to pick is really the same thing as choosing which 3 candidates not to pick.

Page 49: Combinations Combinations are very similar to permutations with one key difference: Order does not matter.

Combinations

In some cases we can combine the technique of combinations with other techniques, such as permutations or

the multiplication or addition principles.

Page 50: Combinations Combinations are very similar to permutations with one key difference: Order does not matter.

Combinations

Example: At a certain ice cream store, you can make a sundae with either 1 or 2 scoops of ice cream,

combined with 1 topping. This store has 20 flavors of ice cream, and 5

different toppings. How many unique sundaes are possible?

Page 51: Combinations Combinations are very similar to permutations with one key difference: Order does not matter.

Combinations

First, consider the ice cream.

If you choose 1 scoop of ice cream, there are 20 options (20 flavors).

If you choose 2 scoops, there are (20*20) / 2, or 200 possibilities. (You have 20 options for the first scoop, and 20 again for the second scoop,

because you could pick the same flavor for both scoops. We have to divide by 2, because every

pair was counted twice.

Page 52: Combinations Combinations are very similar to permutations with one key difference: Order does not matter.

Combinations

First, consider the ice cream.

Because we have 20 possibilities for 1 scoop, and 200 possibilities for 2 scoops, we end up

with 200 + 20, or 220 possibilities for ice cream.

Page 53: Combinations Combinations are very similar to permutations with one key difference: Order does not matter.

Combinations

Now consider the topping.

We have 5 options for the topping.

Page 54: Combinations Combinations are very similar to permutations with one key difference: Order does not matter.

Combinations

Now multiply the options.

220*5 = 1100 total possible sundaes

ice cream

toppings