The Mathsbombe Competition

2021 edition. From the people behind the Alan Turing Cryptography Competition.
Home Archive

Solutions

Problem 1

Graph paper

The answer is 52.

Our line starts at $(\frac{1}{2},\frac{1}{2})$. The important thing to note is that when our line reaches a point $(x,y)=(m+\frac{1}{2}, n+\frac{1}{2})$ for whole numbers, $ m $ and $ n $ then the pattern will just start repeating. So the infinite sequence starts repeating again once we reach the coordinates (31.5,21.5). We cross 21 horizontal lines and 31 vertical lines in this time. Thus the sequence is periodic, with period 52. So we see 52 different words of lenth $1000$, corresponding to the original sequence plus the sequences we get by removing up to $51$ symbols from the front.

Problem 2

Grandchildren

The answer is 53.

To work out whether on day $ n $ Graham will have an even or an odd number of grandchildren visiting, we look at the prime factorization of $ n $ and count the number of different factors greater than one. For example, $ 12=2\times 2 \times 3 $ and so 12 has factors 2,3,4,6,12 greater than one. Graham will have one grandchild visiting as a result of the `every second day' rule, one grandchild visiting from the `every third day', one from every fourth day, one from every sixth day, and one from every twelfth day. So 5 children will visit on day 5. It is then quite quick to go through and compute that an odd number of children visit on 53 of the 60 days, the nly days on which an even number of children visit are those indexed by a square (1,4,9,16,25,36,49).

The puzzle has a link with Euler's totient function, where $ \phi(n) $ counts the number of $ m\leq n $ which are coprime to $ n $. In this case, we want to ask whether $ n-\phi(n) $ is odd or even. There is a nice Wikipedia page on Euler's totient function where you can learn more.

Problem 3

Sumsets

The answer is 60.255

By playing around geometrically we realise that the orthogonal projection of $ (a,b) $ onto the line at angle $ \theta $ through the origin is at distance $ (a\cos(\theta)+b\sin(\theta)) $ from the origin. This means we want the ratio of $ \cos(\theta) $ and $ \sin(\theta) $ to be $ 4/7 $. So $ \tan(\theta)=7/4 $ and using arctan we get $ \theta\approx 60.255\cdots $ degrees.

Problem 4

Socially Distanced Supermarket

The answer is 0.2603.

The one-way system puts an ordering on the items in the list. For $ n $ items on the shopping list, represent each item to be bought as $ 1, \ldots, n$ in order of their position on the supermarket shelf. The list is a random permutation of $ 1, \ldots, n$. The number of times required to go around the supermarket is one more than the number of 'descents' (instances where an item is smaller than the previous item) in the list.

Let the number of permutations of $ 1, \ldots, n $ that have $ k $ descents be $ A(n,k) $. Then

  • for each permutation of $ 1, \ldots, n-1 $ with k descents, there are $ k+1 $ ways to insert the value "$ n $" into that sequence without adding any new descents.
  • For each permutation of $ 1, \ldots ,n-1 $ with $ k-1 $ descents, there are $ n-k $ ways to insert "$ n $" into that sequence, adding one additional descent.
Thus \[A(n,k)=(n-k) A(n-1,k-1) + k A(n-1,k)\]

We can also see that $ A(n,0)=A(n,n-1)=1 $ (there is only one way to write the sequence with zero descents: to write it increasing order. Similarly the only sequence with $ n - 1 $ descents is that written in decreasing order). This gives initial conditions for this recurrence. Note that $ A(n,m) $ is (one definition of) the so-called Eulerian numbers.

Then the required answer is \[( A(7,0)+A(7,1)+A(7,2) ) / 7! = (1+120+1191)/5040 = 0.2603 \]

Problem 5

Primative Pythagorean Triples

The answer (to the nearest half degree) is 41.5

We have \[ \frac{c_1}{c}=\frac{2a-2b+3c}{c}=3+2\frac{a}{c}-2\frac{b}{c} = 3+2\cos(\theta)-2\sin(\theta). \] Similarily \[ \frac{c_2}{c}=\frac{2a+2b+3c}{c}=3+2\cos(\theta)+2\sin(\theta) \] and \[ \frac{c_3}{c}=\frac{-2a+2b+3c}{c}=3+2\sin(\theta)-2\cos(\theta). \]

Since theta is between 0 and 90 degrees we will always have $ \cos(\theta)+\sin(\theta)>0 $, so for all of our inequalities to hold we need $ (\sin(\theta)-\cos(\theta))\in[-0.5,0.5] $.

We mess around by hand to find the values $ \theta $. $ \theta_1\in(24.29,24.3) $ and so $ \theta_2\in (65.7,65.71) $ giving $ \theta_2-\theta_1\approx 41.5 $.

Problem 6

Chef Jean's cake

The answer is 24.09 degrees.

