Sec 5.1 The Basics of Counting

Similar documents
With Question/Answer Animations. Chapter 6

The Product Rule The Product Rule: A procedure can be broken down into a sequence of two tasks. There are n ways to do the first task and n

Discrete Mathematics: Logic. Discrete Mathematics: Lecture 15: Counting

6.1 Basics of counting

Counting. Chapter 6. With Question/Answer Animations

CPCS 222 Discrete Structures I Counting

What is counting? (how many ways of doing things) how many possible ways to choose 4 people from 10?

Sec.on Summary. The Product Rule The Sum Rule The Subtraction Rule (Principle of Inclusion- Exclusion)

Section Summary. Permutations Combinations Combinatorial Proofs

Outline. Content The basics of counting The pigeonhole principle Reading Chapter 5 IRIS H.-R. JIANG

COUNTING TECHNIQUES. Prepared by Engr. JP Timola Reference: Discrete Math by Kenneth H. Rosen

Discrete Mathematics. Spring 2017

CS100: DISCRETE STRUCTURES. Lecture 8 Counting - CH6

Sec$on Summary. Permutations Combinations Combinatorial Proofs

With Question/Answer Animations. Chapter 6

Topics to be covered

CSCI FOUNDATIONS OF COMPUTER SCIENCE

Discrete Structures Lecture Permutations and Combinations

In how many ways can we paint 6 rooms, choosing from 15 available colors? What if we want all rooms painted with different colors?

Math 365 Wednesday 2/20/19 Section 6.1: Basic counting

The Pigeonhole Principle

Today s Topics. Sometimes when counting a set, we count the same item more than once

November 6, Chapter 8: Probability: The Mathematics of Chance

Permutations and Combinations

Jong C. Park Computer Science Division, KAIST

Mathematical Foundations of Computer Science Lecture Outline August 30, 2018

Counting: Basics. Four main concepts this week 10/12/2016. Product rule Sum rule Inclusion-exclusion principle Pigeonhole principle

The Product Rule can be viewed as counting the number of elements in the Cartesian product of the finite sets

Foundations of Computing Discrete Mathematics Solutions to exercises for week 12

Exercises Exercises. 1. List all the permutations of {a, b, c}. 2. How many different permutations are there of the set {a, b, c, d, e, f, g}?

MATH 215 DISCRETE MATHEMATICS INSTRUCTOR: P. WENG

Counting in Algorithms

Week 1. 1 What Is Combinatorics?

November 8, Chapter 8: Probability: The Mathematics of Chance

Combinatorics, the study of arrangements of objects, is an important part of discrete mathematics.

COUNTING AND PROBABILITY

PUTNAM PROBLEMS FINITE MATHEMATICS, COMBINATORICS

2. How many bit strings of length 10 begin with 1101? a b. 2 6 c. 2 4 d. None of the above.

DISCRETE STRUCTURES COUNTING

Math 42, Discrete Mathematics

Block 1 - Sets and Basic Combinatorics. Main Topics in Block 1:

Reading 14 : Counting

THE PIGEONHOLE PRINCIPLE. MARK FLANAGAN School of Electrical and Electronic Engineering University College Dublin

Team Round University of South Carolina Math Contest, 2018

Math 1111 Math Exam Study Guide

9.5 Counting Subsets of a Set: Combinations. Answers for Test Yourself

Section : Combinations and Permutations

MAT104: Fundamentals of Mathematics II Summary of Counting Techniques and Probability. Preliminary Concepts, Formulas, and Terminology


Permutations and Combinations

Counting and Probability Math 2320

CS 3233 Discrete Mathematical Structure Midterm 2 Exam Solution Tuesday, April 17, :30 1:45 pm. Last Name: First Name: Student ID:

2009 Philippine Elementary Mathematics International Contest Page 1

Elementary Combinatorics

Discrete Mathematics with Applications MATH236

Problem Set 2. Counting

1. An office building contains 27 floors and has 37 offices on each floor. How many offices are in the building?

Lecture 2: Sum rule, partition method, difference method, bijection method, product rules

Discrete mathematics

n! = n(n 1)(n 2) 3 2 1

