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

Similar documents
CS100: DISCRETE STRUCTURES. Lecture 8 Counting - CH6

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

Sec 5.1 The Basics of Counting

Topics to be covered

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

Counting. Chapter 6. With Question/Answer Animations

With Question/Answer Animations. Chapter 6

6.1 Basics of counting

Discrete Structures Lecture Permutations and Combinations

CPCS 222 Discrete Structures I Counting

DISCRETE STRUCTURES COUNTING

Section Summary. Permutations Combinations Combinatorial Proofs

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

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

With Question/Answer Animations. Chapter 6

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

Discrete Structures for Computer Science

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}?

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

Foundations of Computing Discrete Mathematics Solutions to exercises for week 12

Permutations and Combinations

Sec$on Summary. Permutations Combinations Combinatorial Proofs

Chapter 7. Intro to Counting

Permutations and Combinations

Elementary Combinatorics

Week 6: Advance applications of the PIE. 17 and 19 of October, 2018

Review I. October 14, 2008

Reading 14 : Counting

Discrete Mathematics. Spring 2017

COUNTING AND PROBABILITY

Chapter 2. Permutations and Combinations

CSCI FOUNDATIONS OF COMPUTER SCIENCE

aabb abab abba baab baba bbaa permutations of these. But, there is a lot of duplicity in this list, each distinct word (such as 6! 3!2!1!

CSE 312: Foundations of Computing II Quiz Section #2: Combinations, Counting Tricks (solutions)

MATH 215 DISCRETE MATHEMATICS INSTRUCTOR: P. WENG

Probability and Counting Techniques

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

Simple Counting Problems

Week 3-4: Permutations and Combinations

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

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

Discrete mathematics

Section : Combinations and Permutations

Jong C. Park Computer Science Division, KAIST

Week 1: Probability models and counting

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

Sec. 4.2: Introducing Permutations and Factorial notation

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

CISC 1400 Discrete Structures

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

Algebra II- Chapter 12- Test Review

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

Math 3012 Applied Combinatorics Lecture 2

The next several lectures will be concerned with probability theory. We will aim to make sense of statements such as the following:

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

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

Introductory Probability

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

The Pigeonhole Principle

CHAPTER 8 Additional Probability Topics

MAT3707. Tutorial letter 202/1/2017 DISCRETE MATHEMATICS: COMBINATORICS. Semester 1. Department of Mathematical Sciences MAT3707/202/1/2017

Section 6.4 Permutations and Combinations: Part 1

CSE 312: Foundations of Computing II Quiz Section #2: Inclusion-Exclusion, Pigeonhole, Introduction to Probability (solutions)

Math Steven Noble. November 22nd. Steven Noble Math 3790

Duke Math Meet Individual Round

10-1. Combinations. Vocabulary. Lesson. Mental Math. able to compute the number of subsets of size r.

Permutations and Combinations. Quantitative Aptitude & Business Statistics

Counting Subsets with Repetitions. ICS 6C Sandy Irani

Combinatorial Proofs

Multiple Choice Questions for Review

MULTIPLE CHOICE. Choose the one alternative that best completes the statement or answers the question.

Finite Math - Fall 2016

(1). We have n different elements, and we would like to arrange r of these elements with no repetition, where 1 r n.

CS1800: More Counting. Professor Kevin Gold

Math236 Discrete Maths with Applications

Permutation and Combination

Combinational Mathematics - I

Counting (Enumerative Combinatorics) X. Zhang, Fordham Univ.

LEVEL I. 3. In how many ways 4 identical white balls and 6 identical black balls be arranged in a row so that no two white balls are together?

Permutations and Combinations Section

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

Formula 1: Example: Total: Example: (75 ) (76) N (N +1) = (20 ) (21 ) =1050

CS 237: Probability in Computing

Counting and Probability Math 2320

Combinational Mathematics Part 1

6.4 Permutations and Combinations

Counting in Algorithms

About Permutations and Combinations: Examples

Counting Methods and Probability

Finite Math Section 6_4 Solutions and Hints

Math 42, Discrete Mathematics

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

Math 1111 Math Exam Study Guide

Chapter 2 Math

Math Fall 2011 Exam 2 Solutions - November 1, 2011

Slide 1 Math 1520, Lecture 15

Permutations. Example 1. Lecture Notes #2 June 28, Will Monroe CS 109 Combinatorics

5.3 Problem Solving With Combinations

Combinatorics and Intuitive Probability

EECS 203 Spring 2016 Lecture 15 Page 1 of 6

Transcription:

Discrete Mathematics: Logic Discrete Mathematics: Lecture 15: Counting

counting combinatorics: the study of the number of ways to put things together into various combinations basic counting principles product rule sum rule subtraction rule(inclusion-exclusion) division rule pigeonhole principle permutation combination

basic counting principles: product rule If there are n1 ways to do the first task and there are n2 ways to do the second task, then there are n1n2 ways to do the procedure of the first task and the second task in order a company with two employees, A and B, rents a floor of a building with 12 offices. How many ways are there to assign different offices to these two employees? 12 x 11 = 132

basic counting principles: product rule How many different bit strings of length seven are there? 2 7 = 128 How many functions are there from a set with m elements to a set with n elements? n x n x n x... n = n m How many one-to-one functions from a set with m elements to a set with n elements? n x (n-1) x (n-2) x (n-m+1)

basic counting principles: sum rule if a task can be done either in one of n1 ways or 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 to do the task 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? 23 + 15 + 19 = 57

basic counting principles: sum rule 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? P = P6 + P7 + P8 P6 = (26+10) 6-26 6 P7 = 36 7-26 7 P8 = 36 8-26 8

basic counting principles: subtraction rule (inclusion-exclusion) if a task can be done either in n1 ways or n2 ways, then the number of ways to do the task is n1 + n2 - (the number of ways to do the task that are common to the two different ways). How many bit string of length eight start with a 1 bit or end with the two bits 00? a bit string that begins with 1: 2 7 = 128 a bit string that ends with 00: 2 6 = 64 a bit string that begins with 1 and ends with 00: 2 5 = 32 128 + 64-32 = 160

basic counting principles: division rule there are n/d ways to do a task if it can be done using a procedure that can be carried out in n ways, and for every way w, exactly d of the n ways correspond to way w How many different ways are there to seat four people around a circular table, where two seatings are considered the same when each person has the same left neighbor and the same right neighbor? (4 3 2 1) / 4 = 6

pigeonhole principle if k+1 or more objects are placed into k boxes, then there is at least one box containing two or more of the objects assigning 13 pigeons in 12 pigeonholes

pigeonhole principle 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 alphabet 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? 101 possible scores among 102 students, there must be at least 2 students with the same score

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 by contradiction suppose that none of the boxes contains more than N/k -1 objects. k( N/k - 1) < k((n/k + 1) - 1) = N This is a contradiction because there are a total of N objects

generalized pigeonhole principle 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? N/5 = 6 (N - 1) / 5 = 5 N = 5 5 + 1 = 26 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 from the area code, N represents a digit from 2 to 9 inclusive, and X represents any digit 25,000,000/(8 1,000,000) = 4 4 area codes are required

generalized pigeonhole principle 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 aj: the number of games played on or before the jth day of the month 1 aj 45, 15 aj + 14 59 60 positive integers a1, a2,... a30, a1+14, a2+14,.. a30+14 59 two of these integers are equal. ai = aj + 14

permutations a permutation of a set of distinct objects is an ordered arrangement of these objects If n is a positive integer and r is an integer with 1 r n, then there are P(n, r) = n (n - 1) (n - 2)... (n - (r - 1)) = n! / (n-r)! r-permutations of a set with n distinct elements S = {a, b, c} 2-permutation of S: a,b; a,c; b,a; b,c; c,a; c,b P(3, 2) = 3 2 = 6

permutations 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? P(100, 3) = 100 99 98 = 970,200 How many permutations of the letters ABCDEFGH contain the string ABC? ABC, D, E, F, G, H 6!

combinations a combination is finding the number of subsets of a particular size of a set with n elements. 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, C(n, r) = P(n, r) / P(r, r) = n! / (r! (n-r)!) = C(n, n-r) S = {a, b, c, d} 2-combination of S: {a, b}, {a, c}, {a, d}, {b, c}, {b, d}, {c, d} C(4, 2) = 4!/(2!2!) = 6

combinations 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? C(10, 5) = 10! / (5! 5!) = 252 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 3 faculty members from the mathematics and 4 from the computer science? C(9, 3) C(11, 4) = (9! / (3!6!)) (11! / (4!7!)) = 84 330 = 27,720

show that in any set of six classes, each meeting regularly once a week on a particular day of the week, there must be two that meet on the same day?

A drawer contains 12 brown socks and 12 black socks. A boy takes socks out at random. a) How many socks must he take out to be sure that he has at least two socks of the same color? b) How many socks must he take out to be sure that he has at least two black socks?

