COUNTING PRINCIPLE AND PIGEON HOLE PRINCIPLE K RAJAM

  • Slides: 24
Download presentation
COUNTING PRINCIPLE AND PIGEON HOLE PRINCIPLE K. RAJAM ASSOCIATE PROFESSOR MATHEMATICS MSEC

COUNTING PRINCIPLE AND PIGEON HOLE PRINCIPLE K. RAJAM ASSOCIATE PROFESSOR MATHEMATICS MSEC

� Combinatorics, study of arrangements of objects is an important part of Discrete Mathematics.

� Combinatorics, study of arrangements of objects is an important part of Discrete Mathematics. � It deals with the art of counting and enumeration of specified objects, patterns and designs. � Techniques of counting are important in Mathematics and Computer Science. � Permutations and Combinations provide us with elegant methods of counting without actual counting.

What does it represent? Counting

What does it represent? Counting

There are two fundamental principle of counting �The Addition Rule (Sum Rule) �The Multiplication

There are two fundamental principle of counting �The Addition Rule (Sum Rule) �The Multiplication Rule (Product Rule)

The Sum Rule: If a task can be done either in one of n

The Sum Rule: If a task can be done either in one of n 1 ways or in one of n 2 ways, where none of the set of n 1 ways is the same as any of the set of n 2 ways, then there are n 1+n 2 ways.

The Product Rule: Suppose that a procedure can be broken down into a sequence

The Product Rule: Suppose that a procedure can be broken down into a sequence of two tasks. If there are n 1 ways to do the first task and for each of these ways of doing the first task, there are n 2 ways to do the second task, then there are n 1 n 2 ways to do the procedure.

Example: 1 A new company with just 2 employees, Sankar and Patel rents a

Example: 1 A new company with just 2 employees, Sankar and Patel rents a floor of a building with 12 offices. How many ways are there to assign different offices to 2 employees? Solution: Assuming an office to Sankar can be done in 12 ways. Assuming an office to Patel different from the office assigned to Sankar can be done in 11 ways. By Product Rule there are 12 11 = 132 ways

Example: 2 A student can choose a computer project from one of the 3

Example: 2 A student can choose a computer project from one of the 3 lists. The 3 list contains 31, 24 and 37 projects. No projects is on more than one list. How many possible projects are there to choose from the 3 lists. Solution: Given 3 list contains 31, 24 and 37 projects and no project is on more than one list By Sum Rule there are 31+24+37 = 92 ways

Example: 3 How many different license plates are there that containing exactly three English

Example: 3 How many different license plates are there that containing exactly three English letters ? Solution: There are 26 possibilities to pick the first letter, then 26 possibilities for the second one, and 26 for the last one. So there are 26 26 26 = 17576 different license plates.

Example: 4 How many 1 – 1 function s are there from a set

Example: 4 How many 1 – 1 function s are there from a set with m elements to a set with n elements? Solution: When m>n, there are no 1 – 1 functions from a set with m elements to a set with n elements Let us assume m ≤ n Suppose the element in the domain are a 1, a 2, … , am There are n ways to choose the value of the function at a 1 Since the function is 1 – 1, the value of the function at a 2 can be picked in n – 1 ways. In general, value of the function at ak can be chosen in n – k+1 ways. By Product Rule there are n(n-1)(n-2) … (n-m+1) 1 – 1 functions from a set with m elements to a set with n elements

Example: 5 What is the value of the ‘k’ after the following code has

Example: 5 What is the value of the ‘k’ after the following code has been executed k: =0 for i 1: = 1 to n 1 for i 2: = 1 to n 2 Answer: . . . By the product rule, . . . n 1. n 2. n 3. … nm. . . for im: = 1 to nm k: =k+1

Example: 6 What is the value of the ‘k’ after the following code has

Example: 6 What is the value of the ‘k’ after the following code has been executed k: =0 for i 1: = 1 to n 1 Answer: k: =k+1 By the sum rule, for i 2: = 1 to n 2 n 1 + n 2+ n 3 + … +nm k: =k+1. . for im: = 1 to nm k: =k+1

THE PIGEONHOLE PRINCIPLE If n pigeons are accommodated in m pigeon holes and n

THE PIGEONHOLE PRINCIPLE If n pigeons are accommodated in m pigeon holes and n >m, then at least one pigeon hole will contain two or more pigeons. (OR) If n objects are put in m boxes and n>m then atleast 1 box will contain 2 or more objects

THE PIGEONHOLE PRINCIPLE � If k + 1 or more objects are placed in

THE PIGEONHOLE PRINCIPLE � If k + 1 or more objects are placed in k boxes, then there is at least one box containing two or more objects.

GENERLAIZED PIGEONHOLE PRINCIPLE If n pigeons are accommodated in m pigeon holes and n

GENERLAIZED PIGEONHOLE PRINCIPLE If n pigeons are accommodated in m pigeon holes and n >m, then one of the pigeon holes must contain at least pigeons, where denotes the smallest integer ≥x