Probability MAT230. Fall Discrete Mathematics. MAT230 (Discrete Math) Probability Fall / 37

Math 1111 Math Exam Study Guide

CS1802 Week 3: Counting Next Week : QUIZ 1 (30 min)

Lecture 18 - Counting

12. 6 jokes are minimal.

Honors Precalculus Chapter 9 Summary Basic Combinatorics

Georgia Tech HSMC 2010

Mat 344F challenge set #2 Solutions

Fermat s little theorem. RSA.

Probability and Counting Techniques

MC215: MATHEMATICAL REASONING AND DISCRETE STRUCTURES

Twenty-sixth Annual UNC Math Contest First Round Fall, 2017

Algebra II- Chapter 12- Test Review

EECS 203 Spring 2016 Lecture 15 Page 1 of 6

ON SPLITTING UP PILES OF STONES

Section Summary. Finite Probability Probabilities of Complements and Unions of Events Probabilistic Reasoning

Math 166: Topics in Contemporary Mathematics II

Distribution of Aces Among Dealt Hands

Generalized Permutations and The Multinomial Theorem

17. Symmetries. Thus, the example above corresponds to the matrix: We shall now look at how permutations relate to trees.

Math236 Discrete Maths with Applications

Assignment 2. Due: Monday Oct. 15, :59pm

Simple Counting Problems

CSE 20 DISCRETE MATH. Fall

Daniel Plotnick. November 5 th, 2017 Mock (Practice) AMC 8 Welcome!

Organization Team Team ID# If each of the congruent figures has area 1, what is the area of the square?

Introductory Probability

Chapter 1. Probability

LESSON 2: THE INCLUSION-EXCLUSION PRINCIPLE

50 Counting Questions

7.4 Permutations and Combinations

Permutations and Combinations

Permutations and Combinations Practice Test

CIS 2033 Lecture 6, Spring 2017

Teacher s Notes. Problem of the Month: Courtney s Collection

Compound Probability. Set Theory. Basic Definitions

The study of probability is concerned with the likelihood of events occurring. Many situations can be analyzed using a simplified model of probability

Notes for Recitation 3

Chapter 7. Intro to Counting

18.204: CHIP FIRING GAMES

Transcription:

1 Sec 5.1 The Basics of Counting Combinatorics, the study of arrangements of objects, is an important part of discrete mathematics. In this chapter, we will learn basic techniques of counting which has a lot of applications, e.g. how many different North American telephone numbers are possible? 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? What is the chance of getting a full house in a poker hand? 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 The chairs of an auditorium are to be labeled with a letter followed by a positive number not exceeding 100. What is the largest number of chairs that can be labeled differently? The product rule extends to the case a procedure can be broken down into a sequence of more than just two tasks. Suppose that the procedure is carried out by performing the tasks T 1, T 2,, T k in sequence. If each tasks T i can be done in n i ways, regardless of how the previous tasks were done, then there are n 1 n 2 n k ways to carry out the procedure. Example 2 How many different license plates are available if each plate contains a sequence of three letters followed by three digits? Example 3 Let A = {1, 2,, m} and B = {1, 2,, n}. 1. How many functions are there from A to B? 2. How many one-to-one functions are there from A to B? Example 4 The telephone numbers in North America must consist of 10 digits, which are split into a three-digit area code, three-digit office code, and four-digit station code. According to the regulations of the North American Numbering Plan, each number should be of the form NXX NXX XXXX, where N denotes a digit that can take any of the values 2 through 9, and X denotes a digit that can take any of the values 0 through 9. How many different North American telephone numbers are possible?

2 We now introduce the sum rule. 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 to do the task. Example 5 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? Many counting problems cannot be solved using just the product rule or just the sum rule. However, many complicated counting problems can be solved using both of these rules in combination. Example 6 Each user on a computer system has a password, which is six to eight characters long, where each character is an uppercase letter or a digit. Each password must contain at least one digit. How many possible passwords are there?

