DISCRETE STRUCTURES COUNTING

Similar documents
Jong C. Park Computer Science Division, KAIST

Discrete Structures Lecture Permutations and Combinations

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

Section Summary. Permutations Combinations Combinatorial Proofs

Topics to be covered

Sec$on Summary. Permutations Combinations Combinatorial Proofs

With Question/Answer Animations. Chapter 6

CS100: DISCRETE STRUCTURES. Lecture 8 Counting - CH6

Introductory Probability

Foundations of Computing Discrete Mathematics Solutions to exercises for week 12

Chapter 2. Permutations and Combinations

Elementary Combinatorics

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

Facilitator Guide. Unit 2

Discrete Mathematics. Spring 2017

Discrete Mathematics with Applications MATH236

Counting. Chapter 6. With Question/Answer Animations

10.2.notebook. February 24, A standard deck of 52 playing cards has 4 suits with 13 different cards in each suit.

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

11.3B Warmup. 1. Expand: 2x. 2. Express the expansion of 2x. using combinations. 3. Simplify: a 2b a 2b

Sec 5.1 The Basics of Counting

Lecture 3 Presentations and more Great Groups

Week 3-4: Permutations and Combinations

CIS 2033 Lecture 6, Spring 2017

Math Fall 2011 Exam 2 Solutions - November 1, 2011

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

Reading 14 : Counting

Permutations and Combinations

Discrete mathematics

CSCI FOUNDATIONS OF COMPUTER SCIENCE

About Permutations and Combinations: Examples

Week 1: Probability models and counting

Combinatorial Proofs

Finite Math - Fall 2016

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

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

Unit on Permutations and Combinations (Counting Techniques)

Probability Theory. Mohamed I. Riffi. Islamic University of Gaza

JIGSAW ACTIVITY, TASK # Make sure your answer in written in the correct order. Highest powers of x should come first, down to the lowest powers.

Lecture 14. What s to come? Probability. A bag contains:

With Question/Answer Animations. Chapter 6

Problems from 9th edition of Probability and Statistical Inference by Hogg, Tanis and Zimmerman:

Permutations and Combinations Section

Counting in Algorithms

CSE 21 Mathematics for Algorithm and System Analysis

Theory of Probability - Brett Bernstein

Lecture 18 - Counting

Unit 5 Radical Functions & Combinatorics

Lecture 1. Permutations and combinations, Pascal s triangle, learning to count

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

I want next to tell you a story about a chain letter.

CS70: Lecture Review. 2. Stars/Bars. 3. Balls in Bins. 4. Addition Rules. 5. Combinatorial Proofs. 6. Inclusion/Exclusion

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

1. Counting. 2. Tree 3. Rules of Counting 4. Sample with/without replacement where order does/doesn t matter.

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

Combinatorics. PIE and Binomial Coefficients. Misha Lavrov. ARML Practice 10/20/2013

n r for the number. (n r)!r!

Combinations AMC AMS AMR ACS ACR ASR MSR MCR MCS CRS

Combinatorics and Intuitive Probability

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

CPCS 222 Discrete Structures I Counting

Principle of Inclusion-Exclusion Notes

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

MA 524 Midterm Solutions October 16, 2018

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

Math 3012 Applied Combinatorics Lecture 2

Problem Set 8 Solutions R Y G R R G

Binary representation 0 (000) 2 1 (001) 2 2 (010) 2 3 (011) 2 4 (100) 2 5 (101) 2 6 (110) 2 7 (111) 2

Intermediate Math Circles November 13, 2013 Counting II

HOMEWORK ASSIGNMENT 5

Math236 Discrete Maths with Applications

Math 42, Discrete Mathematics

6.1 Basics of counting

MATH 351 Fall 2009 Homework 1 Due: Wednesday, September 30

Math 166: Topics in Contemporary Mathematics II

Permutations and Combinations

CISC-102 Fall 2017 Week 8

Counting and Probability Math 2320

Twenty-fourth Annual UNC Math Contest Final Round Solutions Jan 2016 [(3!)!] 4

Permutation group and determinants. (Dated: September 19, 2018)

LAMC Junior Circle February 3, Oleg Gleizer. Warm-up

Mat 344F challenge set #2 Solutions

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!

Combinatorics: The Fine Art of Counting

Coding Theory on the Generalized Towers of Hanoi

Polynomials - Special Products

PERMUTATIONS AND COMBINATIONS

A STUDY OF EULERIAN NUMBERS FOR PERMUTATIONS IN THE ALTERNATING GROUP

