ICS 253: Discrete Structures I Counting and Applications King Fahd University of Petroleum & Minerals Information & Computer Science Department.

Slides:



Advertisements
Similar presentations
5.3 Permutations and Combinations
Advertisements

12 April 2009Instructor: Tasneem Darwish1 University of Palestine Faculty of Applied Engineering and Urban Planning Software Engineering Department Introduction.
Counting Chapter 6 With Question/Answer Animations.
Permutations and Combinations Rosen 4.3. Permutations A permutation of a set of distinct objects is an ordered arrangement these objects. An ordered arrangement.
Counting Chapter 6 With Question/Answer Animations.
The Pigeonhole Principle
1 Combinatorics Rosen 6 th ed., § , § Combinatorics Count the number of ways to put things together into various combinations.Count the number.
Chapter 6 With Question/Answer Animations. Chapter Summary The Basics of Counting The Pigeonhole Principle Permutations and Combinations Binomial Coefficients.
THE BASIC OF COUNTING Discrete mathematics KNURE, Software department, Ph , N.V. Bilous.
Counting and Probability The outcome of a random process is sure to occur, but impossible to predict. Examples: fair coin tossing, rolling a pair of dice,
CSE115/ENGR160 Discrete Mathematics 04/17/12
Permutations r-permutation (AKA “ordered r-selection”) An ordered arrangement of r elements of a set of n distinct elements. permutation of a set of n.
CSE115/ENGR160 Discrete Mathematics 04/10/12
CSE 321 Discrete Structures Winter 2008 Lecture 16 Counting.
Combinations We should use permutation where order matters
Discrete Mathematics Lecture 6 Alexander Bukharovich New York University.
Recursive Definitions Rosen, 3.4 Recursive (or inductive) Definitions Sometimes easier to define an object in terms of itself. This process is called.
Section 4.3: Permutations and Combinations Def: A permutation of a set of distinct objects is an ordered arrangement of these objects. Ex: {a, b, c, d}
CS100 : Discrete Structures
4. Counting 4.1 The Basic of Counting Basic Counting Principles Example 1 suppose that either a member of the faculty or a student in the department is.
Counting Chapter 6 With Question/Answer Animations.
Chapter The Basics of Counting 5.2 The Pigeonhole Principle
1 Permutations and Combinations. 2 In this section, techniques will be introduced for counting the unordered selections of distinct objects and the ordered.
Counting. Why counting  Determine the complexity of algorithms To sort n numbers, how many instructions are executed ?  Count the number of objects.
The Basics of Counting Section 6.1.
Counting. Product Rule Example Sum Rule Pigeonhole principle If there are more pigeons than pigeonholes, then there must be at least one pigeonhole.
1 Melikyan/DM/Fall09 Discrete Mathematics Ch. 6 Counting and Probability Instructor: Hayk Melikyan Today we will review sections 6.4,
Chapter The Basics of Counting 5.2 The Pigeonhole Principle
Generalized Permutations and Combinations
Chapter 6 With Question/Answer Animations 1. Chapter Summary The Basics of Counting The Pigeonhole Principle Permutations and Combinations Binomial Coefficients.
Permutations and Combinations
Fall 2002CMSC Discrete Structures1 One, two, three, we’re… Counting.
Dr. Eng. Farag Elnagahy Office Phone: King ABDUL AZIZ University Faculty Of Computing and Information Technology CPCS 222.
ICS 253: Discrete Structures I Counting and Applications King Fahd University of Petroleum & Minerals Information & Computer Science Department.
Unit 7 Permutation and Combination IT Disicipline ITD1111 Discrete Mathematics & Statistics STDTLP 1 Unit 7 Permutation and Combination.
Module #15: Combinatorics Rosen 5 th ed., §§ & §6.5 Now we are moving on to Ch. 4 It is the study of arrangement of objects e.g. enumeration, counting.
The Pigeonhole Principle. The pigeonhole principle Suppose a flock of pigeons fly into a set of pigeonholes to roost If there are more pigeons than pigeonholes,
ICS 253: Discrete Structures I Discrete Probability King Fahd University of Petroleum & Minerals Information & Computer Science Department.
CS 103 Discrete Structures Lecture 16
5.2 The Pigeonhole Principle
Counting Principles Multiplication rule Permutations Combinations.
Counting.
5.5 Generalized Permutations and Combinations
2/24/20161 One, two, three, we’re… Counting. 2/24/20162 Basic Counting Principles Counting problems are of the following kind: “How many different 8-letter.
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.
CS 104: Discrete Mathematics
Discrete Mathematics. Exercises Exercise 1:  There are 18 Computer Science (CS) majors and 325 Business Administration (BA) majors at a college.
Section The Pigeonhole Principle If a flock of 20 pigeons roosts in a set of 19 pigeonholes, one of the pigeonholes must have more than 1 pigeon.
1 DISCRETE STRUCTURES DISCRETE STRUCTURES SSK3003 DR. ALI MAMAT 1.
Chapter 6 With Question/Answer Animations Copyright © McGraw-Hill Education. All rights reserved. No reproduction or distribution without the prior written.
Discrete Mathematics and Its Applications Sixth Edition By Kenneth Rosen Chapter 5 Counting 歐亞書局.
Section The Product Rule  Example: How many different license plates can be made if each plate contains a sequence of three uppercase English letters.
COUNTING Discrete Math Team KS MATEMATIKA DISKRIT (DISCRETE MATHEMATICS ) 1.
Section 6.3. Section Summary Permutations Combinations.
Example A standard deck of 52 cards has 13 kinds of cards, with four cards of each of kind, one in each of the four suits, hearts, diamonds, spades, and.
Lec 13 – March 10  The Basics of Counting  The Pigeonhole Principle  Permutations and Combinations  Binomial Coefficients and Identities  Generalized.
Counting Chapter 6.
Discrete Mathematics Counting.
ICS 253: Discrete Structures I
The Pigeonhole Principle
CSE15 Discrete Mathematics 04/19/17
ICS 253: Discrete Structures I
Chapter 5, Section 5.1 The Basics of Counting
The Pigeonhole Principle
COCS DISCRETE STRUCTURES
Permutations and Combinations
Counting Chapter 6 With Question/Answer Animations
CS 2210 Discrete Structures Counting
CS100: Discrete structures
Permutations and Combinations
Presentation transcript:

ICS 253: Discrete Structures I Counting and Applications King Fahd University of Petroleum & Minerals Information & Computer Science Department

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Counting and Applications 093 ICS 253: Discrete Structures I Example What is C(4,2)? 16

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

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

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