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

Similar documents
Sec 5.1 The Basics of Counting

With Question/Answer Animations. Chapter 6

6.1 Basics of counting

Topics to be covered

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

Section Summary. Permutations Combinations Combinatorial Proofs

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

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

Sec$on Summary. Permutations Combinations Combinatorial Proofs

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

CS100: DISCRETE STRUCTURES. Lecture 8 Counting - CH6

Discrete Mathematics. Spring 2017

Counting. Chapter 6. With Question/Answer Animations

The Pigeonhole Principle

DISCRETE STRUCTURES COUNTING

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

Jong C. Park Computer Science Division, KAIST

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

Counting in Algorithms

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

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

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

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

Foundations of Computing Discrete Mathematics Solutions to exercises for week 12

12. 6 jokes are minimal.

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

With Question/Answer Animations. Chapter 6

Discrete Structures Lecture Permutations and Combinations

Theory of Probability - Brett Bernstein

Non-overlapping permutation patterns

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

Combinatorics in the group of parity alternating permutations

MC215: MATHEMATICAL REASONING AND DISCRETE STRUCTURES

Sets. Definition A set is an unordered collection of objects called elements or members of the set.

HOMEWORK ASSIGNMENT 5

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

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

CPCS 222 Discrete Structures I Counting

Mathematical Foundations of Computer Science Lecture Outline August 30, 2018

CSCI FOUNDATIONS OF COMPUTER SCIENCE

Problem Set 8 Solutions R Y G R R G

8.2 Union, Intersection, and Complement of Events; Odds

Week 1. 1 What Is Combinatorics?

Math236 Discrete Maths with Applications

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

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

On uniquely k-determined permutations

7.4 Permutations and Combinations

1 Permutations. 1.1 Example 1. Lisa Yan CS 109 Combinatorics. Lecture Notes #2 June 27, 2018

CSE101: Design and Analysis of Algorithms. Ragesh Jaiswal, CSE, UCSD

Math 42, Discrete Mathematics

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

CSCI 2200 Foundations of Computer Science (FoCS) Solutions for Homework 7

LESSON 2: THE INCLUSION-EXCLUSION PRINCIPLE

Week 3-4: Permutations and Combinations

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

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

ON SPLITTING UP PILES OF STONES

Lecture 18 - Counting

Staircase Rook Polynomials and Cayley s Game of Mousetrap

Solutions to Problem Set 7

Game Theory and Algorithms Lecture 19: Nim & Impartial Combinatorial Games

CSE 20 DISCRETE MATH. Fall

Algorithms. Abstract. We describe a simple construction of a family of permutations with a certain pseudo-random

Cardinality revisited

MATH 215 DISCRETE MATHEMATICS INSTRUCTOR: P. WENG

1111: Linear Algebra I

MA 524 Midterm Solutions October 16, 2018

LECTURE 3: CONGRUENCES. 1. Basic properties of congruences We begin by introducing some definitions and elementary properties.

IMOK Maclaurin Paper 2014

Permutation Tableaux and the Dashed Permutation Pattern 32 1

Chapter 1. Probability

Mat 344F challenge set #2 Solutions

Alternating Permutations

Counting and Probability Math 2320

On Range of Skill. Thomas Dueholm Hansen and Peter Bro Miltersen and Troels Bjerre Sørensen Department of Computer Science University of Aarhus

Honors Precalculus Chapter 9 Summary Basic Combinatorics

18.204: CHIP FIRING GAMES

Principle of Inclusion-Exclusion Notes

Three Pile Nim with Move Blocking. Arthur Holshouser. Harold Reiter.

1.6 Congruence Modulo m

More Great Ideas in Theoretical Computer Science. Lecture 1: Sorting Pancakes

European Journal of Combinatorics. Staircase rook polynomials and Cayley s game of Mousetrap

Elementary Combinatorics

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

Reading 14 : Counting

PRIMES STEP Plays Games

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

Math 127: Equivalence Relations

N-Queens Problem. Latin Squares Duncan Prince, Tamara Gomez February

DVA325 Formal Languages, Automata and Models of Computation (FABER)

Problem A. Vera and Outfits

Discrete Mathematics and Probability Theory Spring 2014 Anant Sahai Note 11

Fast Sorting and Pattern-Avoiding Permutations

COUNTING AND PROBABILITY

"È$ß#È"ß$È#ß%È% This same mapping could also be represented in the form

CSE101: Algorithm Design and Analysis. Ragesh Jaiswal, CSE, UCSD

Harmonic numbers, Catalan s triangle and mesh patterns

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

Permutation Editing and Matching via Embeddings

Transcription:

Chapter 5. Counting 5.1 The Basic of Counting What is counting? (how many ways of doing things) combinations: how many possible ways to choose 4 people from 10? how many license plates that start with letter A or end digit 0? 1

