Fog Creek Software
Discussion Board




Cake Cutting 

Mary baked a rectangular cake. Merlin secretly carved out a small rectangular piece, ate it and vanished! The remaining cake has to be split evenly between Mary's two kids. How could this be done with only one cut through the cake?

Deepak pant(STM)
Saturday, June 18, 2005

Cut the slice at half the height rather than cutting it at length or width :-)

Ketan Mukadam
Saturday, June 18, 2005

simply cut the cake in a line that joins the midpoint of the original rectangle and the missing rectangle.


why ?

because any line that passes through the midpoint of a rectangle to its sides divides the rectangle into two equal halves.

this can  be extended to cuboids as well

Abyss
Saturday, June 18, 2005

Very nice problem!
Not too hard but with quite elegant solution.

Dmitri Papichev
Monday, June 20, 2005

If the knife is sufficiently long, the problem can still be solved even if both Merlin and Gandalf steal a piece. Just find the plane defined by the cake centre, Merlin's centre, and Gandalf's centre and cut along that.

WanFactory
Monday, June 20, 2005

cut it along the horizontal axis,  so u get equal parts no matter how many chunks have been taken out ...

g.b
Tuesday, June 21, 2005

> cut it along the horizontal axis

This solution doesn't work if the cake has different horizontal layers.

Dmitri Papichev
Tuesday, June 21, 2005

*  Recent Topics

*  Fog Creek Home