The plane of the cut is defined by three points in space.

  • Because the same volume of banana cake is in each slice, one of these points lies at the centre of the $ 4\times8\times5 $ un-iced cake, i.e. at $ (2,4,2.5) $.
  • Since the un-iced banana cake is bisected into two pieces of the same volume, the requirement that the toffee icing is bisected into two pieces of equal volume is equivalent to the requirement that the entire $ 6\times9\times6.5 $ cm slice is bisected into two equal volumes. Thus, one of the points defining the cut lies at the centre of the entire slice, at $ (3, 4.5, 3.25) $.
  • We can think of the sprinkled cocoa as occupying a layer of small thickness $ \epsilon $ on top of the icing, so that the entire cake including cocoa is a cuboid with corners at $ (0,0,0) $ and $ (6+\epsilon, 9+\epsilon, 6.5+\epsilon) $. Applying the same argument as before, the third point defining the plane of the cut is $ (3+\epsilon/2, 4.5+\epsilon/2, 3.25+\epsilon/2) $.

Subtracting point 2 from point 1 tells us that the vector $ (1, 0.5, 0.75) $ lies in the plane of the cut.

Subtracting point 3 from point 2 tells us that the vector $ (1,1,1) $ lies in the plane of the cut. Note that it doesn't matter what size $ \epsilon $ is: we can take $ \epsilon $ as small as we like.

The problem is then reduced to finding the angle between a vertical vector $ (0, 1, 0) $ and a plane in 3-D space that contains the vectors $ (1, 0.5, 0.75) $ and $ (1, 1, 1) $. The key step is to find the normal vector, a vector that is at right angles to this plane, and thus to both vectors $ (1, 0.5, 0.75) $ and $ (1, 1, 1) $. The simplest, though not the only, way to do this is to take the cross product of both vectors, and dividing by the length of the resulting vector to get a normal vector of length one, $ n = (1/\sqrt{6}, 1/\sqrt{6}, \sqrt{2/3}) $. Using the dot product, the angle of this plane to the vertical is then $ \arcsin(n\cdot(0,1,0)) = \arcsin(1/\sqrt{6}) = 24.09^{\circ} $.

The cut cake looks like this:

Problem 7

Citrus Taxonomy

The answer is $ 3^{10}=59049. $

When Jablonski breeds trees she acts geometrically on the plane by the actions \[ T_1(x,y)=(\frac{x}{2},\frac{y}{2}) , T_2(x,y)=(\frac{x+1}{2},\frac{y+1}{2}), T_3(x,y)=(\frac{x}{2}+\frac{1}{4},\frac{y}{2}+\frac{\sqrt{3}}{4}) \]. It is quite fun to play with these transformations. Starting with the initial triangle T with vertices $ (a,b,c) $ we generate subtriangles of T corresponding to those in the Sierpinski triangle.

Since we start from (0,0), which is the bottom left corner of T, the trees Jablonski creates are represented by the bottom left corner of subtriangles of the Sierpinski triangle. In particular, Jablonski never (in finite time) creates anything along the top right edge of the triangle, such as a citron or a true mandarin. We can go 10 steps before the distance between different trees becomes smaller than $ 2^{-10} $. This gives $ 3^{10} $ such possibilities at distance at least $ 2^{-10} $.

Problem 8

Graphville

The answer is 0.84375.

To answer this question we make a separate graph of possibilities detailing what we know about where we are at each step. Labelling the exterior vertices 1,2,3,4 starting clockwise at the top, and then the interior vertices 5,6,7,8 starting clockwise at north west, one can see that, wherever you start, you will be at vertex 3 or 5 after following red red blue red red blue.

Given these two possible starting locations, it is then a twenty minute exercise to sketch out the whole graph, branching at each flip of the coin, showing what you know about your location given a certain path history. Stop whenever you know exactly where you are just based on the road colour sequence, or whenever you know you are at one of two vertices where one of the two is home (since then you can infer exactly where you are based on whether you can see your partner). From the graph we see that you know where you are with probability 54/64 = 0.84375.

If you have studied matrices, it is also possible to encode this problem in terms of matrix products. We start with a vector $ (0 0 1 0 1 0 0 0)^T $ which indicates that we could start at vertex 3 or vertex 5. We make a matrix R which corresponds to following red paths, we put $ R_{i,j}=1 $ whenever following the red path from vertex i we reach vertex j, and 0 otherwise. We make a similar matrix $ B $ corresponding to following blue paths.

We then need to somehow encode the idea that when we reach home we know where we are, we do this by replacing any 1s with 0s in column 4 of R and column 4 of B. Then we know where we are after following path rbbrbr for example if the vector $ v_0RBBRBR $ has either one or zero positive entries. If we have more than one positive entry this corresponds to more than one possibility of where we could be.

Mathsbombe Competition 2021 is organised by the The Department of Mathematics at The University of Manchester.
© The University of Manchester 2012–2021, All Rights Reserved
Contact us | Privacy notice