This preview shows pages 1–2. Sign up to view the full content.
This preview has intentionally blurred sections. Sign up to view the full version.
View Full Document
Unformatted text preview: CS237. Practice Problems Set 2: More Counting. Assigned problems due Thurs Feb 3, 11:59PM. February 6, 2011 Reading. Schaums Chapter 2.2 2.6. L&L notes on counting. Optional Extra Practice. Any of problems 2.8  2.31 are good for extra practice. 1 Practice problems. Ungraded. Exercise 1. You are given 12 identical eggs. How many ways can you split these eggs between two people? (Note that we dont care exactly which egg each person got, just how many eggs then got.) How about between three people, such that each person gets at least two eggs? (Hint, first find a bijection to bit sequences, and then count the number of possible bit sequences.) Solution : To split the eggs between two people, lets write a bit string containing the eggs: 000000000000 Now lets use 1 to represent the split of eggs, so that e.g. the person on the left gets 2 eggs, and the person on the right gets 10 eggs: 0010000000000 Thus, we can have a bijection from our problem to bit strings, and we need only count the number of 13 bit strings with a single 1. This is ( 13 1 ) = 13 . Now lets split the eggs between three people, so that each person gets at least two eggs. Lets start by giving each of the three people two eggs. That leaves us with six remaining eggs to split between three people. We only have to count the number of ways we distribute the remaining eggs. To do this, well use our bitstring trick again. Thus, the bitstring: 00001100 means the first person gets 4 of the remaining eggs, the second person gets non of the remaining eggs, and the last person gets 2 of the remaining eggs. Our bijection is to a length 8 bitstring with 2 ones, so we have ( 8 2 ) of these. Exercise 2. Four boys (Adam, Bob, Charlie, Dave) and three girls (Lisa, Michelle, Nancy) run a race. How many possible outcomes to the race can have: 1. A boy in the first place, a boy in the second place, and a girl in the third place?...
View
Full
Document
This note was uploaded on 04/14/2011 for the course CS 237 taught by Professor Goldberg during the Spring '11 term at BU.
 Spring '11
 Goldberg

Click to edit the document details