240 likes | 258 Views
Learn the basics of counting principles in mathematics with the Counting Principle and Pigeonhole Principle. Combinatorics introduces elegant methods for counting arrangements and permutations. Explore real-world examples and applications.
E N D
Counting Principle and Pigeon Hole Principle K.RAJAM ASSOCIATE PROFESSOR MATHEMATICS MSEC
Combinatorics • 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.
Basic Counting Principle What does it represent? Counting
Basic Counting Principle There are two fundamental principle of counting • The Addition Rule (Sum Rule) • The Multiplication Rule (Product Rule)
Basic Counting Principle The Sum Rule: If a task can be done either in one of n1 waysor in one of n2 ways, where none of the set of n1 ways is the same as any of the set of n2 ways, then there are n1+n2 ways.
Basic Counting Principle The Product Rule: Suppose that a procedure can be broken down into a sequence of two tasks. If there aren1 ways to do the first task and for each of these ways of doing the first task, there are n2 ways to do the second task, then there are n1n2 ways to do the procedure.
Examples 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
Examples 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
Examples 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 262626 = 17576 different license plates.
Examples 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 a1,a2, … ,am There are n ways to choose the value of the function at a1 Since the function is 1 – 1, the value of the function at a2 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
Examples Example:5 What is the value of the ‘k’ after the following code has been executed k:=0 for i1:= 1 to n1 for i2:= 1 to n2 . . . . . . . . . for im:= 1 to nm k:=k+1 Answer: By the product rule, n1 . n2. n3. … nm
Examples Example:6 What is the value of the ‘k’ after the following code has been executed k:=0 for i1:= 1 to n1 k:=k+1 for i2:= 1 to n2 k:=k+1 . . . . . . . . . for im:= 1 to nm k:=k+1 Answer: By the sum rule, n1 + n2+ n3 + … +nm
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 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 >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 least 367/365= 2 of them must have been born on the same date. Example: 2 Among 100 people there are 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 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.
Principle of Inclusion-Exclusion (PIE) Theorem: Let A1,A2, …,An be finite sets, then |A1 A2 ...An|= i|Ai| - i<j|Ai Aj| + i<j<k|Ai Aj Ak| - … +(-1)n+1 |A1A2...An| Each summation is over • all i, • pairs i,j with i<j, • triples with i<j<k, etc.
PIE Theorem: Example • To illustrate, when n=2, we have |A1 A2| =|A1| + |A2| - |A1 A2| • To illustrate, when n=3, we have |A1 A2 A3|= |A1|+ |A2| +|A3| - [|A1A2|+|A1A3|+|A2A3|] +|A1 A2 A3|
PIE Theorem: Example • To illustrate, when n=4, we have |A1A2A3A4|= |A1|+|A2|+|A3|+|A4| - [|A1A2|+|A1A3|+|A1A4| +|A2A3|+|A2A4|+|A3A4|] + [|A1A2A3|+|A1A2A4| +|A1A3A4|+|A2A3A4|] - |A1 A2 A3 A4|
Application of PIE: • 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 = {nZ | (1 n 300) (3|n)} B = {nZ | (1 n 300) (5|n)} C = {nZ | (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
Application of PIE: Example • How many integers between 1 and 300 (inclusive) are divisible by at least one of 3,5,7? Answer: |AB C| • By the principle of inclusion-exclusion |AB C|= |A|+|B|+|C|-[|AB|+|AC|+|BC|]+|ABC| • How big are these sets? We use the floor function |A| = 300/3 = 100 |AB| = 300/15 = 20 |B| = 300/5 = 60 |AC| = 300/21 = 100 |C| = 300/7 = 42 |BC| = 300/35 = 8 |ABC| = 300/105 = 2 • Therefore: |AB C| = 100 + 60 + 42 - (20+14+8) + 2 = 162
Application of PIE: Example • 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 |AB| = 300/15 = 20 |B| = 300/5 = 60 |AC| = 300/21 = 100 |C| = 300/7 = 42 |BC| = 300/35 = 8 |ABC| = 300/105 = 2
Application of PIE: Example • 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 |AB| = 300/15 = 20 |B| = 300/5 = 60 |AC| = 300/21 = 100 |C| = 300/7 = 42 |BC| = 300/35 = 8 |ABC| = 300/105 = 2