GENERLAIZED PIGEONHOLE PRINCIPLE Example: 1 In any group of 367 or more people, at

GENERLAIZED PIGEONHOLE PRINCIPLE Example: 1 In any group of 367 or more people, at least 367/365 = 2 of them must have been born on the same date. Example: 2 Among 100 people there at least 100/12 = 9 people with the same birthday month. Example: 3 In a class of 47 students, how many will receive the same grade on a scale {S, A, B, C, D, E}. Answer: 47/6 =8

GENERLAIZED PIGEONHOLE PRINCIPLE Example: 4 Prove that in any group of 5 people, atleast

GENERLAIZED PIGEONHOLE PRINCIPLE Example: 4 Prove that in any group of 5 people, atleast 3 must be mutual friends or atleast 3 must be mutual strangers. Example: 5 If we select 10 points in the interior of an equilateral triangle of length 1. Prove that there must be atleast 2 points whose distance is less than 1/3.

Theorem: Let A 1, A 2, …, An be finite sets, then |A 1

Theorem: Let A 1, A 2, …, An be finite sets, then |A 1 A 2 . . . An|= i|Ai| - i<j|Ai Aj| + i<j<k|Ai Aj Ak| -… +(-1)n+1 |A 1 A 2. . . An| Each summation is over all i, pairs i, j with i<j, triples with i<j<k, etc.

� To illustrate, when n=2, we have |A 1 A 2| =|A 1| +

� To illustrate, when n=2, we have |A 1 A 2| =|A 1| + |A 2| - |A 1 A 2| � To illustrate, when n=3, we have |A 1 A 2 A 3|= |A 1|+ |A 2| +|A 3| [|A 1 A 2|+|A 1 A 3|+|A 2 A 3|] +|A 1 A 2 A 3|

� To illustrate, when n=4, we have |A 1 A 2 A 3 A

� To illustrate, when n=4, we have |A 1 A 2 A 3 A 4|= |A 1|+|A 2|+|A 3|+|A 4| - [|A 1 A 2|+|A 1 A 3|+|A 1 A 4| +|A 2 A 3|+|A 2 A 4|+|A 3 A 4|] + [|A 1 A 2 A 3|+|A 1 A 2 A 4| +|A 1 A 3 A 4|+|A 2 A 3 A 4|] - |A 1 A 2 A 3 A 4|

� How many integers between 1 and 300 (inclusive) are � Divisible by at

� How many integers between 1 and 300 (inclusive) are � Divisible by at least one of 3, 5, 7? � Divisible by 3 and by 5 but not by 7? � Divisible by 5 but by neither 3 or 7? � Let A = {n Z | (1 n 300) (3|n)} B = {n Z | (1 n 300) (5|n)} C = {n Z | (1 n 300) (7|n)} � How big are these sets? We use the floor function |A| = 300/3 = 100 |B| = 300/5 = 60 |C| = 300/7 = 42

How many integers between 1 and 300 (inclusive) are divisible by at least one

How many integers between 1 and 300 (inclusive) are divisible by at least one of 3, 5, 7? Answer: |A B C| � By the principle of inclusion-exclusion |A B C|= |A|+|B|+|C|-[|A B|+|A C|+|B C|]+|A B C| � How big are these sets? We use the floor function |A| = 300/3 = 100 |A B| = 300/15 = 20 |B| = 300/5 = 60 |A C| = 300/21 = 100 |C| = 300/7 = 42 |B C| = 300/35 = 8 |A B C| = 300/105 = 2 � Therefore: |A B C| = 100 + 60 + 42 - (20+14+8) + 2 = 162 �

� � � How many integers between 1 and 300 (inclusive) are divisible by

� � � How many integers between 1 and 300 (inclusive) are divisible by 3 and by 5 but not by 7? Answer: |(A B)C| By the definition of set-minus |(A B)C| = |A B| - |A B C| = 20 – 2 = 18 Knowing that |A| = 300/3 = 100 |A B| = 300/15 = 20 |B| = 300/5 = 60 |A C| = 300/21 = 100 |C| = 300/7 = 42 |B C| = 300/35 = 8 |A B C| = 300/105 = 2

 • � � How many integers between 1 and 300 (inclusive) are divisible

• � � How many integers between 1 and 300 (inclusive) are divisible by 5 but by neither 3 or 7? Answer: |B(A C)| = |B| - |B (A C)| Distributing B over the intersection |B (A C)| = |(B A) (B C)| = |B A| + |B C| - | (B A) (B C) | = |B A| + |B C| - | B A C | = 20 + 8 – 2 = 26 Knowing that |A| = 300/3 = 100 |B| = 300/5 = 60 |C| = 300/7 = 42 |A B| = 300/15 = 20 |A C| = 300/21 = 100 |B C| = 300/35 = 8 |A B C| = 300/105 = 2