3 Sec 5.2 The Pigeonhole Principle Suppose that a flock of 20 pigeons flies into a set of 19 pigeonholes, then we can say for sure that at least one of these 19 pigeonholes must have at least two pigeons in it. This illustrates a general principle called Pigeonhole Principle. Pigeonhole Principle Let k be a positive integer. If k + 1 or more objects are placed into k boxes, then there is at least one box containing two or more of objects. Example 1 A function f from a set with k + 1 or more elements to a set with k elements is not one-to-one. Example 2 In any group of 27 English words, there must be at least two that begin with the same letter. Example 3 Assume that there were more than 100, 000, 000 wage earners in the United States who earned less than 1, 000, 000 dollars. Show that there are two who earned exactly the same amount of money, to the penny, last year. Example 4 Let d be a positive integer. Show that among any group of d + 1 (not necessarily consecutive) integers there are two with exactly the same remainder when they are divided by d. Example 5 Show that for every integer n there is a multiple of n that has only 0s and 1s in its decimal expansion.

4 Now we want to generalize Pigeonhole Principle. Suppose 21 objects are distributed into 10 boxes, then at least one box must have at least 3 objects. This is a special case of the following theorem: 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 We use the proof by contradiction. Suppose not, that is, each box contains at most objects in it. Then the total number of objects is at most. Note that N < N + 1, hence k k we have ( ) (( ) ) N N k 1 < k k k + 1 1 = N, which gives a contradiction. Example 6 Among 100 people there are at least 100 = 9 who were born in the same month. 12 Example 7 There are 38 different time periods during which classes at a college can be scheduled. If there are 677 different classes, how many different rooms will be needed?

5 Sec 5.3 Permutations and Combinations 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. We begin by considering an example. Example 1 In how many ways can we select three students from a group of five students to stand in line for a picture. In how many ways can we arrange all five of these students in a line for a picture? Definition 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. Example 2 Let S = {1, 2, 3, 4, 5}. The ordered arrangement (4, 2, 1, 5, 3) is a permutation of S. (3, 1, 4) is a 3-permutation of S. Definition The number of r-permutations of a set with n elements is denoted by P (n, r) or n P r. We want to compute P (n, r). Example 3 Compute P (5, 2) and P (5, 3). What is P (5, 5)? In general, we get In particular, P (n, r) = n (n 1) (n 2) (n r + 1) = }{{} r factors P (n, n) = n (n 1) (n 2) 2 1 = n!. n! (n r)!. Example 4 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 5 How many permutations of the letters ABCDEF G contain the string ABC?

6 We now turn our attention to counting unordered selection of objects. Example 6 How many different committees of two students can be formed from a group of four students? Example 7 In how many ways can we choose a chair and a vice chair from a group of four students? How is this example different from the previous one? Definition An r-combination of elements of a set is an unordered selection of r elements from the set. Example 8 Let S = {1, 2, 3, 4, 5}. Then {1, 3, 4} is a 3-combination of S. Definition The number of r-combinations of a set with n elements is denoted by C(n, r), n C r, or ( n r). Example 9 From Example 6, we see that ( 4 2) =. Example 10 Compute ( 5 2). Compute ( 5 3). In general, we have the following theorem. 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 ( ) n n! = r r!(n r)!. Sketch of Proof We explain with ( 5 3). Let S = {1, 2, 3, 4, 5} and consider all 3-permutations of S consisting of {1, 2, 4}. They are: (1, 2, 4), (1, 4, 2), (2, 1, 4), (2, 4, 1), (4, 1, 2), and (4, 2, 1).

7 On the other hand, there is only one 3-combination of S consisting of {1, 2, 4}; just {1, 2, 4}. Hence there are 6 times as many permutations as combinations consisting of {1, 2, 4}. Here 6 comes from the total number of different permutations of {1, 2, 4}, that is, 6 = 3!. Since this is true for all 3-combinations of S, we conclude that ( ) 5 P (5, 3) = 3!. 3 In other words, ( ) 5 = 1 3 3! P (5, 3) = 1 3! 5! (5 2)! = 5! 3!(5 2)!. Example 11 Prove that ( ) ( n r = n n r). Example 12 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 13 Suppose that there are 9 faculty members in the mathematics department and 11 in the computer science department in a college. How many ways are there to select a committee to develop a discrete mathematics course at the school if the committee is to consist of three faculty members from the mathematics department and four from the computer science department?