Counting Basic 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 1 - - PowerPoint PPT Presentation

counting basic
SMART_READER_LITE
LIVE PREVIEW

Counting Basic 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 1 - - PowerPoint PPT Presentation

Counting Basic http://localhost/~senning/courses/ma229/slides/counting/slide01.html Counting Basic http://localhost/~senning/courses/ma229/slides/counting/slide02.html Counting Basic prev | slides | next prev | slides | next Question 1: How


slide-1
SLIDE 1

Counting Basic http://localhost/~senning/courses/ma229/slides/counting/slide01.html 1 of 1 10/02/2003 04:00 PM prev | slides | next

Counting Basic

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20

Counting Basic http://localhost/~senning/courses/ma229/slides/counting/slide02.html 1 of 1 10/02/2003 04:00 PM

Counting Basic

prev | slides | next

Question 1: How many ways are there to pick a president from a class of 256 women and 128 men?

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20

Counting Basic http://localhost/~senning/courses/ma229/slides/counting/slide03.html 1 of 1 10/02/2003 04:01 PM

Counting Basic

prev | slides | next

Question 1: How many ways are there to pick a president from a class of 256 women and 128 men? Question 2: How many ways are there to pick a president from 256 women and a vice president from 128 men?

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20

Counting Basic http://localhost/~senning/courses/ma229/slides/counting/slide04.html 1 of 1 10/02/2003 04:01 PM

Counting Basic

prev | slides | next

Question 1: How many ways are there to pick a president from a class of 256 women and 128 men? Question 2: How many ways are there to pick a president from 256 women and a vice president from 128 men? Answer 1: There are 256+128 = 384 people, so there are 384 different ways to choose a president.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20

slide-2
SLIDE 2

Counting Basic http://localhost/~senning/courses/ma229/slides/counting/slide05.html 1 of 1 10/02/2003 04:01 PM

Counting Basic

prev | slides | next

Question 1: How many ways are there to pick a president from a class of 256 women and 128 men? Question 2: How many ways are there to pick a president from 256 women and a vice president from 128 men? Answer 1: There are 256+128 = 384 people, so there are 384 different ways to choose a president. Answer 2: There are 256 ways to choose a president. For each of those ways there are 128 ways to choose a vice president. Thus there are 256×128 = 32,768 ways to choose both.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20

Counting Basic http://localhost/~senning/courses/ma229/slides/counting/slide06.html 1 of 1 10/02/2003 04:01 PM

Counting Basic

prev | slides | next

These problems are examples of counting problems. There are two rules that we will use in this section: The Sum Rule: If a first task can be done n ways and a second task can be done m ways, and if these tasks cannot be done at the same time, then there are n+m ways to do either task. The first question we examined fits this form, because we needed to choose a president and we could do that from the group of women (task 1) or from the group of men (task 2). The two tasks could not both be done. 1.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20

Counting Basic http://localhost/~senning/courses/ma229/slides/counting/slide07.html 1 of 1 10/02/2003 04:01 PM

Counting Basic

prev | slides | next

These problems are examples of counting problems. There are two rules that we will use in this section: The Product Rule: If a first task can be done n ways and a second task can be done m ways, and if the tasks must be done sequentially, then there are n× m ways to do the two tasks. The second question fits this form because we had to pick a president from the group of women (task 1) and then pick a vice president from the group of men (task 2). Note that the order of the tasks is not important, just that one is independent of the

  • ther.

2.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20

Counting Basic http://localhost/~senning/courses/ma229/slides/counting/slide08.html 1 of 1 10/02/2003 04:01 PM

Counting Basic

prev | slides | next

Examples How many different bit strings having 5 bits are there?

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20

slide-3
SLIDE 3

Counting Basic http://localhost/~senning/courses/ma229/slides/counting/slide09.html 1 of 1 10/02/2003 04:01 PM

Counting Basic

prev | slides | next

Examples How many different bit strings having 5 bits are there? Answer: A bit string with 5 bits has five "slots" that can hold bits. To "create" a bit string we need to first choose the first bit, then the second bit, and so on. Thus the product rule will apply here.

bit string: 0 1 1 0 1 number of choices: 2 2 2 2 2

If we find the product of all the "number of choices" values we see that there are 32 different bit strings of length 5.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20

Counting Basic http://localhost/~senning/courses/ma229/slides/counting/slide10.html 1 of 1 10/02/2003 04:01 PM

Counting Basic

prev | slides | next

Examples How many two digit base 10 numbers are there?

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20

Counting Basic http://localhost/~senning/courses/ma229/slides/counting/slide11.html 1 of 1 10/02/2003 04:01 PM

