Professional Documents
Culture Documents
Assignment 2
Question 1
Write your name and student number on the top of the assignment
Question 2
In Lecture 6 we proved that any subset of {1, … , 2n} of size at least n + 1 contains a
divisible pair; a pair distinct values x and y such that x/y is an integer.
1. Using the same approach, prove that any subset of S⊆ {1, … , 3n} of size at least
2n + 1 contains a pair of distinct values a and b such that a/b is a power of 3; i.e.,
a/b = 3k for some positive integer k.
Answer 1
1
:
Suppose that we want to place disks of radius 1 so that
1. (Use something similar to the Pigeonhole Principle to) prove that it is impossible to place
more than (r + 1)2 disks in this way. (Hint: a disk of radius x has area πx2 .)
2
2. Explain, in words, why it is impossible to place more than (r + 1) − 1 disks this way.
Answer 3.1
Let D be a set of k disks that satisfy the conditions of the question. We need to show that
k ≤ (r + 1)2 . The area of each disk in D is π and, since they are disjoint, the area A of
their union is kπ . On the other hand, since all these disks have centers inside a disk of radius r ,
they are all contained in a disk B of radius r + 1 . The disk of radius r + 1 has area
π(r + 1)2 . Therefore, kπ ≤ π(r + 1)2 , so k ≤ (r + 1)2 .
Answer 3.2
Question 4
:
This question involves a (fairly simple) recurrence equation. You probably want to watch the
beginning of Lecture 7 before attempting it.
We have two parallel shelves that can each hold n + 1 beer bottles. Each beer bottle is red,
green, or blue and we have infinitely many bottles of each colour. Someone has already glued a
red bottle to the leftmost location on the top shelf and a green bottle to the leftmost location on
the bottom shelf, so we still have to place n bottles on each shelf. We want to do this so that:
If two bottles are adjacent on one of the shelves then they should have different colours. (For
example, we should never have a red bottle immediately to the right of another red bottle).
If one bottle is placed directly above another bottle then these two bottles should have
different colours.
Let Fn denote the number of ways there are to place 2n additional bottles so that they satisfy
our requirements.
Answer 4.1
F0 ask how many ways we can place 0 bottles in addition to the two bottles that are already
placed. There is only one way to do this (by doing nothing), so F0 = 1.
Answer 4.2
To place 2n bottles, we must first place the first two bottles on each shelf and then place the
remaining n − 1 bottles on each shelf. There are already two bottles placed immediately to the
left of the first two bottles we want to place, and these already-placed bottles have different
colours. Suppose without loss of generality that they are red (top shelf) and green (bottom shelf).
Then the first two bottles we place can have colors (green,red), (green,blue), or (blue, red).
Therefore, there are 3 ways to place the first two bottles.
After we do this, we are left with the problem of placing n − 1 bottles on each of the two
shelves and the two leftmost bottles are preceded by already-placed bottles having two different
colours. By definition, there are Fn−1 ways to do this. This gives us the recurrence equation
1 if n = 0
Fn = {
3 ⋅ Fn−1 if n ≥ 1
:
Answer 4.3
This is an easy inductive prove. The base case n = 0 asserts that F0 = 30 = 1, which is
n−1
true by definition. For the inductive step, we assume that Fn−1 = 3 and now
Fn = 3 ⋅ Fn−1 = 3 ⋅ 3n−1 = 3n .
Question 5
This is the same setup as in Question 4, but now the requirements are different. Let t0 , … , tn
be the bottles placed on the top shelf and let b0 , … , bn be the bottles placed on the bottom
shelf. In both cases, these are listed in left-to-right order and the bottles t0 and b0 are already
glued to the shelf (t0 is red and b0 is green). Now we only require that,
for each i ∈ {0, … , n − 1}, the bottles in {ti , ti+1 , bi , bi+1 } should
include at least one red, at least one green, and at least one blue bottle.
Let Gn be the number of ways there are to place 2n bottles so that they satisfy our
requirements.
Hint: For Part 2, you must still prove by induction that the solution to your recurrence is indeed
1 – –
4 ((2 − √6)n+1 + (2 + √6)n+1 ) . Don't just say Wolfram Alpha told you so. Try
–
to follow the steps in the proof that the n th Fibonnaci number is (φ − ψ )/√5 . Notice
n n
that φ and ψ are special because they're the solutions to a certain quadratic equation.
Answer 5.1
As before G0 leaves us with only one option (do nothing), so G0 = 1. But G1 leaves us
with several options; we just have to make sure we include at least one blue bottle. This gives us
five options (blue, red), (red,blue), (blue, green), (green,blue) or (blue,blue), so G0 = 5.
Answer 5.2
Again, we start by placing the leftmost bottles that are not already placed, assuming that
immediately to the left of these there are two already-placed bottles of different colours. Without
loss of generality, these two already-placed bottles have colours (red,green).
1. The first two bottles we place have different colours. These could be (blue, red), (red,blue),
(blue, green), or (green,blue). After this we are now left with the problem of placing
n − 1 bottles on each shelf assuming that there are already two different coloured bottles
:
placed immediately to the left of these. By the Product Rule, the number of options in this
case is 4Gn−1 .
2. The first two bottles we place have the same colour, (blue,blue). Then we're not quite done,
since these two bottles have the same colour. In this case we place two more bottles, which
must be (red,green) or (green,red) and then we're left with the problem of placing n−2
bottles on each shelf assuming that there are already two different coloured bottles placed
immediately to the left of these. By the Product Rule, the number of options in this case is
2Gn−2 .
Therefore, by the Sum Rule, we have
⎧1 if n = 0
Fn = ⎨ 5
⎩ if n = 1
4Fn−1 + 2Fn−2 if n ≥ 2
Answer 5.3
The proof is by induction on n. For the two base cases n = 0 and n = 1, just evaluate the
given expression when n=0 and n=1 and verify that this gives values 1 and 5,
respectively.
Then we get
For each n ≥ 0, let Ln denote be the length of sn and let On be the number of 1's in sn .
1. Determine L0 , L1 , O0 , and O1 .
2. Prove that, for n ≥ 2, On = Ln−1 .
3. Prove that, for n ≥ 2 , Ln = Ln−1 + 2On−1
4. Write a recurrence for Ln that does not involve On and use Wolfram Alpha to solve it.
(You don't need to prove that Wolfram Alpha solved it correctly, just write the recurrence
and the solution Wolfram Alpha gave you for it)
5. Find a closed-form expression for On .
Answer 6.1
By inspection, L0 = 1, L1 = 3, O0 = 1 and O1 = 1.
Answer 6.2
To make sn we start with sn−1 and replace each zero with a one (this contributes Zn−1 to
the length ofsn ) and replace each one with 100 (this contributes 3On−1 to the length of
sn ). Therefore Ln = Zn−1 + 3On−1 = Ln−1 + 2On−1 .
Answer 6.4
Using the answers to the last two questions we have
Ln = Ln−1 + 2On−1 = Ln−1 + 2Ln−2 . Wolfram Alpha says this solves to
Ln = 13 ((−1)n+1 + 2n+2 ).
Answer 6.5
Answer 7.1