2024 PreOlymp PS7_combi_recursion_solutions

You might also like

Download as pdf or txt
Download as pdf or txt
You are on page 1of 4

Qld Pre Olympiad Program Stage 2 2024

Problem Sheet 7 - Combi Recursive Counting Due 6pm Tuesday July 9


Submit your number answers via link and working problems via email as per letter:
Q1 to Cath, Q5 to Brenton.
Link to submit: https://forms.gle/g1Juy8gxPaGG6yst6
All Number answers are integers between 2 and 1000. Submit 0 if you are unable to
solve and submit 1 if you did not attempt the question.

1. Working Problem Show that for every integer m greater than five that one can
dissect an equilateral triangle into m smaller equilateral triangles (possibly of dif-
ferent sizes).
In addition, explain why it is not possible to dissect an equilateral triangle into five
equilateral triangles.
Solution If we have an equilateral triangle, we can put a row of 2k + 1 equilateral
triangles along one edge, for each k ≥ 1, by dividing that edge into k + 1 equal
parts. This gives a subdivision into 2k + 2 triangles. Thus 4, 6, 8, . . . small triangles
are possible. Take one of these subdivisions and divide one of the triangles into 4.
This increases the number of equilateral triangles in the subdivision by 3. Hence
from the subdivision into 2k + 2 triangles, we get one with 2k + 5 triangles. Thus
7, 9, 11, . . . small triangles are possible. So the numbers of small triangles in the
dissections found so far are 4, 6, 7, 8, 9, 10, . . . .
However, there is no subdivision into 5 equilateral triangles. For if each side is
divided into only 2 parts, we must have 4 equilateral triangles, and if at least one
side is divided into 3 parts we get at least 4 triangles and a non-triangular region,
which needs at least 2 triangles to cover it, giving at least 6 triangles in total. So
subdivision into 5 triangles cannot be achieved.
2. A code is a sequence of 0s and 1s that does not have three consecutive 0s. Determine
the number of codes that have exactly 11 digits.
[Hint: Consider the cases for the last three digits of a code. Does that relate to
codes of smaller length? Can we then work out how many codes there are with
11 digits by looking at the number of shorter codes? You will likely need to build
up your answer from the number of shorter codes.]
Solution:

Let cn be the number of codes that have exactly n digits.


For n ≥ 4, a code with n digits ends with 1 or 10 or 100.
If the code ends in 1, then the string that remains when the end digit is removed
is also a code. So the number of codes that end in 1 and have exactly n digits
equals cn−1 .
If the code ends in 10, then the string that remains when the last 2 digits are
removed is also a code. So the number of codes that end in 10 and have exactly
n digits equals cn−2 .
If the code ends in 100, then the string that remains when the last 3 digits are
removed is also a code. So the number of codes that end in 100 and have exactly
n digits equals cn−3 .

1
Hence, for n ≥ 4, cn = cn−1 + cn−2 + cn−3 .
By direct counting, c1 = 2, c2 = 4 and c3 = 7. The table shows cn for 1 ≤ n ≤ 11.

n 1 2 3 4 5 6 7 8 9 10 11
cn 2 4 7 13 24 44 81 149 274 504 927

Thus the number of codes that have exactly 11 digits is 927.

3. The function f (n) is defined for all positive integers n and takes on non-negative
integer values. Also, it satisfies

(a) f (m + n) − f (m) − f (n) = 0 or 1,


(b) f (2) = 0,
(c) f (3) > 0,
(d) f (9999) = 3333.

Determine f (1997).

Hint: Look at multiples of three.


Solution Putting m = n = 1 into (a), we have 2f (1) = f (1)+f (1) = f (2)−(0 or 1).
Since f (2) = 0 by (b), and f (1) is an integer, it follows that f (1) = 0. Then f (3) =
f (2) + f (1) + (0 or 1) = (0 or 1). Since f (3) > 0 by (c), it follows that f (3) = 1.
Now generally, f (m + 3) = f (m) + f (3) + (0 or 1) = f (m + 3) = f (m) + 1 + (0 or 1).
Using this repeatedly,

f (6) = f (3) + 1 + (0 or 1) = 2 + e1 ,
f (9) = f (6) + 1 + (0 or 1) = 3 + e1 + e2 ,
..
.
f (9999) = f (9996) + 1 + (0 or 1) = 3333 + e1 + e2 + · · · + e3332 ,

where each of the ei is equal to either 0 or 1. Since f (9999) = 3333, it follows that
e1 = e2 = · · · = e3332 = 0, so f (3k) = k for each k ≤ 3333.
Now we draw our attention to f (1997). As a first step, notice that f (1997) =
f (1995) + f (2) + (0 or 1) = 665 + 0 + (0 or 1) = (665 or 666). Also

1997 = f (3 × 1997)
= f (2 × 1997) + f (1997) + (0 or 1)

= f (1997) + f (1997) + (0 or 1) + f (1997) + (0 or 1)
≥ 3f (1997).

Hence f (1997) ≤ 1997/3 = 665 32 . It follows that f (1997) = 665.

