ch. 5: counting. 5.1: the basics of counting intro example #1: if we have a class of 6 math majors...

24
Ch. 5: Counting

Upload: cody-johnson

Post on 02-Jan-2016

228 views

Category:

Documents


10 download

TRANSCRIPT

Page 1: Ch. 5: Counting. 5.1: The Basics of Counting Intro Example #1: If we have a class of 6 math majors and 7 CS majors (with no double majors) – A) In how

Ch. 5: Counting

Page 2: Ch. 5: Counting. 5.1: The Basics of Counting Intro Example #1: If we have a class of 6 math majors and 7 CS majors (with no double majors) – A) In how

5.1: The Basics of Counting• Intro Example #1: If we have a class of 6 math

majors and 7 CS majors (with no double majors)– A) In how many ways could we pick one

representative from the class?– B) In how many ways could we pick 1 math and 1

CS major?• Intro Example #2: If a class has 10 math and 13

CS majors, and 4 of these are joint majors, how many are in the class?

Page 3: Ch. 5: Counting. 5.1: The Basics of Counting Intro Example #1: If we have a class of 6 math majors and 7 CS majors (with no double majors) – A) In how

Summary of Basic Counting Techniques

• Ex 1A uses the SUM rule• 6+7=13

• Ex 1B uses the PRODUCT rule• 6*7=42

• Ex 2 uses INCLUSION/EXCLUSION• 10+13-4=19

Page 4: Ch. 5: Counting. 5.1: The Basics of Counting Intro Example #1: If we have a class of 6 math majors and 7 CS majors (with no double majors) – A) In how

Multiplication Problems1. At a restaurant, you have a choice of main dish (beef, chicken, fish,

vegetarian), vegetable (broccoli, corn), potato (baked, fries), and dessert (chocolate, strawberry). LIST all possible choices.

2. A teacher wishes to make all possible different answer keys to a multiple

choice quiz. How many possible different answer keys could there be if there are 3 questions that each have 4 choices (A,B,C,D). LIST them all.

3. What if there were 20 multiple choice questions with 5 choices each?

Explain (don’t list). 4. With 9 baseball players on a team, how many different batting orders

exist?

Page 5: Ch. 5: Counting. 5.1: The Basics of Counting Intro Example #1: If we have a class of 6 math majors and 7 CS majors (with no double majors) – A) In how

Answers

1. At a restaurant, you have a choice of main dish (beef, chicken, fish, vegetarian), vegetable (broccoli, corn), potato (baked, fries), and dessert (chocolate, strawberry). LIST all possible choices.

main vegetable potato dessertBeef broc baked chocolateBeef broc baked strawbBeef broc fries chocolate…

4*2*2*2=32

Page 6: Ch. 5: Counting. 5.1: The Basics of Counting Intro Example #1: If we have a class of 6 math majors and 7 CS majors (with no double majors) – A) In how

Answers

2. A teacher wishes to make all possible different answer keys to a multiple choice quiz. How many possible different answer keys could there be if there are 3 questions that each have 4 choices (A,B,C,D). LIST them all. 4*4*4=64

3. What if there were 20 multiple choice questions with 5

choices each? Explain (don’t list). 5^20 4. With 9 baseball players on a team, how many different

batting orders exist? 9! = 362,880

Page 7: Ch. 5: Counting. 5.1: The Basics of Counting Intro Example #1: If we have a class of 6 math majors and 7 CS majors (with no double majors) – A) In how

Permutation Examples

1. If there are 4 people in the math club (Anne, Bob, Cindy, Dave), and we wish to elect a president and vice-president, LIST all of the different ways that this is possible.

2. From these 4 people (Anne, Bob, Cindy, Dave),

we wish to elect a president, vice-president, and treasurer. LIST all of the different ways that this is possible.

Page 8: Ch. 5: Counting. 5.1: The Basics of Counting Intro Example #1: If we have a class of 6 math majors and 7 CS majors (with no double majors) – A) In how

Answers