permutations vs. combination A horse race will include 10 horses. You are given 2 betting options. You can chose the top three horses regardless of finishing order or you can chose the top three horses in exact order of finish. How many possibilities are there for each outcome? Top 3 in any order: C(10,3) = 120 Top 3 in exact order: P(10,3) = 720 n! r!(n r)! n! (n r)!

permutations with repetition How many strings of length r can be formed from the uppercase letters of the English alphabet? 26 r n r

combinations with repetition Pick 3 pieces of a fruit from 2 boxes with apples and oranges. How many possible cases do we have?

combinations with repetition How many ways are there to select 5 bills from a cash box containing $1 bills, $2 bills, $5 bills, $10 bills, $20 bills, $50 bills, and $100 bills? Assume that the order of the bills chosen does not matter and that there are at least 5 bills of each type. C(7-1+5, 5) C(n-1+r, r) = C(n-1+r, n-1)

combinations with repetition How many solutions does the equation x1 + x2 + x3 = 11 have, where x1, x2, and x3 are nonnegative integers? C(3-1+11, 11) = 78 How many solutions does the equation x1 + x2 + x3 = 11 have, where x1 1, x2 2, and x3 3 are nonnegative integers? C(3-1+5, 5) = C(7, 5) = 21

combination and permutation with or without repetition type repetition formula r-permutation P(n,r) r-combination C(n, r) no no n! (n r)! n! r!(n r)! r-permutation yes n r r-combination yes (n + r 1)! r!(n 1)!

