1 / 16

Counting Principles and Techniques: Introduction and Examples

This text introduces counting principles and techniques to solve various counting problems, including the use of product rule, sum rule, inclusion-exclusion principle, pigeonhole principle, and more. Includes examples and explanations.

perras
Télécharger la présentation

Counting Principles and Techniques: Introduction and Examples

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Counting

  2. Introduction Suppose that a password on a computer system consists of 6, 7, or 8 characters. Each of these characters must be a digit or a letter of the alphabet. Each password must contain at least one digit. How many such passwords are there? The techniques needed to answer this question and a wide variety of other counting problems will be solved by using counting principles.

  3. Basic Counting Principles Product Rule Suppose that a procedure can be broken down into a sequence of two tasks. If there are n1 ways to do the first task and for each of these n1 ways, there are n2 ways to do the second task, then there are n1n2 ways to do the procedure. Ex. A new company with just two employees, Verma and Patel, rents a floor of a building with 12 offices. How many ways are there to assign different offices to these two employees.

  4. Sol. Assign an office to Verma, which can be done in 12 ways, then assign an office to Patel different from the office assigned to Verma, which can be done in 11 ways. By the product rule, no. of ways to assign offices to these two employees = 12 . 11 = 132 Ex. How many different bit strings of length 7 are there? Sol. Each of the seven bits can be chosen in two ways, either 0 or 1. By the product rule, there are 27 = 128 different bit strings of length seven.

  5. Ex. The chairs of an auditorium are to be labeled with a letter and a positive integer not exceeding 100. what is the largest number of chairs that can be labeled differently. Sol. Assign one of the 26 letters and then assign one of the 100 possible integers to the seat. By product rule, there are 26.100 = 2600 different ways that a chair can be labeled.  the largest number of chairs that can be labeled differently is 2600.

  6. Sum Rule If a task can be done either in one of n1 ways or in one of n2 ways, where none of the n1 ways is the same as any of the n2 ways, then there are n1 + n2 ways to do the task. Ex A student can choose a computer project from one of three lists. The three lists contain 23, 15 and 19 possible projects respectively. No project is on more than one list. How many possible projects are there to choose from? Sol A student can choose a project by selecting a project from first list, second list or the third list. Since no project is on more than one list, by the sum rule, no. of ways to choose a project = 23 + 15 + 19 = 57

  7. Ex. Each user on a computer system has a password, which is 6 to 8 characters long where each character is an upper case letter or digit. Each password must contain at least one digit. How many possible passwords are there? Sol. Let P6, P7, and P8 denote the number of possible passwords of length 6, 7 and 8, respectively. By sum rule, the total number of possible passwords = P6 + P7 + P8 By the product rule, the number of strings of six characters is 366, and the number of strings with no digits is 266. Hence,

  8. P6 = 366 – 266 = 2,176,782,336 – 308,915,776 = 1,867,866,560 P7 = 367 – 267 = 78,364,164,096 – 8,031,810,176 = 70,332,353,920 and P8 = 368 – 268 = 2,821,109,907,456 – 208,827,064,576 = 2,612,282,842,880 Consequently, P = P6 + P7 + P8 = 2,684,483,063,360. Ex. If there are 14 boys and 12 girls in a class. Find the number of ways of selecting one student as class representative.

  9. The Inclusion – Exclusion Principle Suppose that a task can be done in n1 or in n2 ways, but that some of the n1 ways to do the task are the same as some of the n2 other ways to do the task. In this situation we can not use the sum rule to count the number of ways to do the task. To correctly count the number of ways to do the two tasks, we add the number of ways to do it in one way and the number of ways to do it in the other way, and then subtract the number of ways to do the task in a way that is both among the set of n1 ways and the set of n2 ways. This technique is called the principle of inclusion-exclusion. Also called the subtraction principle.

  10. Ex. How many bit strings of length 8 either start with a 1 bit or end with two bits 00. Sol. In first case, the first bit can be chosen in only one way and each of the other seven bits can be chosen in two ways. So, bit string of length 8 that begins with a 1 in 27 = 128 ways. Similarly, bit string of length 8 ending with two bits 00, in 26 = 64 ways. Now, there are some bit strings which starts with 1 and ends with 00 both, in 25 = 32 ways. Hence, the number of bit strings of length 8 that begin with a 1 or end with a 00 = 128 + 64 – 32 = 160

  11. The Pigeonhole Principle Suppose that a flock of 20 pigeons fly into a set of 19 pigeonholes to roost. Because there are 20 pigeons but only 19 pigeonholes, at least one of these 19 pigeonholes must have at least 2 pigeons in it. Theorem If k is a positive integer and k+1 or more objects are placed into k boxes, then there is at least one box containing two or more of the objects. This is also called Dirichlet drawer principle.

  12. Ex. Among any group of 367 people, there must be at least two with the same birthday, because there are only 366 possible birthdays. Ex. In any group of 27 English words, there must be at least two that begin with the same letter, because there are 26 letters in the English alphabets.

  13. The Generalized Pigeonhole Principle If N objects are placed into k boxes, then there is at least one box containing at least N/k objects. Proof Suppose that none of the boxes contains more than N/k - 1 objects. Then total number of objects is at most [∵N/k < (N/k) + 1 ] This is a contradiction because there are a total of N objects.

  14. Ex. Among 100 people there are at least 100/12 = 9 who were born in the same month. Ex. a) How many cards must be selected from a standard deck of 52 cards to guarantee that at least three cards of the same suit are chosen? Sol. Let number of cards to be selected = N Since number of suits = 4 By the generalized pigeonhole principle, there is at least N/4 cards of one suit If at least three cards of one suit are to be selected, then N/4  3 N = 2 . 4 + 1 = 9 Minimum 9 cards are to be selected that atleast 3 are of same suit

  15. b) How many cards must be selected to guarantee that at least three hearts are selected? Sol. In worst case, we can select all the clubs, diamonds, and spades, 39 cards in all, before we select a single heart. The next three cards will be all hearts, so we may need to select 42 cards to get 3 hearts.

More Related