basic counting principles: The production rule: if a procedure can be broken into a sequence of two tasks, then there are n 1 n 2 ways to do the procedure if there are n 1 ways for doing first task and n 2 ways of doing the second. examples: how many possible vehicle license tags if they are allowed to have 3 letters and 4 digits? how many 1-1 functions between two sets? pages 336-338 A 1 A 2 = A 1 A 2 A 1 A 2... A m = A 1 A 2... A m 2

The sum rule: If a task can be thought of as either of two takes that do not overlap, then there are n 1 + n 2 ways of accomplishing the original task, where n 1 and n 2 are the numbers of ways to finish the two tasks respectively. examples: pages 338-339 A 1 A 2 = A 1 + A 2 A 1 A 2... A m = A 1 + A 2 +... + A m note: A i A j = φ is required. 3

More complex counting problems: examples pages 340-341 The inclusion-exclusion principle examples: (1) number of binary strings of length 8 that begin with 1 and ends with 00 s (2) number of binary strings of length 8 that begin with 1 or ends with 00 s A 1 A 2 = A 1 + A 2 A 1 A 2 The tree diagram examples (pages 343-344) 4

5.2 Pigeonhole Principle Theorem 1 (Pigeonhole Principle) If k + 1 or more objects are placed into k boxes, then there is at least one box containing two or more objects. Corollary 1 A function f from a set with k +1 elements to a set with k elements is not 1-1. examples (page 348) Theorem 2 (Generalized Pigeonhole Principle) If N objects are placed into k boxes, then there is at least one box containing at least N/k objects. examples (pages 349-350) 5

Elegant applicants of the Pigeonhole principles pages 351-352. Example 11: Among any n + 1 positive integers not exceeding 2n, there must be an integer that divides one of the other integers. Proof 1: The set of numbers not exceeding 2n is {1, 2, 3, 4,..., 2n} = {1, 3,..., 2n 1} {2, 4,..., 2n} A rigorous argument: Assume these n + 1 numbers to be a 1, a 2,..., a n+1. a i can be written as 2 k i q i for some odd number q i. So in q 1, q 2,... q n+1, there must be two numbers q j and q k are the same because there are only n odd numbers. So a j can divide a k or the other way. 6

Theorem 3 Every sequence of n 2 + 1 distinct real numbers contains a subsequence of length n+1 that is either strictly increasing or strictly decreasing. Example: 8, 11, 9, 1, 4, 6, 12, 10, 5, 7 10 = 3 2 + 1, here n = 3. increasing subsequence: 1, 4, 6, 10 of length 3 + 1 = 4. The idea of a proof: associate each number a k in the sequence with a pair (i k, d k ), where i k is the length of a longest increasing subsequence beginning from a k and d k is the length of the longest decreasing subsequence beginning from a k 8, 11, 9, 1, 4, 6, 12, 10, 5, 7 (3,3) (2,4) (2,3) (4,1) (3,1) (2,2) (1,3) (1,2) (2,1) (1,1) Assume that theorem is incorrect, then i k n and d k n and the total number of such pairs is at most n 2. So two of such pairs must be the same. Let these two pairs be (i s, d s ) and (i t, d t ) and i s = i t and d s = d t. Suppose a s < a t, then we can build length i s + 1 increasing subsequence starting at a s. This is a contradiction. The same argument applied to the case a s > a t. 7

Ramsey theory: In a group of 6 people, either there are three mutually know each other, or three mutual strangers to each other. Proof: Fixing a person A. Then for the rest 5 people, there can be grouped according to whether knowing A or not. So there must be 5/2 = 3 people such that every one of the three knows A or none of the 3 knows A. In the former case, assume they are B, C, D. If any two of B, C, D, say B, C, know each other, then A, B, C know each other. If no two in B, C, D know each other, then B, C, D are strangers to each other. A similar argument can be made to the latter case that none of B, C, D knows A. 8

5.3 Permutations and Combinations permutation: an ordered arrangement of a set of objects. The number of permutations of n objects is n! how to get this? r-permutation of n element: an arrangement of r objects, denoted by P (n, r) Theorem 1 P (n, r) = n (n 1)... (n r + 1) P (n, r) = n! (n r)! Examples (pages 356-357) 9

r-combination: an unordered selection of r objects. Theorem 2 The number of r-combinations of n objects Proof: C(n, r) = P (n, r) = C(n, r)p (r, r). So n! r!(n r)! C(n, r) = P (n, r)/p (r, r) = P (n.r)/(r!) = n! (n r)! /(r!) = n! r!(n r)! Corollary 2 C(n, r) = C(n, n r). Examples (pages 358-360). Definition: A combinatorial proof of an identity is a proof that uses counting argument to prove the both sides of the identity count the same objects but in different ways. 10