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

Similar documents
Probability. Misha Lavrov. ARML Practice 5/5/2013

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

CIS 2033 Lecture 6, Spring 2017

Multiple Choice Questions for Review

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

Introduction to Counting and Probability

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

2. Nine points are distributed around a circle in such a way that when all ( )

Intermediate Math Circles November 1, 2017 Probability I

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

Combinatorics: The Fine Art of Counting

4.1 Sample Spaces and Events

Week 1: Probability models and counting

Compound Probability. Set Theory. Basic Definitions

MTH 103 H Final Exam. 1. I study and I pass the course is an example of a. (a) conjunction (b) disjunction. (c) conditional (d) connective

Math 1111 Math Exam Study Guide

Topics to be covered

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

CS100: DISCRETE STRUCTURES. Lecture 8 Counting - CH6

Solutions for the Practice Final

3 The multiplication rule/miscellaneous counting problems

DISCRETE STRUCTURES COUNTING

7.1 Experiments, Sample Spaces, and Events

Principle of Inclusion-Exclusion Notes

8.2 Union, Intersection, and Complement of Events; Odds

Theory of Probability - Brett Bernstein

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

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

The topic for the third and final major portion of the course is Probability. We will aim to make sense of statements such as the following:

Discrete mathematics

Counting Things. Tom Davis March 17, 2006

Name. Is the game fair or not? Prove your answer with math. If the game is fair, play it 36 times and record the results.

Counting and Probability Math 2320

Introductory Probability

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

Combinatorics: The Fine Art of Counting

INDIAN STATISTICAL INSTITUTE

Counting Things Solutions

SMT 2014 Advanced Topics Test Solutions February 15, 2014

BMT 2018 Combinatorics Test Solutions March 18, 2018

WEEK 7 REVIEW. Multiplication Principle (6.3) Combinations and Permutations (6.4) Experiments, Sample Spaces and Events (7.1)

CIE 2016 Math Comp Math Fun Answer Key. Name: ID: Grade: 7 Room: Start Time: Finish Time:

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

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

Solutions for Exam I, Math 10120, Fall 2016

Elementary Combinatorics

1. The chance of getting a flush in a 5-card poker hand is about 2 in 1000.

1. For which of the following sets does the mean equal the median?

CS1800: More Counting. Professor Kevin Gold

EECS 203 Spring 2016 Lecture 15 Page 1 of 6

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

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

Chapter 2. Permutations and Combinations

This exam is closed book and closed notes. (You will have access to a copy of the Table of Common Distributions given in the back of the text.

3. Discrete Probability. CSE 312 Spring 2015 W.L. Ruzzo

I.M.O. Winter Training Camp 2008: Invariants and Monovariants

Counting in Algorithms

HOMEWORK ASSIGNMENT 5

Midterm (Sample Version 3, with Solutions)

Probability Rules. 2) The probability, P, of any event ranges from which of the following?

Week 3 Classical Probability, Part I

Math Circle Beginners Group May 22, 2016 Combinatorics

Chapter 5 - Elementary Probability Theory

The Teachers Circle Mar. 20, 2012 HOW TO GAMBLE IF YOU MUST (I ll bet you $5 that if you give me $10, I ll give you $20.)

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

STATISTICAL COUNTING TECHNIQUES

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

Review I. October 14, 2008

University of Connecticut Department of Mathematics

Team Round University of South Carolina Math Contest, 2018

IB HL Mathematics Homework 2014

Advanced Intermediate Algebra Chapter 12 Summary INTRO TO PROBABILITY

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

Analyzing Games: Solutions

Mathematical Foundations HW 5 By 11:59pm, 12 Dec, 2015

Chapter 1. Probability

2018 AMC 10B. Problem 1

Empirical (or statistical) probability) is based on. The empirical probability of an event E is the frequency of event E.

MA 524 Midterm Solutions October 16, 2018

Staircase Rook Polynomials and Cayley s Game of Mousetrap

ATHS FC Math Department Al Ain Remedial worksheet. Lesson 10.4 (Ellipses)

CS 237: Probability in Computing

ACTIVITY 6.7 Selecting and Rearranging Things

Combinatorics and Intuitive Probability

Grade 7/8 Math Circles February 25/26, Probability

Due Friday February 17th before noon in the TA drop box, basement, AP&M. HOMEWORK 3 : HAND IN ONLY QUESTIONS: 2, 4, 8, 11, 13, 15, 21, 24, 27

