Problem Set 8 Solutions R Y G R R G

Similar documents
Problem Set 8 Solutions R Y G R R G

Lecture 18 - Counting

Chapter 1. Probability

Chapter 1. Probability

Such a description is the basis for a probability model. Here is the basic vocabulary we use.

Solutions to Problem Set 7

Counting integral solutions

It is important that you show your work. The total value of this test is 220 points.

Section Summary. Permutations Combinations Combinatorial Proofs

Elementary Combinatorics

More Probability: Poker Hands and some issues in Counting

Reading 14 : Counting

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

NOTES ON SEPT 13-18, 2012

Jong C. Park Computer Science Division, KAIST

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

FOURTH LECTURE : SEPTEMBER 18, 2014

Discrete Mathematics and Probability Theory Spring 2014 Anant Sahai Note 11

Grade 6, Math Circles 27/28 March, Mathematical Magic

MA 524 Midterm Solutions October 16, 2018

Counting in Algorithms

Grades 7 & 8, Math Circles 27/28 February, 1 March, Mathematical Magic

Topics to be covered

Poker: Probabilities of the Various Hands

Solution: This is sampling without repetition and order matters. Therefore

A Probability Work Sheet

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

Sec$on Summary. Permutations Combinations Combinatorial Proofs

Counting integral solutions

POKER (AN INTRODUCTION TO COUNTING)


Combinatorial Proofs

If you roll a die, what is the probability you get a four OR a five? What is the General Education Statistics

Compound Probability. Set Theory. Basic Definitions

Poker: Probabilities of the Various Hands

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

Probability. The MEnTe Program Math Enrichment through Technology. Title V East Los Angeles College

To Your Hearts Content

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

Distribution of Aces Among Dealt Hands

3 The multiplication rule/miscellaneous counting problems

The probability set-up

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

The probability set-up

8.2 Union, Intersection, and Complement of Events; Odds

ECS 20 (Spring 2013) Phillip Rogaway Lecture 1

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

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

Counting. Chapter 6. With Question/Answer Animations

Honors Precalculus Chapter 9 Summary Basic Combinatorics

CSE 312 Midterm Exam May 7, 2014

Chapter 5: Probability: What are the Chances? Section 5.2 Probability Rules

ABE/ASE Standards Mathematics

LESSON 2: THE INCLUSION-EXCLUSION PRINCIPLE

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

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

CIS 2033 Lecture 6, Spring 2017

CMPSCI 240: Reasoning Under Uncertainty First Midterm Exam

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

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

University of Connecticut Department of Mathematics

Unit Nine Precalculus Practice Test Probability & Statistics. Name: Period: Date: NON-CALCULATOR SECTION

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

Theory of Probability - Brett Bernstein

Probability. Ms. Weinstein Probability & Statistics

5. (1-25 M) How many ways can 4 women and 4 men be seated around a circular table so that no two women are seated next to each other.

Permutations and Combinations

Math 127: Equivalence Relations

Define and Diagram Outcomes (Subsets) of the Sample Space (Universal Set)

3 The multiplication rule/miscellaneous counting problems

12. 6 jokes are minimal.

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.

Discrete mathematics

Review. Natural Numbers: Whole Numbers: Integers: Rational Numbers: Outline Sec Comparing Rational Numbers

4.1 Sample Spaces and Events

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

MAT points Impact on Course Grade: approximately 10%

1 Introduction. 2 An Easy Start. KenKen. Charlotte Teachers Institute, 2015

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

7.1 Experiments, Sample Spaces, and Events

Suppose you are supposed to select and carry out oneof a collection of N tasks, and there are T K different ways to carry out task K.

Math 166: Topics in Contemporary Mathematics II

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

TEST A CHAPTER 11, PROBABILITY

Chapter 5 - Elementary Probability Theory

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

Unit 9: Probability Assignments

You ve seen them played in coffee shops, on planes, and

Lecture 3 Presentations and more Great Groups

MAT 243 Final Exam SOLUTIONS, FORM A

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

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

G R AD E 4 UNIT 3: FRACTIONS - LESSONS 1-3

Introduction to probability

With Question/Answer Animations. Chapter 6

MAT 409 Semester Exam: 80 points

Combinatorics and Intuitive Probability

Sec 5.1 The Basics of Counting

Combinatorics: The Fine Art of Counting

Intermediate Math Circles November 1, 2017 Probability I

Transcription:

6.04/18.06J Mathematics for Computer Science April 5, 005 Srini Devadas and Eric Lehman Problem Set 8 Solutions Due: Monday, April 11 at 9 PM in oom 3-044 Problem 1. An electronic toy displays a 4 4 grid of colored squares. At all times, four are red, four are green, four are blue, and four are yellow. For example, here is one possible configuration: 1 3 4 5 (a How many such configurations are possible? This is equal to the number of sequences containing 4 s, 4 s, 4 s, and 4 s, which is: 16! (4! 4 (b elow the display, there are five buttons numbered 1,, 3, 4, and 5. The player may press a sequence of buttons; however, the same button can not be pressed twice in a row. How many different sequences of n button-presses are possible? There are 5 choices for the first button press and 4 for each subsequence press. Therefore, the number of different sequences of n button presses is 5 4 n 1. (c Each button press scrambles the colored squares in a complicated, but nonrandom way. Prove that there exist two different sequences of 3 button presses that both produce the same configuration, if the puzzle is initially in the state shown above. We use the Pigeonhole Principle. Let A be the set of all sequences of 3 button presses, let be the set of all configurations, and let f : A map each sequence of button presses to the configuration that results. Now: A > 4 3 > 16! >

Problem Set 8 Thus, by the Pigeonhole Principle, f is not injective; that is, there exist distinct elements a 1, a A such taht f(a 1 = f(a. In other words, there are two different sequences of button presses that produce the same configuration. Problem. Suppose you have five 6-sided dice, which are colored red, blue, green, white, and black. A roll is a sequence specifying a value for each die. For example, one roll is: ( 3, 1 red green, 4 blue, 1 white For the problems below, you do not need to simpify your answers, but briefly explain your reasoning., 5 black (a For how many rolls is the value on every die different? Example: (1,, 3, 4, 5 is a roll of this type, but (1, 1,, 3, 4 is not. The number of such rolls is 6 5 4 3 (b For how many rolls do two dice have the same value and the remaining three dice all have different values? Example: (6, 1, 6,, 3 is a roll of this type, but (1, 1,,, 3 and (4, 4, 4, 5, 6 are not. There are ( 5 possible pairs of rolls that might have the same value and 6 possibilities for what this value is. There 5 4 3 possible distinct values for the remaining three rolls. So the number of rolls of this type is ( 5 6 5 4 3 (c For how many rolls do two dice have one value, two different dice have a second value, and the remaining die a third value? Example: (6, 1,, 1, is a roll of this type, but (4, 4, 4, 4, 5 and (5, 5, 5, 6, 6 are not. There are ( ( 6 sets of two values that might be duplicated. There are 5 rolls where larger duplicated value may come up and ( 3 remaining rolls where the smaller duplicated value may come up. There is only 1 remaining roll where the nonduplicated value may then come up, and 4 remaining values it could take. So, the number of rolls of this type is: ( 6 ( 5 ( 3 4 Problem 3. This problem concerns seven card hands dealt from a regular 5-card deck.

Problem Set 8 3 (a How many different hands are possible? There is one hand for each way of choosing 7 cards from a 5-card deck. Therefore, the number of possible hands is: by the Subset ule. ( 5 7 (b How many hands contain three pairs and no three-of-a-kind or four-of-a-kind? There is a bijection with sequences specifying: The values of the pairs, which can be chosen in ( 13 3 The suits of the lowest-value pair, which can be chosen in ( 4 The suits of the middle-value pair, which can be chosen in ( 4 The suits of the highest-value pair, which can be chosen in ( 4 The value of the remaining card, which can be chosen in 10 The suit of the remaining card, which can be chosen in 4 Thus, the number of seven-card poker hands containing three pairs and no three or four-of-a-kind is: ( ( 3 13 4 10 4 3 y the eneralized Product ule. (c How many hands have all cards of the same suit? There is a bijection with sequences specifying: The suit of all the cards, which can be chosen in 4 The values of the cards, which can be chosen in ( 13 7 So the seven cards can be chosen in 4 (13 7 (d How many hands have 5 or more face cards? (The jacks, queens, and kings are the face cards. There is a bijection between hands with exactly k face cards and pairs consisting of: A set of k face cards, which can be chosen in ( 1 k A set of 7 k numbered cards, which can be chosen in ( 40 7 k

4 Problem Set 8 Thus, there are ( 1 k ( 40 hands with 5, 6, or 7 face cards. 7 k hands with exactly k face cards. y the Sum ule, there are ( ( ( ( ( ( 1 40 1 40 1 40 + + 5 6 1 7 0 Problem 4. The lecture notes describe a magic trick in which the audience selects 5 cards from a deck, the Assistant reveals 4 of these cards in some order, and the Magician determines the last card. Now suppose there are two decks of cards, one with blue backs and one with green backs. As before, the audience selects 5 cards. The Assistant reveals 4 of these cards in some order. (The Magician is allowed to look at both sides of these cards. The Magician must determine the suit, value, and back-color of the remaining card. (a Prove that this is possible. (b Extra credit: Describe a practical way to perform this trick. (We have no solution to this problem! Problem 5. Miss Mcillicuddy never goes outside without a collection of pets. In particular: She brings 3, 4, or 5 dogs. She brings a positive number of songbirds, which always come in pairs. She may or may not bring her alligator, Freddy. Let T n denote the number of different collections of n pets that can accompany her. For example, T 6 = since there are possible collections of 6 pets: 3 dogs, songbirds, 1 alligator 4 dogs, songbirds, 0 alligators (a ive a closed-form generating function for the sequence (T 0, T 1, T, T 3,.... T (x = (x 3 + x 4 + x 5 (x + x 4 + x 6 + x 8 +... (1 + x collections of dogs collections of songbirds collections of gators = (x 3 + x 4 + x 5 = x5 + x 6 + x 7 1 x x (1 + x 1 x The second equation follows from the formula for the sum of a geometric series. The last step is a simplification.

Problem Set 8 5 (b From this generating function, find a closed-form expression for T n. (our answer may involve several cases. Therefore, we have: x 5 + x 6 + x 7 1 x = (x 5 + x 6 + x 7 (1 + x + x 3 + x 3 +... = x 5 + x 6 + 3x 7 + 3x 8 + 3x 9 +... 0 0 n 4 1 n = 5 T n = n = 6 3 n 7 Problem 6. In this problem, we ll use generating functions to solve the recurrence: t 0 = 0 t 1 = 1 t n = 5t n 1 6t n (for n (a Find a closed-form generating function F (x for the sequence (t 0, t 1, t,... From the recurrence equation, this is precisely the sequence: (0, 1, 5t 1 6t 0, 5t 6t 1, 5t 3 6t,... We can express this sequence in terms of the generating function F (x: ( 0, 5t 0, 5t 1, 5t, 5t 3,... 5xF (x ( 0, 0, 6t 0, 6t 1, 6t,... 6x F (x + ( 0, 1, 0, 0, 0,... x = ( 0, 5t 0 + 1, 5t 1 6t 0, 5t 6t 1, 5t 3 6t,... F (x The second term is correct; 5t 0 + 1 = 1, since t 0 = 0. So we have the equation: Solving this equation for F (x gives: F (x = 5xF (x 6x F (x + x F (x = x 1 5x + 6x

6 Problem Set 8 (b ewrite this generating function as a sum of fractions of the form: where c and r are constants. c 1 rx Factoring the denominator gives 1 5x + 6x = (1 x(1 3x. So we can rewrite the fraction in the form: x 1 5x + 6x = c 1 x + d 1 3x Substituting x = 0 gives the equation c + d = 0. Substituting x = 1 gives 1/ = c d/ or, equivalently, c + d = 1. Solving this system of linear equations gives c = 1 and d = 1. Therefore, we have: F (x = (c Expand each fraction using the fact: 1 1 x + 1 1 3x 1 1 rx = 1 + rx + r x + r 3 x 3 +... Combine these expansions to obtain a closed-form expression for t n. Thus, t n = 3 n n. F (x = 0 1 x x 3 x 3... + 3 0 + 3 1 x + 3 x + 3 3 x 3 +... = (3 0 0 + (3 1 1 x + (3 x (3 3 3 x 3... Problem 7. elow is a combinatorial proof of an equation. What is the equation? Proof. Stinky Peterson owns n newts, t toads, and s slugs. Conveniently, he lives in a dorm with n + t + s other students. (The students are distinguishable, but creatures of the same variety are not distinguishable. Stinky wants to put one creature in each neighbor s bed. Let W be the set of all ways in which this can be done. On one hand, he could first determine who gets the slugs. Then, he could decide who among his remaining neighbors has earned a toad. Therefore, W is equal to the expression on the left. On the other hand, Stinky could first decide which people deserve newts and slugs and then, from among those, determine who truly merits a newt. This shows that W is equal to the expression on the right. Since both expressions are equal to W, they must be equal to each other.

Problem Set 8 7 (Combinatorial proofs are real proofs. They are not only rigorous, but also convey an intuitive understanding that a purely algebraic argument might not reveal. However, combinatorial proofs are usually less colorful than this one. ( ( ( ( n + t + s n + t n + t + s n + s = s t n + s n Problem 8. Consider the following equation: ( n n 1 ( ( n n = n + 1 k k + 1 k=0 (* (a Describe a set S of binary sequences whose size is given by the expression on the left. Let S be all n-bit sequences with exactly n + 1 ones. (b Describe a way of partitioning S into disjoint subsets T 0,..., T n 1 such that: ( ( n n T k = k k + 1 In particular, state clearly which elements of S are in set T k and explain why T k satisfies this equation. Let T k consist of n-bit sequences with exactly k zeros in the first n positions. Each such sequence has n k ones in the first n positions, and thus k + 1 ones in the last n positions. There are ( ( n k ways to select the first n bits and n k+1 ways to select the last n bits, and so there are ( ( n n k k+1 elements of Tk in all. (c Explain why equation (?? logically follows. Since S is equal to the disjoint union T 0... T n 1, the sum rule implies: S = T 0... T n 1 Substituting the results from the two preceding parts gives equation (??.