Mathematics Competition Practice Session 6. Hagerstown Community College: STEM Club November 20, :00 pm - 1:00 pm STC-170

Counting Snakes, Differentiating the Tangent Function, and Investigating the Bernoulli-Euler Triangle by Harold Reiter

Probability. Engr. Jeffrey T. Dellosa.

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

How can I count arrangements?

Section : Combinations and Permutations

Well, there are 6 possible pairs: AB, AC, AD, BC, BD, and CD. This is the binomial coefficient s job. The answer we want is abbreviated ( 4

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

NON-OVERLAPPING PERMUTATION PATTERNS. To Doron Zeilberger, for his Sixtieth Birthday

Combinatorics: The Fine Art of Counting

Discrete Structures for Computer Science

Transcription:

DISCRETE STRUCTURES COUNTING LECTURE2

The Pigeonhole Principle The generalized pigeonhole principle: If N objects are placed into k boxes, then there is at least one box containing at least N/k of the objects. Example 1: In our 60-student class, at least 12 students will get the same letter grade (A, B, C, D, or F). Fall 2002 CPCS 222 - Discrete Structures 2

The Pigeonhole Principle Example 2: Assume you have a drawer containing a random distribution of a dozen brown socks and a dozen black socks. It is dark, so how many socks do you have to pick to be sure that among them there is a matching pair? There are two types of socks, so if you pick at least 3 socks, there must be either at least two brown socks or at least two black socks. Generalized pigeonhole principle: 3/2 = 2. Fall 2002 CPCS 222 - Discrete Structures 3

Permutations and Combinations How many ways are there to pick a set of 3 people from a group of 6? There are 6 choices for the first person, 5 for the second one, and 4 for the third one, so there are 6 5 4 = 120 ways to do this. This is not the correct result! For example, picking person C, then person A, and then person E leads to the same group as first picking E, then C, and then A. However, these cases are counted separately in the above equation. Fall 2002 CPCS 222 - Discrete Structures 4

Permutations and Combinations So how can we compute how many different subsets of people can be picked (that is, we want to disregard the order of picking)? To find out about this, we need to look at 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. Fall 2002 CPCS 222 - Discrete Structures 5

Permutations and Combinations Example: Let S = {1, 2, 3}. The arrangement 3, 1, 2 is a permutation of S. The arrangement 3, 2 is a 2-permutation of S. The number of r-permutations of a set with n distinct elements is denoted by P(n, r). We can calculate P(n, r) with the product rule: P(n, r) = n (n 1) (n 2) (n r + 1). (n choices for the first element, (n 1) for the second one, (n 2) for the third one ) Fall 2002 CPCS 222 - Discrete Structures 6

Example: Permutations and Combinations P(8, 3) = 8 7 6 = 336 = (8 7 6 5 4 3 2 1)/(5 4 3 2 1) General formula: P(n, r) = n!/(n r)! Knowing this, we can return to our initial question: How many ways are there to pick a set of 3 people from a group of 6 (disregarding the order of picking)? Fall 2002 CPCS 222 - Discrete Structures 7

Permutations and Combinations An r-combination of elements of a set is an unordered selection of r elements from the set. Thus, an r-combination is simply a subset of the set with r elements. Example: Let S = {1, 2, 3, 4}. Then {1, 3, 4} is a 3-combination from S. The number of r-combinations of a set with n distinct elements is denoted by C(n, r). Example: C(4, 2) = 6, since, for example, the 2- combinations of a set {1, 2, 3, 4} are {1, 2}, {1, 3}, {1, 4}, {2, 3}, {2, 4}, {3, 4}. Fall 2002 CPCS 222 - Discrete Structures 8

Permutations and Combinations How can we calculate C(n, r)? Consider that we can obtain the r-permutation of a set in the following way: First, we form all the r-combinations of the set (there are C(n, r) such r-combinations). Then, we generate all possible orderings in each of these r- combinations (there are P(r, r) such orderings in each case). Therefore, we have: P(n, r) = C(n, r) P(r, r) Fall 2002 CPCS 222 - Discrete Structures 9

Permutations and Combinations C(n, r) = P(n, r)/p(r, r) = n!/(n r)!/(r!/(r r)!) = n!/(r!(n r)!) Now we can answer our initial question: How many ways are there to pick a set of 3 people from a group of 6 (disregarding the order of picking)? C(6, 3) = 6!/(3! 3!) = 720/(6 6) = 720/36 = 20 There are 20 different ways, that is, 20 different groups to be picked. Fall 2002 CPCS 222 - Discrete Structures 10

Permutations and Combinations Corollary: Let n and r be nonnegative integers with r n. Then C(n, r) = C(n, n r). Note that picking a group of r people from a group of n people is the same as splitting a group of n people into a group of r people and another group of (n r) people. Please also look at proof on page 323. Fall 2002 CPCS 222 - Discrete Structures 11

Permutations and Combinations Example: A soccer club has 8 female and 7 male members. For today s match, the coach wants to have 6 female and 5 male players on the grass. How many possible configurations are there? C(8, 6) C(7, 5) = 8!/(6! 2!) 7!/(5! 2!) = 28 21 = 588 Fall 2002 CPCS 222 - Discrete Structures 12

We also saw the following: Combinations n! n! C( n, n r) C( n, r) ( n r)![ n ( n r)]! ( n r)! r! This symmetry is intuitively plausible. For example, let us consider a set containing six elements (n = 6). Picking two elements and leaving four is essentially the same as picking four elements and leaving two. In either case, our number of choices is the number of possibilities to divide the set into one set containing two elements and another set containing four elements. Fall 2002 CPCS 222 - Discrete Structures 13

Combinations Pascal s Identity: Let n and k be positive integers with n k. Then C(n + 1, k) = C(n, k 1) + C(n, k). How can this be explained? What is it good for? Fall 2002 CPCS 222 - Discrete Structures 14

Combinations Imagine a set S containing n elements and a set T containing (n + 1) elements, namely all elements in S plus a new element a. Calculating C(n + 1, k) is equivalent to answering the question: How many subsets of T containing k items are there? Case I: The subset contains (k 1) elements of S plus the element a: C(n, k 1) choices. Case II: The subset contains k elements of S and does not contain a: C(n, k) choices. Sum Rule: C(n + 1, k) = C(n, k 1) + C(n, k). Fall 2002 CPCS 222 - Discrete Structures 15

Pascal s Triangle In Pascal s triangle, each number is the sum of the numbers to its upper left and upper right: 1 1 1 1 2 1 1 3 3 1 1 4 6 4 1 Fall 2002 CPCS 222 - Discrete Structures 16

Pascal s Triangle Since we have C(n + 1, k) = C(n, k 1) + C(n, k) and C(0, 0) = 1, we can use Pascal s triangle to simplify the computation of C(n, k): k n C(0, 0) = 1 C(1, 0) = 1 C(1, 1) = 1 C(2, 0) = 1 C(2, 1) = 2 C(2, 2) = 1 C(3, 0) = 1 C(3, 1) = 3 C(3, 2) = 3 C(3, 3) = 1 C(4, 0) = 1 C(4, 1) = 4 C(4, 2) = 6 C(4, 3) = 4 C(4, 4) = 1 Fall 2002 CPCS 222 - Discrete Structures 17

Binomial Coefficients Expressions of the form C(n, k) are also called binomial coefficients. How come? A binomial expression is the sum of two terms, such as (a + b). Now consider (a + b) 2 = (a + b)(a + b). When expanding such expressions, we have to form all possible products of a term in the first factor and a term in the second factor: (a + b) 2 = a a + a b + b a + b b Then we can sum identical terms: (a + b) 2 = a 2 + 2ab + b 2 Fall 2002 CPCS 222 - Discrete Structures 18

Binomial Coefficients For (a + b) 3 = (a + b)(a + b)(a + b) we have (a + b) 3 = aaa + aab + aba + abb + baa + bab + bba + bbb (a + b) 3 = a 3 + 3a 2 b + 3ab 2 + b 3 There is only one term a 3, because there is only one possibility to form it: Choose a from all three factors: C(3, 3) = 1. There is three times the term a 2 b, because there are three possibilities to choose a from two out of the three factors: C(3, 2) = 3. Similarly, there is three times the term ab 2 (C(3, 1) = 3) and once the term b 3 (C(3, 0) = 1). Fall 2002 CPCS 222 - Discrete Structures 19

Binomial Coefficients This leads us to the following formula: ( a b) n n j 0 C( n, j) a n j b j (Binomial Theorem) With the help of Pascal s triangle, this formula can considerably simplify the process of expanding powers of binomial expressions. For example, the fifth row of Pascal s triangle (1 4 6 4 1) helps us to compute (a + b) 4 : (a + b) 4 = a 4 + 4a 3 b + 6a 2 b 2 + 4ab 3 + b 4 Fall 2002 CPCS 222 - Discrete Structures 20