1. If there are 4 people in the math club (Anne, Bob, Cindy, Dave), and we wish to elect a president and vice-president, LIST all of the different ways that this is possible.

AB BA CA DAAC BC CB DBAD BD CD DC

4*3=12 or 4P2 = 12

Page 9: Ch. 5: Counting. 5.1: The Basics of Counting Intro Example #1: If we have a class of 6 math majors and 7 CS majors (with no double majors) – A) In how

Answers2. From these 4 people (Anne, Bob, Cindy, Dave),

we wish to elect a president, vice-president, and treasurer. LIST all of the different ways that this is possible.

ABCABD…

Page 10: Ch. 5: Counting. 5.1: The Basics of Counting Intro Example #1: If we have a class of 6 math majors and 7 CS majors (with no double majors) – A) In how

• A B C ABC

D ABDC B ACB

D ACDD A BDA

C BDC• B A C BAC

D BCDC A BCA

D BCDD A BDA

C BDC• C A B CAB

D CADB A CBA

D CBDA B DAB

C DAC• D A B DAB

C DACB A DBA

C DBCC A DCA

B DCB

4*3*2 = 24 outcomesOr 4P3 = 24

Page 11: Ch. 5: Counting. 5.1: The Basics of Counting Intro Example #1: If we have a class of 6 math majors and 7 CS majors (with no double majors) – A) In how

Combination Examples

1. If there are 4 people in the math club (Anne, Bob, Cindy, Dave), and 2 will be selected to attend the national math conference. LIST all of the different ways that this is possible.

2. From these 4 people (Anne, Bob, Cindy, Dave), and 3 will be selected to attend the national math conference. LIST all of the different ways that this is possible.

Page 12: Ch. 5: Counting. 5.1: The Basics of Counting Intro Example #1: If we have a class of 6 math majors and 7 CS majors (with no double majors) – A) In how

Combination answers1. If there are 4 people in the math club (Anne,

Bob, Cindy, Dave), and 2 will be selected to attend the national math conference. LIST all of the different ways that this is possible.

ABAC BCAD BD CD

4C2= 6

Page 13: Ch. 5: Counting. 5.1: The Basics of Counting Intro Example #1: If we have a class of 6 math majors and 7 CS majors (with no double majors) – A) In how

Combination answer

2. From these 4 people (Anne, Bob, Cindy, Dave), and 3 will be selected to attend the national math conference. LIST all of the different ways that this is possible.

ABC BCDABDACD

4C3 = 4

Page 14: Ch. 5: Counting. 5.1: The Basics of Counting Intro Example #1: If we have a class of 6 math majors and 7 CS majors (with no double majors) – A) In how

Permutations and Combinations• Permutations– Use when ORDER matters and NO repitition– nPr = n!/(n-r)!– Example: If 10 people join a club, how many ways

could we pick pres and vp? 10P2 = 90• Combinations– Use: ORDER does NOT matter and NO repitition– nCr = n!/ [(n-r)!r!]– Example: 10 people join a club. In how many ways

could we pick 2? 10C2 = 45

Page 15: Ch. 5: Counting. 5.1: The Basics of Counting Intro Example #1: If we have a class of 6 math majors and 7 CS majors (with no double majors) – A) In how

Multiplication, Permutation, or Combination?

1. With 14 players on a team, how many ways could we pick a batting order of 11?

2. If license plates have 3 letters and then 4 numbers, how many

different license plates exist? 3. How many different four-letter radio station call letters can be formed

if the first letter must be W or K? 4. A social security number contains nine digits. How many different

ones can be formed? 5. If you wish to arrange your 7 favorite books on a shelf, how many

different ways can this be done?

Page 16: Ch. 5: Counting. 5.1: The Basics of Counting Intro Example #1: If we have a class of 6 math majors and 7 CS majors (with no double majors) – A) In how

6. If you have 10 favorite books, but only have room for 7 books on the shelf, how many ways can you arrange them?