Section 6.1 #16. Question: What is the probability that a five-card poker hand contains a flush, that is, five cards of the same suit?

There are three types of mathematicians. Those who can count and those who can t.

NAME DATE PERIOD. Study Guide and Intervention

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?

MATHEMATICS 152, FALL 2004 METHODS OF DISCRETE MATHEMATICS Outline #10 (Sets and Probability)

CMath 55 PROFESSOR KENNETH A. RIBET. Final Examination May 11, :30AM 2:30PM, 100 Lewis Hall

UCSD CSE 21, Spring 2014 [Section B00] Mathematics for Algorithm and System Analysis

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

MATH 215 DISCRETE MATHEMATICS INSTRUCTOR: P. WENG

A Probability Work Sheet

Mat 344F challenge set #2 Solutions

With Question/Answer Animations. Chapter 6

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

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

Transcription:

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

Warm-up Po-Shen Loh, 2013. If the letters of the word DOCUMENT are randomly rearranged, what is the probability that all three vowels will be adjacent? (For example, DOEUCMNT counts, but not DOCUEMNT.) Find an eight-letter English word for which the probability that all vowels are adjacent is as small as possible. (Vocabulary challenge: try to minimize this probability over all English words.) Original. A crooked rook is a chess piece I just made up that can only move either one square forward or one square to the right on each move. How many ways are there for a crooked rook to go from the bottom left square of an 8 8 chessboard to the top right square, while avoiding the 2 2 center of the chessboard?

Warm-up Solutions Po-Shen Loh, 2013. A rearrangement of DOCUMENT with adjacent vowels corresponds to a rearrangement of DOCMNT (of which there are 6!) in which we replace the O with a rearrangement of EOU (of which there are 3!). Therefore the probability that all the vowels will be adjacent is 6! 3! 8! = 3! 8 7 = 3 28. If an eight-letter word has k vowels, the probability is (8 k + 1)! k! 8! = 9 (9 k)! k 9! = 9 1 ( 9 k). This is minimized when ( 9 k) is maximized, i.e. for k = 4 or k = 5. For k = 5, try EQUATION ; for k = 4, UNCTUOUS.

Warm-up Solutions Original. We can draw the following table to count the number of ways to get to each square of the chessboard, following the rule that since each square can only be reached from the two squares below or to the left the number in each square is the sum of the two numbers in those squares. 1 8 36 85 155 267 491 982 1 7 28 49 70 112 224 491 1 6 21 21 21 42 112 267 1 5 15 21 70 155 1 4 10 21 49 85 1 3 6 10 15 21 28 36 1 2 3 4 5 6 7 8 1 1 1 1 1 1 1 1 This gives a final answer of 982. (Maybe I should propose this problem to the AIME people?)

The Principle of Inclusion-Exclusion Seeing any of your events We saw last time that if A and B are two events, Pr[A or B] = Pr[A] + Pr[B] Pr[A and B]. (e.g. rolling two dice, Pr[at least one 6] = 1 6 + 1 6 1 36 = 11 36.)

The Principle of Inclusion-Exclusion Seeing any of your events We saw last time that if A and B are two events, Pr[A or B] = Pr[A] + Pr[B] Pr[A and B]. (e.g. rolling two dice, Pr[at least one 6] = 1 6 + 1 6 1 36 = 11 36.) More generally, if we have a whole bunch of events, to find the probability any of them happen: 1. Add the probability of each happening. 2. Subtract the probabilities for each pair. 3. Add the probabilities of each triple. 4. And so on, alternating adding and subtracting. (e.g. for 3 dice, we get ( 1 6 + 1 6 + 1 6 ) ( 1 36 + 1 36 + 1 36 ) + 1 216.)

The Principle of Inclusion-Exclusion Avoiding all of your events Here s another incarnation of this. Suppose we want to find the probability none of A, B,..., Z occur. Then: 1. Start with 1 Pr[A] Pr[B] Pr[Z]. 2. Add back pairs: + Pr[A and B] + + Pr[Y and Z]. 3. Subtract off triples, and so on...

The Principle of Inclusion-Exclusion Avoiding all of your events Here s another incarnation of this. Suppose we want to find the probability none of A, B,..., Z occur. Then: 1. Start with 1 Pr[A] Pr[B] Pr[Z]. 2. Add back pairs: + Pr[A and B] + + Pr[Y and Z]. 3. Subtract off triples, and so on... Don t do this if A, B,..., Z are independent! In that case, it s easier to multiply together (1 Pr[A])(1 Pr[B])(1 Pr[C])( )(1 Pr[Z]). This can be a shortcut for the dice example. The probability we don t get 6 on any of 4 dice is ( 1 1 4 6) = 625 1296, so the probability of seeing at least one 6 is 1 625 1296 = 671 1296.