4. Alan and Brenton have chocolates which they agree to share according to the fol-
lowing rules. Alan will take one chocolate, then Brenton will take two chocolates
and then, taking turns, each person takes one more chocolate than what the other
person just took. When the number of chocolates remaining is less than the num-
ber that would be taken on that turn, the last person takes all the chocolates that

2
are remaining. After the process is finished, they each have the same number of
chocolates.
They decide to do the sharing again, but this time, they first divide the chocolates
into two equal piles and then they repeat the process above with each pile, Alan
going first both times. They still finish with the same number of chocolates each.
What is the maximum number of chocolates less than 1000 they could have started
with?
Solution: Suppose Alan has the last turn and Brenton has n turns. Then Brenton
takes 2 + 4 + 6 + . . . + 2n = 2[1 + . . . + n] = n(n + 1) (this is from a well known
formula for triangular numbers).
Suppose Brenton has the last turn and n is the number of turns Alan takes. Then
Alan takes 1 + 3 + 5 + . . . + (2n − 1) = n2 .
In the first case, half the total number of chocolates is n(n + 1) and in the second
case n2 . We used the quantity taken by the person who didnt have the last turn as
we dont know (easily) how many are taken on the last turn!
Repeating this with the half piles and supposing m turns instead of n turns, half
the chocolates is either m(m + 1) or m2 . So there are four cases:

(a) n(n + 1) = 2m(m + 1)


(b) n(n + 1) = 2m2
(c) n2 = 2m(m + 1)
(d) n2 = 2m2

Now half the chocolates must be less than 500 so from Cases a) and b) n(n+1) ≤ 21
and n = 20 works as 20 × 21 = 2 × 14 × 15 in case b). You can check that n = 21
doesnt work. But we need to check there is no greater value for n in cases c) and
d). From these cases n2 ≤ 500 and so n = 22 is the only greater candidate.
In case c) there is no solution to 222 = 2m(m + 1) and in case d) there is no solution
to 222 = 2m2 and thus n = 20 is the best possible yielding 840 chocolates.
Hint: This isnt related to the new material, you may even find a case bash is the
easiest method.

5. Working Problem **
A tetromino tile is a tile that can be formed by gluing together four unit square
tiles, edge to edge. For each positive integer n, consider a bathroom whose floor
is in the shape of a 2 × 2n rectangle. Let Tn be the number of ways to tile this
bathroom floor with tetromino tiles. For example, T2 = 4 since there are four ways
to tile a 2 × 4 rectangular bathroom floor with tetromino tiles, as shown below.

Prove that each of the numbers T1 , T2 , T3 , . . . is a perfect square.

3
[Hint: This is similar to the Fibonacci counting we did in the Zoom of a 1 × n
grid, just more complicated! Your answer will very likely relate to the Fibonacci
sequence!]
Solution 1 Let Fn denote the Fibonacci sequence, defined by F0 = 1, F1 = 1 and
Fn+1 = Fn + Fn−1 for n ≥ 1. We will prove that Tn = Fn2 .
Consider a tiling of a 2 × 2n rectangle with tetrominoes, where n ≥ 2. Consider
the behaviour of the tiling in the leftmost column of the rectangle. Exactly one of
the following three cases must arise.
• The leftmost column is covered by a 2 × 2 square, whose removal leaves one
of the Tn−1 tilings of the 2 × 2(n − 1) rectangle.
• The leftmost column is covered by two 1 × 4 rectangles, whose removal leaves
one of the Tn−2 tilings of the 2 × 2(n − 2) rectangle.
• The leftmost column is covered by an L-tetromino and resembles one of the
following diagrams, or their reflections in a horizontal axis. The areas outlined
by dashed lines are tiled with 1 × 4 rectangles. (Observe that there may
actually be any non-negative integer number of 1 × 4 rectangles appearing in
the diagram.) The top case occurs when the area covers a number of columns
that is 0 modulo 4, while the bottom case occurs when the area covers a
number of columns that is 2 modulo 4. The removal of these areas leaves one
of the Tn−k tilings of the 2 × 2(n − k) rectangle, where k = 2, 3, . . . , n. The
case k = n leaves zero columns, so we set T0 = 1 to allow for this case.

Hence, we have shown that the following recursion holds for n ≥ 2.


Tn = Tn−1 + Tn−2 + 2(T0 + T1 + · · · + Tn−2 ).

Using this equation, one can directly verify that for n ≥ 3,


Tn − 2Tn−1 − 2Tn−2 + Tn−3 = 0.
Now observe that
2
Fn2 + Fn−3 = (Fn−1 + Fn−2 )2 + (Fn−1 − Fn−2 )2 = 2Fn−1
2 2
+ 2Fn−2 .

Fn2 − 2Fn−1
2 2
− 2Fn−2 2
+ Fn−3 = 0.
We can check that Tn = Fn2 for small values of n and then use these two matching
recursions to deduce that Tn = Fn2 for all positive integers n.
Note: ** indicates this question is particularly difficult.

You might also like