120 likes | 136 Views
CMSC 203 / 0201 Fall 2002. Week #8 – 14/16 October 2002 Prof. Marie desJardins. TOPICS. Counting Inclusion-exclusion Tree diagrams Pigeonhole principle. MON 10/14 COUNTING BASICS (4.1). Concepts/Vocabulary. Counting Sum rule |A 1 A 2 … A m | = |A 1 | + … + |A m | for disjoint A i
E N D
CMSC 203 / 0201Fall 2002 Week #8 – 14/16 October 2002 Prof. Marie desJardins
TOPICS • Counting • Inclusion-exclusion • Tree diagrams • Pigeonhole principle
Concepts/Vocabulary • Counting • Sum rule |A1 A2 … Am| = |A1| + … + |Am| for disjoint Ai • Product rule |A1x A2 x … x Am| = |A1| |A2| … |Am| • Inclusion-exclusion |A1 A2| = |A1| + |A2| - |A1 A2| • Tree diagrams
Examples • Exercise 4.1.3: A multiple-choice test contains 10 questions. There are four possible answers for each question. • (a) How many ways can a student answer the questions on the test if every question is answered? • (b) How many ways can a student answer the questions on the test if the student can leave answers blank?
Examples II • How many bit strings of length 8 are there? • How many bit strings of length 8 or less are there? • How many bit strings of length 8 or more are there? ☺ • Exercise 4.1.13: How many bit strings with length not exceeding n, where n is a positive integer? • How many such strings consisting entirely of 1s? • How many functions are there from A B where |A| = m and |B| = n? • How many 1-to-1 functions are there?
Examples III • In how many ways can six elements a1…a6 be placed into an array if: • (a) a1 and a2 must be in adjacent positions (not necessarily in that order) • (b) a1 and a2 must not be in adjacent positions • (c) a1 must have a lower index than a6 • (Analogous to Exercise 4.1.39.) • Exercise 4.1.50: Use a tree diagram to find the number of ways that the World Series can occur (four games out of seven wins the series)
WED 10/16PIGEONHOLE PRINCIPLE (3.5) ** HOMEWORK #5 DUE **
Concepts / Vocabulary • Pigeonhole Principle • If k+1 or more objects are in k boxes, at least one box has two or more objects • Generalized pigeonhole principle • If N objects are in k boxes, one box has at least N/k objects
Examples • Exercise 4.2.4: A bowl contains 10 red balls and 10 blue balls. A woman selects balls at random without looking at them. • (a) How many balls must she select to be sure of having at least three balls of the same color? • (b) How many balls must she select to be sure of having at lets three blue balls? • Exercise 4.2.9: How many students, each of whom comes from one of the 50 states, must be enrolled in a university to guarantee that there are at lets 100 who come from the same state?
Examples II • Example 4.2.10 (page 248): Assume that in a group of six people, each pair of individuals consists of two friends or two enemies. Show that there are either three mutual friends or three mutual enemies in the group. • Exercise 4.2.29: A computer network consists of six computers. Each computer is directly connected to zero or more of the other computers. Show that there are at least two computers in the network that are directly connected to the same number of other computers.