The Principle of Inclusion-Exclusion The counting version This works for counting as well. Say we want to count some things that don t satisfy any of several bad conditions B 1, B 2, B 3,.... 1. First, count all of the things you have, ignoring bad conditions. 2. Subtract the number of things with each bad condition. 3. Add back the number of things with each pair of two bad conditions. 4. As always, alternate signs and repeat.

The Principle of Inclusion-Exclusion The counting version This works for counting as well. Say we want to count some things that don t satisfy any of several bad conditions B 1, B 2, B 3,.... 1. First, count all of the things you have, ignoring bad conditions. 2. Subtract the number of things with each bad condition. 3. Add back the number of things with each pair of two bad conditions. 4. As always, alternate signs and repeat. For example, the number of four-digit numbers without adjacent 1 s is: 9000 (100 + 90 + 90) + (10 + 9 + 1) 1 = 8719. (Our bad conditions are 11xx, x11x, and xx11.)

Principle of Inclusion-Exclusion Competition problems Original. If a random divisor of 10 10 is chosen, what is the probability that it divides at least one of 1000, 1250, or 1280? AIME, 2002. Count the number of sets {A, B}, where A and B are nonempty subsets of {1, 2, 3,..., 10} with no elements in common. Po-Shen Loh, 2013. Three couples (Amy and Bob, Chad and Dana, and Emma and Fred) want to sit in a row with no couple getting adjacent seats. Find the number of ways to do this. Folklore. Many people simultaneously take off their hats and toss them into the air. Each catches a hat, resulting in a uniformly random permutation of hats. Prove that the probability nobody has their own hat is about 1 e 0.37.

Competition problems Solutions To figure out all the probabilities, we need two insights: 1. A random divisor x = 2 a 5 b divides 1000 = 2 3 5 3 if a 3 and b 3, which has probability 4 11 4 11 = 16 121. 2. Asking that x divides 1000 and 1280 is the same as asking that it divide gcd(1000, 1280) = 40. Skipping the intermediate calculations, we get ( 16 121 + 10 121 + 18 ) ( 8 121 121 + 8 121 + 4 ) + 4 121 121 = 28 121.

Competition problems Solutions AIME, 2002. To choose A and B, we divide {1,..., 10} into three classes: in A, in B, or not in either. There are 3 10 ways to do this, but 2 10 make A empty, and 2 10 make B empty, while 1 makes both empty. So there are 3 10 2 2 10 + 1 ways to choose (A, B). In {A, B}, order doesn t matter, so we divide by 2 and get 28501. Po-Shen Loh, 2013. There are 720 ways to seat the couples; but for each couple, there are 2 5! = 240 ways to seat them next to each other; for two couples, there are 2 2 4! = 96 ways to seat both next to each other; and finally, there are 2 3 3! = 48 ways to seat all three couples next to each other. So altogether we get 720 3 240 + 3 96 48 = 240 ways.

Competition problems Solutions Folklore. Let n be the number of people present. The k-wise intersections of events we want to avoid are situations where k people get their own hats. For any of ( n k) groups of k people, there are (n k)! ways to choose the remaining hats, so the probability is (n k)! n!. Multiplying ( ) n k by (n k)! n! gives 1 k!, so this is what the k-th term of the inclusion-exclusion sum looks like. So the probability we want is 1 1 1! + 1 2! 1 3! + ± 1 k! ± ± 1 n!. This is the first n terms of the sum ( 1) k k=0 k!, which is known to converge to 1 e (in general, ex = ; here, x = 1). k=0 xk k!

Binomial coefficients If we have n distinct objects, the number of ways to choose a set of k of them is ( ) n k = n!, pronounced n choose k. k!(n k)! Key facts: 1. (x + y) n = x n + ( ) n 1 x n 1 y + + ( n k) x n k y k + + y n. 2. ( ) ( n k = n 1 ) ( k 1 + n 1 ) k. 3. ( ) n 2 = n(n 1) 2 is particularly useful. It s the number of ways to choose pairs of objects. Also, 1 + 2 + + n = ( ) n+1 2. 4. ( n k) 2 n is the probability that when n fair coins are flipped, k of them come up heads. 5. A bar graph of the numbers ( n 0), ( n 1),..., ( n n) forms a bell curve in which the middle numbers take up most of the bulk.

