# Baking the optimal cake

This Riddler puzzle asks about finding the maximum-volume shape subject to constraints.

A mathematician who has a birthday coming up asks his students to make him a cake. He is very particular and asks his students to make him a three-layer cake that fits under a hollow glass cone he has on his desk. He requires that the cake fill up the maximum amount of volume under the cone as possible and that the layers of the cake have straight vertical sides. What are the thicknesses of the three layers of the cake in terms of the height of the glass cone? What percentage of the cone’s volume does the cake fill?

Here is my solution.
[Show Solution]

Here, I go into more detail about bounding the optimal cake volume as the number of layers becomes large.
[Show Solution]

## One thought on “Baking the optimal cake”

1. D says:

Well done.

I too (originally) had dynamic programming in mind for this problem and I was able to get the 44.4% of volume for the single layer. For some reason, I then changed gears and tried to set this up as a Lagrangian for 3 layers all at once, which was…. not a good idea.

After ruining quite a few sheets of paper I ended up numerically getting to the answer with a few for loops. This is still a bit bothersome, though, as ‘Layer Cake’ is such a good movie.

Also– that birthday cake animated gif is very cool.