Download presentation
Presentation is loading. Please wait.
Published byTeresa Stevenson Modified over 8 years ago
1
ICS 253: Discrete Structures I Counting and Applications King Fahd University of Petroleum & Minerals Information & Computer Science Department
2
Counting and Applications 093 ICS 253: Discrete Structures I Section 5.2: The Pigeonhole Principle 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. Proof: Corollary: A function f from a set with k + 1 or more elements to a set with k elements is not one-to-one. 2
3
Counting and Applications 093 ICS 253: Discrete Structures I Examples Example 1: How many people do you need to ensure that two of them have the same birthday (day and month) Example 2: How many English words do you need to ensure that two of them begin with the same letter. Example 3: How many students must be in a class to guarantee that at least two students receive the same score on the final exam, if the exam is graded on a scale from 0 to 100 points? 3
4
Counting and Applications 093 ICS 253: Discrete Structures I The Generalized Pigeonhole Principle Theorem If N objects are placed into k boxes, then there is at least one box containing at least N/k objects. 4
5
Counting and Applications 093 ICS 253: Discrete Structures I Examples Example 1: What is the minimum number of students required in a discrete mathematics class to be sure that at least six will receive the same grade, if there are five possible grades, A, B, C, D, and F? 5
6
Counting and Applications 093 ICS 253: Discrete Structures I Examples Example 2: 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? three hearts are selected? 6
7
Counting and Applications 093 ICS 253: Discrete Structures I Examples Example 3: What is the least number of area codes needed to guarantee that the 25 million phones in a state can be assigned distinct 10- digit telephone numbers? Assume that telephone numbers are of the form NXX- NXX-XXXX, where the first three digits form the area code, N represents a digit from 2 to 9 inclusive, and X represents any digit. 7
8
Counting and Applications 093 ICS 253: Discrete Structures I Examples Example 4: Suppose that a computer science laboratory has 15 workstations and 10 servers. A cable can be used to directly connect a workstation to a server. For each server, only one direct connection to that server can be active at any time. We want to guarantee that at any time any set of 10 or fewer workstations can simultaneously access different servers via direct connections. what is the minimum number of direct connections needed to achieve this goal? Note that we could do this by connecting every workstation directly to every server (using 150 connections), 8
9
Counting and Applications 093 ICS 253: Discrete Structures I Examples Example 5: During a month with 30 days, a baseball team plays at least one game a day, but no more than 45 games. Show that there must be a period of some number of consecutive days during which the team must play exactly 14 games. 9
10
Counting and Applications 093 ICS 253: Discrete Structures I Examples Example 6: 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. 10
11
Counting and Applications 093 ICS 253: Discrete Structures I Section 5.3: Permutations and Combinations Introduction Many counting problems can be solved by finding the number of ways to arrange a specified number of distinct elements of a set of a particular size, where the order of these elements matters. Many other counting problems can be solved by finding the number of ways to select a particular number of elements from a set of a particular size, where the order of the elements selected does not matter. In how many ways can we select three students from a group of five students to stand in line for a picture? How many different committees of three students can be formed from a group of four students? 11
12
Counting and Applications 093 ICS 253: Discrete Structures I Permutations A permutation of a set of distinct objects is an ordered arrangement of these objects. An ordered arrangement of r elements of a set is called an r-permutation. Let S = {1, 2, 3}. An ordered permutation of S is …… A 2-permutation of S is …… The number of r-permutations of a set with n elements is denoted by P(n, r) Which we can compute using the product rule! 12
13
Counting and Applications 093 ICS 253: Discrete Structures I P(n,r) If n is a positive integer and r is an integer with 1 r n, then, there are __________________ r-permutations of a set with n distinct elements. Note that P(n,0) = 1. Corollary: If n and r are integers with 0 r n then 13
14
Counting and Applications 093 ICS 253: Discrete Structures I Examples Example 1: How many ways are there to select a first-prize winner, a second-prize winner, and a third-prize winner from 100 different people who have entered a contest? Example 2: Suppose that a saleswoman has to visit eight different cities. She must begin her trip in a specified city, but she can visit the other seven cities in any order she wishes. How many possible orders can the saleswoman use when visiting these cities? Example 3: How many permutations of the letters ABCDEFGH contain the string ABC? 14
15
Counting and Applications 093 ICS 253: Discrete Structures I Combinations An r-combination of elements of a set is an unordered selection of r elements from the set. an r-combination is simply a subset of the set with r elements. The number of r-combinations of a set with n distinct elements is denoted by C(n, r). Note that C(n, r) is also denoted by and is called a binomial coefficient. 15
16
Counting and Applications 093 ICS 253: Discrete Structures I Example What is C(4,2)? 16
17
Counting and Applications 093 ICS 253: Discrete Structures I Important Results on Combinations Theorem: The number of r-combinations of a set with n elements, where n is a nonnegative integer and r is an integer with 0 r n, equals Corollary: Let n and r be nonnegative integers with r n. Then C(n, r) = C (n, n – r). 17
18
Counting and Applications 093 ICS 253: Discrete Structures I Examples Example 1: How many ways are there to select five players from a 10-member tennis team to make a trip to a match at another school? Example 2: A group of 30 people have been trained as astronauts to go on the first mission to Mars. How many ways are there to select a crew of six people to go on this mission (assuming that all crew members have the same job)? 18
19
Counting and Applications 093 ICS 253: Discrete Structures I Examples Example 3: How many bit strings of length n contain exactly r 1s? Example 4: Suppose that there are 9 faculty members in the mathematics department and 11 in the computer science department. How many ways are there to select a committee to develop a discrete mathematics course at a school if the committee is to consist of three faculty members from the mathematics department and four from the computer science department? 19
Similar presentations
© 2024 SlidePlayer.com. Inc.
All rights reserved.