Today s Topics. Sometimes when counting a set, we count the same item more than once

Similar documents
6.1 Basics of counting

The Product Rule can be viewed as counting the number of elements in the Cartesian product of the finite sets

Discrete Mathematics: Logic. Discrete Mathematics: Lecture 15: Counting

Outline. Content The basics of counting The pigeonhole principle Reading Chapter 5 IRIS H.-R. JIANG

With Question/Answer Animations. Chapter 6

Discrete Mathematics. Spring 2017

Math 365 Wednesday 2/20/19 Section 6.1: Basic counting

COUNTING TECHNIQUES. Prepared by Engr. JP Timola Reference: Discrete Math by Kenneth H. Rosen

Sec 5.1 The Basics of Counting

Counting Poker Hands

Compound Probability. Set Theory. Basic Definitions

CS100: DISCRETE STRUCTURES. Lecture 8 Counting - CH6

12. 6 jokes are minimal.

Reading 14 : Counting

Counting: Basics. Four main concepts this week 10/12/2016. Product rule Sum rule Inclusion-exclusion principle Pigeonhole principle

The Product Rule The Product Rule: A procedure can be broken down into a sequence of two tasks. There are n ways to do the first task and n

Poker Hands. Christopher Hayes

MC215: MATHEMATICAL REASONING AND DISCRETE STRUCTURES

Counting integral solutions

What is counting? (how many ways of doing things) how many possible ways to choose 4 people from 10?

Topics to be covered

Jong C. Park Computer Science Division, KAIST

CSE 312: Foundations of Computing II Quiz Section #2: Inclusion-Exclusion, Pigeonhole, Introduction to Probability (solutions)

LESSON 2: THE INCLUSION-EXCLUSION PRINCIPLE

1. An office building contains 27 floors and has 37 offices on each floor. How many offices are in the building?

Counting. Chapter 6. With Question/Answer Animations

MATH 215 DISCRETE MATHEMATICS INSTRUCTOR: P. WENG

MAT104: Fundamentals of Mathematics II Counting Techniques Class Exercises Solutions

CSE 21: Midterm 1 Solution

CPCS 222 Discrete Structures I Counting

The probability set-up

Block 1 - Sets and Basic Combinatorics. Main Topics in Block 1:

PIGEONHOLE PRINCIPLE

CSE 312: Foundations of Computing II Quiz Section #1: Counting (solutions)

Math 166: Topics in Contemporary Mathematics II

MAT104: Fundamentals of Mathematics II Summary of Counting Techniques and Probability. Preliminary Concepts, Formulas, and Terminology

Name Instructor: Uli Walther

The probability set-up

2.5 Sample Spaces Having Equally Likely Outcomes

Math236 Discrete Maths with Applications

CSE 312: Foundations of Computing II Quiz Section #2: Combinations, Counting Tricks (solutions)

Math 1111 Math Exam Study Guide

NOTES ON SEPT 13-18, 2012

Sec.on Summary. The Product Rule The Sum Rule The Subtraction Rule (Principle of Inclusion- Exclusion)

Activity 3: Combinations

DISCRETE STRUCTURES COUNTING


Discrete Finite Probability Probability 1

CSE 312: Foundations of Computing II Quiz Section #2: Inclusion-Exclusion, Pigeonhole, Introduction to Probability

Math 42, Discrete Mathematics

November 8, Chapter 8: Probability: The Mathematics of Chance

{ a, b }, { a, c }, { b, c }

The study of probability is concerned with the likelihood of events occurring. Many situations can be analyzed using a simplified model of probability

CS Programming Project 1

Final Exam, Math 6105

Math 1111 Math Exam Study Guide

Def: The intersection of A and B is the set of all elements common to both set A and set B

Counting Problems for Group 2(Due by EOC Sep. 27)

Week 1: Probability models and counting

PROBLEM SET 2 Due: Friday, September 28. Reading: CLRS Chapter 5 & Appendix C; CLR Sections 6.1, 6.2, 6.3, & 6.6;