7. You wish to arrange 12 of your favorite photographs on a mantel. How many ways can this be done?

8. You have 20 favorite photographs and wish to arrange 12 of them on a mantel. How many ways can that be done?

9. You take a multiple choice test with 12 questions (and each can be answered A B C D E). How many different ways could you answer the test?

10. If you had 13 pizza toppings, how many ways could you pick 5 of them?

Page 17: Ch. 5: Counting. 5.1: The Basics of Counting Intro Example #1: If we have a class of 6 math majors and 7 CS majors (with no double majors) – A) In how

Answers

1. 14P11 6. 10P7

2. 26*26*26*10*10*10*10 7. 12! or 12P12

3. 2*26*26*26 8. 20P12

4. 10^9 9. 5^12

5. 7! Or 7P7 10. 13 C5

Page 18: Ch. 5: Counting. 5.1: The Basics of Counting Intro Example #1: If we have a class of 6 math majors and 7 CS majors (with no double majors) – A) In how

Review- which method do we use with …

• Order matters, repetition allowed• Order matters, repetition NOT allowed• Order DOESN’T matter, repetition allowed• Order DOESN’T matter, repetition NOT

allowed

Page 19: Ch. 5: Counting. 5.1: The Basics of Counting Intro Example #1: If we have a class of 6 math majors and 7 CS majors (with no double majors) – A) In how

Answers• Order matters, repetition allowed– Multiplication Rule– Ex: Social Security numbers

• Order matters, repetition NOT allowed– Permutations: P(n,r)= n!/(n-r)!– Ex: number of ways to pick 1st, 2nd, 3rd from 30

• Order DOESN’T matter, repetition allowed– ??? See section 5.5

• Order DOESN’T matter, repetition NOT allowed– Combinations: C(n,r)= n!/ [(n-r)!*r!]– Ex: number of ways to pick a committee of 3 from 30

Page 20: Ch. 5: Counting. 5.1: The Basics of Counting Intro Example #1: If we have a class of 6 math majors and 7 CS majors (with no double majors) – A) In how

Harder problems- if time

1. How many bit strings (0s and 1s) are there are length 5?

2. How many license plates exist if repetition is allowed and they can be 3 letters, 3 digits OR 3 letters, 4 digits?

3. In how many ways can a photographer arrange 8 people in a row from a group of 12?If the bride must be in the picture?If both the bride and groom must be in the picture?

Page 21: Ch. 5: Counting. 5.1: The Basics of Counting Intro Example #1: If we have a class of 6 math majors and 7 CS majors (with no double majors) – A) In how

More examples4. How many passwords exist with 6 letters (and

no restrictions)?5. How many 6 letter passwords exist if:

There is no repetition allowed?All are consonants, and repetition is allowed?There is exactly one vowel?There is at least one vowel? (use the COMPLEMENT

RULE here)

6. How many vanity plates are there with 4 to 7 characters (letters or digits) with at least 1 digit

Page 22: Ch. 5: Counting. 5.1: The Basics of Counting Intro Example #1: If we have a class of 6 math majors and 7 CS majors (with no double majors) – A) In how

answer

1. 2^52. 26^3*10^3 + 26^3*10^4 =193,336,0003. 12*11*10*9*8*7*6*5=19,958,400

8*11P7=8*1,663,200=13,305,6008*7*10P6=8,467,200

Page 23: Ch. 5: Counting. 5.1: The Basics of Counting Intro Example #1: If we have a class of 6 math majors and 7 CS majors (with no double majors) – A) In how

4.26^626P621^66*5*21^526^6-21^6 Review of complement rule: |E|=total = |E complement|

5. uses product, sum, and complement rule(36^4-26^4)+(36^5-26^5)+(36^6-26^6)+ (36^7-26^7) =

550,466,822,600

Page 24: Ch. 5: Counting. 5.1: The Basics of Counting Intro Example #1: If we have a class of 6 math majors and 7 CS majors (with no double majors) – A) In how

More complicated 5.3 problems

• Next class