## Thoughts on a Problem III

I saw an interesting problem recently and can’t resist writing it up. The thought process for this problem was exceedingly unusual as you’ll see later.

First, here’s the source:

But here’s the full problem (rephrased a little) if you’d rather not watch a video.

Problem. From a cylindrical cake with chocolate icing on top, cut successive slices of a fixed angle x. Each slice is then inverted and inserted back into the cake. Find all angles x, such that after finitely many iterations, all the icing is back on top of the cake.

The whole point of the video is to present us with problems whose solutions violate our intuition. This problem is a prime example. At first glance, one might conjecture that the answer is any rational multiple of the full rotation. The correct answer is a little surprising, to say the least.

[ Warning: spoiler ahead with detailed solution. Actually, since this article is about my thoughts on a problem, what else did you expect? 😛 ]

The following solution is to be performed by trained professionals only. Readers please do not attempt to try this on an actual cake.

## Solution

The correct answer is: any angle. Yes, even irrational multiples of the full rotation! This completely bowled me over since for these “irrational angles”, you’ll never cut the same position twice. Fortunately, the professor in the video stopped short of explaining why all angles work, which gives us viewers an opportunity to think this through.

It took me a full 10 minutes to convince myself that “irrational angles” are possible. I realised that after one full round, in passing through the original baseline, the process of flipping the slice also introduces a rather unexpected turn of events.

What I had thought:

What actually transpires:

Note that even the initial cutting line had been flipped within the sector.

Upon this realisation, one sees that cutting lines may repeat even though the positions at which you cut don’t, since the cutting lines themselves aren’t stationary. Needless to say, the next step is to see what happens with the second round of cuts. As we continue round, we get: x (brown), x (brown) …

Now it should be noted that a = 2π-kx for some integer k such that kx ≤ 2π < (k+1)x. And bxa = (k+1)x – 2π. Hence, upon the second round, a sector of the cake is inverted which includes “b” above:

The pattern actually got more complex! As the cutting goes through more and more rounds, we’ll certainly expect more interspersing of the colours. How do we prove that it eventually returns to the original pattern?

Turns out there’s a nice way. First we let a and b be as above: a = 2π – kx, where k is the largest positive integer such that kx ≤ 2π < (k+1)x. Then let bx – a = (k+1)x – 2π. This gives kb + (k+1)a = k(a+b) + akx+a = 2π. Draw a pie chart with k+1 slices of angle a and k slices of angle b. Also highlight the sector where one of edges is the common edge between two slices of angle a (see diagram below); this is the slice we’ll invert.

Observe that after inverting this slice, the two angles a and b are swapped and the next sector is highlighted. This new sector also has one of its edges lying on the common edge between two slices of angle a. Thus, if we consider the total set S of all possible ways to colour each slice with either brown and white ($|S| = 2^{2k+1}$), then inverting a slice corresponds to a bijective function on S. By elementary theory of permutations, we must eventually get back the original configuration, i.e. all chocolate icing up.

This pretty much solves our problem, although there’s a nagging feeling that the proof may not work if angle x > π. For this case, we imagine the corresponding problem with angle x’ = 2π – x < π. Instead of inverting a slice of angle x, one imagines inverting a slice of angle x’ then flipping the whole cake over. Hence if, for angle x’, we get back the cake with chocolate icing up in N moves, then for the case of angle x, performing N moves will give us the cake with chocolate icing either all up or all down. In the former case, that’s good; in the latter case, another N moves will flip the cake back up.

Conclusion (with apologies to Valve):

This entry was posted in Thought and tagged , , , , . Bookmark the permalink.