Poker: Probabilities of the Various Hands

Mat 344F challenge set #2 Solutions

2. How many bit strings of length 10 begin with 1101? a b. 2 6 c. 2 4 d. None of the above.

CSE 312: Foundations of Computing II Quiz Section #1: Counting

Teaching the TERNARY BASE

CS 237 Fall 2018, Homework SOLUTION

Theory of Probability - Brett Bernstein

Probability and Counting Techniques

CISC 1400 Discrete Structures

Poker: Further Issues in Probability. Poker I 1/29

Activity 1: Play comparison games involving fractions, decimals and/or integers.

CS 3233 Discrete Mathematical Structure Midterm 2 Exam Solution Tuesday, April 17, :30 1:45 pm. Last Name: First Name: Student ID:

March 5, What is the area (in square units) of the region in the first quadrant defined by 18 x + y 20?

CISC-102 Fall 2017 Week 8

Chapter 1. Probability

Discrete Structures for Computer Science

MATHEMATICS 152, FALL 2004 METHODS OF DISCRETE MATHEMATICS Outline #10 (Sets and Probability)

10 Game. Chapter. The PV Unit comes with two built-in games for your enjoyment. The games are named Game-1 and Game-2.

Poker: Probabilities of the Various Hands

Name: Exam 1. September 14, 2017

STAT 430/510 Probability Lecture 3: Space and Event; Sample Spaces with Equally Likely Outcomes

Developed by Rashmi Kathuria. She can be reached at

With Question/Answer Animations. Chapter 6

Principle of Inclusion-Exclusion Notes

CMPSCI 240: Reasoning Under Uncertainty First Midterm Exam

Counting integral solutions

CS Project 1 Fall 2017

In how many ways can we paint 6 rooms, choosing from 15 available colors? What if we want all rooms painted with different colors?

9.5 Counting Subsets of a Set: Combinations. Answers for Test Yourself

Grade 7/8 Math Circles Game Theory October 27/28, 2015

More Probability: Poker Hands and some issues in Counting

POKER (AN INTRODUCTION TO COUNTING)

Simulations. 1 The Concept

Grade 6 Math Circles Combinatorial Games - Solutions November 3/4, 2015

Math 475, Problem Set #3: Solutions

Discrete Structures for Computer Science

3 The multiplication rule/miscellaneous counting problems

EECS 203 Spring 2016 Lecture 15 Page 1 of 6

Discrete Mathematics and Probability Theory Fall 2016 Seshia and Walrand HW 8

Counting and Probability Math 2320

Transcription:

Today s Topics Inclusion/exclusion principle The pigeonhole principle Sometimes when counting a set, we count the same item more than once For instance, if something can be done n 1 ways or n 2 ways, but some of the n 1 ways are the same as some of the n 2 ways. In this case n 1 + n 2 is an overcount of the ways to complete the task! What we really want to do is count the n 1 + n 2 ways to complete the task and then subtract out the common solutions. This is called the inclusion/exclusion principle. 1

We can formulate this concept using set theory Suppose that a task T can be completed using a solution drawn from one of two classes: A 1 and A 2 As in the sum rule, we can define the solution set for the task T as S = A 1 A 2 Then S = A 1 A 2 = A 1 + A 2 - A 1 A 2 A 1 A 2 Do you remember this from way back in the semester? Counting Bit Strings Example: How many bit strings of length 8 start with a 1 or end with 00? 2 7 = 128 8-bit strings start with a 1 2 6 = 64 8-bit strings end with 00 2 5 = 32 8-bit strings start with a 1 and end with 00 So, we have 128 + 64 32 = 160 ways to construct an 8-bit string that starts with a 1 or ends with 00. 2

Job Applications Example: A company receives 350 applications. Suppose 220 of these people majored in CS, 147 majored in business, and 51 were double-majors. How many applicants majored in neither CS nor business? Let C be the set of CS majors, B be the set of business majors C B = C + B - C B = 220 + 147 51 = 316 So of the 350 applications, 350 316 = 34 applications neither majored in CS nor business. The pigeonhole principle is an incredibly simple concept that is extremely useful! The pigeonhole principle: If k is a positive integer and k+1 objects are placed in k boxes, then at least one box contains at least two objects. Example: k = 4 3