The crooked rook problem We can solve the crooked rook problem using binomial coefficients. We will denote the bottom left corner of the board by (1, 1), and the top right corner by (8, 8); the two allowed steps are (+1, +0) and (+0, +1), and the center 2 2 square consists of the points {(4, 4), (4, 5), (5, 4), (5, 5)}. In total, there are ( 14 7 ) ways to get from (1, 1) to (8, 8): it takes 14 steps to do so, and any 7 of them can be (+1, +0) steps while the remainder are (+0, +1). Paths through the center 2 2 square must visit either (4, 5) or (5, 4), but not both. There are ( 7 3) ways to get from (1, 1) to (4, 5), and ( ( 7 3) ways to get from (4, 5) to (8, 8), so 7 2 3) of the paths go through (4, 5) and must be discarded. Discarding paths through (5, 4) similarly, we get a final answer of ( ) ( 14 7 2 7 2 3) = 982.

Pirates and Gold Suppose k pirates what to split up n identical pieces of gold, not necessarily fairly, but each pirate gets at least one gold piece. How many ways are there to hand out the gold?

Pirates and Gold Suppose k pirates what to split up n identical pieces of gold, not necessarily fairly, but each pirate gets at least one gold piece. How many ways are there to hand out the gold? We can imagine the pirates going up to the pile of gold in order, and taking pieces of gold one at a time; at any point, you can say STOP! and then the pirate stops taking gold and gives the next pirate his turn.

Pirates and Gold Suppose k pirates what to split up n identical pieces of gold, not necessarily fairly, but each pirate gets at least one gold piece. How many ways are there to hand out the gold? We can imagine the pirates going up to the pile of gold in order, and taking pieces of gold one at a time; at any point, you can say STOP! and then the pirate stops taking gold and gives the next pirate his turn. There are n 1 gaps between the taking-a-piece-of-gold actions; in any k 1 of them, you may say STOP! So there are ( ) n 1 k 1 ways to hand out the gold.

Pirates and Gold Suppose k pirates what to split up n identical pieces of gold, not necessarily fairly, but each pirate gets at least one gold piece. How many ways are there to hand out the gold? We can imagine the pirates going up to the pile of gold in order, and taking pieces of gold one at a time; at any point, you can say STOP! and then the pirate stops taking gold and gives the next pirate his turn. There are n 1 gaps between the taking-a-piece-of-gold actions; in any k 1 of them, you may say STOP! So there are ( ) n 1 k 1 ways to hand out the gold. In a common variant, you allow distributions where some pirates get no gold at all. This is equivalent to splitting n + k pieces of gold so that all pirates get at least one piece, and then taking a piece of gold from each. So it can be done in ( ) n+k 1 k 1 ways.

Binomial coefficients Competition problems Original. Find the number of zeroes at the end of ( 200 100). Lovász et. al., Discrete Math. In how many ways can you distribute n pennies to k children if each child must get at least 5? Po-Shen Loh, 2013. Call a sequence of letters increasing if the letters in it appear in alphabetical order (e.g. BOOST or AEGIS ). How many increasing sequences of 52 letters are there? Folklore. Prove that the central binomial coefficient ( n n/2 ) is between 2n n+1 and 2n 2. (A good estimate, surprisingly, is πn 2n.)

Competition problems Solutions Original. To find the number of zeroes at the end of 100!, we count powers of 5: there are 20 numbers between 1 and 100 divisible by 5, and 4 of them are divisible by 25, so we get 24. (There are lots more powers of 2, so we don t worry about those.) Similarly, there are 49 zeroes at the end of 200!. So the answer is 49 24 24 = 1. Lovász et. al. We can begin by giving 4 pennies to each child; then the number of ways to distribute the remaining n 4k pennies so that each child gets at least one more is ( ) n 4k 1 k 1.

Competition problems Solutions Po-Shen Loh, 2013. The increasing sequence is determined uniquely by the letters it contains. To pick letters, we split the 52 slots between the 26 letters in the alphabet, which can be done in ( ) ( 52+26 1 26 1 = 77 25) ways. Folklore. Consider the sum ( ) ( ) n n + + + 0 1 ( ) n + + n/2 ( ) n = 2 n. n There are n + 1 terms. Each is positive, so each must be less than 2 n. On the other hand, ( n n/2 ) is the largest term; so it must be at least the average of all the terms, which is 2 n n+1.