permutations with indistinguishable objects The number of different permutations of n objects, where there are n1 indistinguishable objects of type1, n2 indistinguishable objects of type2,... and nk indistinguishable objects of type k is n! n 1!n 2!...n k! How many different strings can be made by reordering the letters of the word SUCCESS? 7! 3!2!

distributing objects into boxes distinguishable objects into distinguishable boxes n! n 1!n 2!...n k! how many ways are there to distribute 5 cards to 4 players from the different 52 cards? C(52, 5) C(47, 5) C(42, 5) C(37,5) = 52! 5!5!5!5!32!

distributing objects into boxes indistinguishable objects r into distinguishable boxes n C(n - 1 + r, n - 1) How many ways are there to place 10 indistinguishable balls into 8 different bins? C(8-1 + 10, 8) = 19448

distributing objects into boxes distinguishable objects into indistinguishable boxes How many ways are there to put 4 different employees into 3 indistinguishable offices when each office can contain any number of employees? S(n, j): the number of ways to distribute n distinguishable objects into j indistinguishable boxes S(4,1): 1 S(4,2): C(4, 1) + C(4, 2)/2 = 4 + 3 = 7 S(4,3): C(4, 2) = 6

distributing objects into boxes indistinguishable objects into indistinguishable boxes How many ways are there to pack 6 copies of the same book into 4 identical boxes, where a box can contain as many as six books? 6 5, 1 4, 2 4, 1, 1 3, 3 3, 2, 1 3, 1, 1, 1 2, 2, 2 2, 2, 1, 1

How many ways can 13 books be placed on 3 distinguishable shelves a) if the books are indistinguishable copies of the same title? b) if no two books are the same, and the positions of the books on the shelves matter?