The pigeonhole principle is also easy to prove The pigeonhole principle: If k is a positive integer and k+1 objects are placed in k boxes, then at least one box contains at least two objects. Proof: Assume that each of the k boxes contains at most 1 item. This means that there are at most k items, which is a contradiction of our assumption that we have k+1 items, so at least one box must contain more than one item. Examples Example: Among any group of 367 people there are at least two with the same birthday, since there are only 366 possible birthdays. Example: Among any 27 English words, at least two will start with the same letter. 4

Group Work! Problem 1: How many bit strings of length 10 both begin and end with a 1? Problem 2: How many bit strings of length 10 begin with three 0s or end with two 0s? Problem 3: If a student can get either an A, B, C, D, or F on a test, how many students are needed to ensure that at least two get the same grade? There is a more general form of the pigeonhole principle that is even more useful The generalized pigeonhole principle: If N objects are placed into k boxes, then there is at least one box containing at least N/k items. 5

Example What is the minimum number of students needed such that at least six students receive the same grade, if possible grades are A, B, C, D, and F? Need the smallest integer N such that N/5 = 6 With 25 students, it would be possible (though unlikely) to have 6 students get each possible grade By adding a 26 th student, we guarantee that at least 6 students get one possible grade So, the smallest such N is 5 5 + 1 = 26 From the casino How many cards must be drawn from a standard 52- card deck to guarantee that three cards of the same suit are drawn? Let s make 4 piles: one for each suit We want to have N/4 3 We can do this using 4 2 + 1 = 9 cards Note: We don t need 9 cards to end up with three from the same suit---if we did, we could never get a flush in poker! 6

We can t always use the pigeonhole principle directly How many card would we need to draw to ensure that we picked at least three hearts? In the worst case, we would need to draw every club, spade, and diamond before getting three hearts So, to guarantee three hearts, we need to draw 3 13 + 3 = 42 cards! Ma Bell What is the least number of area codes needed to guarantee that the 25 million phones in some state can be assigned distinct 10-digit phone numbers of the form NXX-NXX-XXXX? The product rule tells us that there are 8 million phone numbers of the form NXX-XXXX Think of phones as objects and phone numbers as boxes By the generalized pigeonhole principle, we know that some box contains at least 25,000,000/8,000,000 = 4 objects This means that we need 4 area codes to ensure that each phone gets a unique 10-digit number 7

This has been easy so far, right? Unfortunately, life isn t always easy! Sometimes, we need to be clever when we are defining our boxes or assigning objects to them For example Sports... During a month with 30 days, a baseball team plays at least one game per day, but no more than 45 games total. Show that there must be some period of consecutive days in which exactly 14 games are played. Let a j be the number of games played on or before the j th day of the month. Note that the sequence {a j } is strictly increasing. Note also that {a j + 14} is also an increasing sequence Now, consider a 1, a 2,, a 30, a 1 + 14, a 2 + 14,, a 30 + 14 There are 60 terms in this sequence, all (45 + 14) = 59 By the pigeonhole principle, at least two terms are equal Note: Each a j for j = 1, 2,, 30 is distinct, as is each a j + 14 This means there exists some a i that is equal to some a j + 14, so 14 games were played from day j + 1 to day i 8

Group Work! Problem 1: What is the minimum number of students, each of whom comes from one of the 50 states, who must be enrolled in a university to guarantee that there are at least 100 who come from the same state? Problem 2: A drawer contains a dozen brown socks and a dozen black socks, all unmatched. How many socks must be drawn to find a matching pair? How many socks must be drawn to find a pair of black socks? Final Thoughts The inclusion/exclusion principle is useful when we need to avoid overcounting The pigeonhole principle and its generalized form are useful for solving many types of counting problems 9