Counting Basic

prev | slides | next

Examples How many two digit base 10 numbers are there? Answer: As before, we are really considing a "digit string" of length 2. This is an example that again calls for the product rule. If we allow zero as the first digit then there are 10 ways to choose the first digit. For each of these there are 10 ways to choose the second

  • digit. So there are 10×10 = 100 different two digit base 10 numbers.

If, however, we don’t want to allow zero as leading digit, then there are only 9 ways to choose the first number, but still 10 ways to choose the second number. Thus there are 9×10 = 90 different two digit base 10 numbers.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20

Counting Basic http://localhost/~senning/courses/ma229/slides/counting/slide12.html 1 of 1 10/02/2003 04:01 PM

Counting Basic

prev | slides | next

Examples How many bit strings of length 8 start with 101 or 010?

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20

slide-4
SLIDE 4

Counting Basic http://localhost/~senning/courses/ma229/slides/counting/slide13.html 1 of 1 10/02/2003 04:01 PM

Counting Basic

prev | slides | next

Examples How many bit strings of length 8 start with 101 or 010? Answer: This is again a product rule type problem. The best way to think of this is to think of there being only 5 choices: Chose one of two prefixes to start the string, and then choose each of the 5 remaining bits.

bit string: 101 0 1 1 0 1 number of choices: 2 2 2 2 2 2

There are 26 = 64 bit strings of length 8 beginning with 101 or 010.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20

Counting Basic http://localhost/~senning/courses/ma229/slides/counting/slide14.html 1 of 1 10/02/2003 04:01 PM

Counting Basic

prev | slides | next

Examples U.S. Novice class amateur radio (ham) radio callsigns have two letters, a single digit, and then three more letters. The first letter must be K, N, or W. How many different novice callsigns are there?

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20

Counting Basic http://localhost/~senning/courses/ma229/slides/counting/slide15.html 1 of 1 10/02/2003 04:01 PM

Counting Basic

prev | slides | next

Examples U.S. Novice class amateur radio (ham) radio callsigns have two letters, a single digit, and then three more letters. The first letter must be K, N, or W. How many different novice callsigns are there? Answer: As in the other examples, we have 3 ways to choose the first letter, 26 ways to choose the second. Next we need to pick a digit; there are 10 ways to do this. Finally we have to pick three more letters and have 26 choices for each. Thus we have 3 × 26 × 10 × 26 × 26 × 26 = 13,709,280 callsigns.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20

Counting Basic http://localhost/~senning/courses/ma229/slides/counting/slide16.html 1 of 1 10/02/2003 04:01 PM

Counting Basic

prev | slides | next

The Pigeonhole Principle Theorem: If k+1 or more objects are placed into k boxes, then at least one box contains more than one object.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20

slide-5
SLIDE 5

Counting Basic http://localhost/~senning/courses/ma229/slides/counting/slide17.html 1 of 1 10/02/2003 04:02 PM

Counting Basic

prev | slides | next

The Pigeonhole Principle Examples: In a group of 13 or more people, at least two of them have a birthday in the same month. Any set containing two digit numbers can have at most 90 elements (assuming the first digit is nonzero). If it had any more then an element would have to be repeated, violating the definition of a set.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20

Counting Basic http://localhost/~senning/courses/ma229/slides/counting/slide18.html 1 of 1 10/02/2003 04:02 PM

Counting Basic

prev | slides | next

The Pigeonhole Principle The first form of this theorem can be generalized as follows. Theorem: If N objects are placed into into k boxes, then there is at least one box containing at least N/k objects. Examples: Among 393 students, at least 393/2 = 197 are the same sex. Among 393 American students, at least 393/50 = 8 are from the same state.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20

Counting Basic http://localhost/~senning/courses/ma229/slides/counting/slide19.html 1 of 1 10/02/2003 04:02 PM

Counting Basic

prev | slides | next

The Pigeonhole Principle Question: What is the minimum number of students possible such that at least 10 were born in the same month?

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20

Counting Basic http://localhost/~senning/courses/ma229/slides/counting/slide20.html 1 of 1 10/02/2003 04:02 PM

Counting Basic

prev | slides | next

The Pigeonhole Principle Question: What is the minimum number of students possible such that at least 10 were born in the same month? Answer: The key to this is to figure out the maximum number of students possible such that no month has more than nine students born in it. In this case it would be 9 × 12 = 108. If we add one to this number then we know that at one month will have 10 students with birthdays in it. So the answer is 109 students is the minimum number of students necessary so that at least 10 were born in the same month.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20