The Pancake Theorem

We all know pancakes and how delicious they can be if prepared properly, and it is only natural wanting to share it with your closest friend. However, cutting a pancake exactly in half, one for you and one for your friend, is not trivial matter. It is even less trivial when you understand that your friend also has a favorite pancake which he wants to share as well, so now we need to double our cutting process. In this post we will show that with a bit of mathematics, not only you can cut both pancakes exactly in half, but you can do it simultaneously with a single straight line.

For the Hebrew listeners among you – here is a video I made on this subject: https://youtu.be/_xh6yQocHj4

And for the English listeners: https://www.youtube.com/watch?v=974OcQH-9og

So what is a pancake?

Starting with this basic question can lead for example to wikipedia’s answer:

pancake (or hot-cakegriddlecake, or flapjack) is a flat cake, often thin and round, prepared from a starch-based batter that may contain eggs, milk and butter and cooked on a hot surface such as a griddle or frying pan, often frying with oil or butter.

Tasty as it may sounds, this is not too helpful when trying to prove mathematical results, so let’s give a more mathematical definition. For us a pancake will simply be a set of points in the plane which will satisfy some simple conditions. Mainly we want it to (1) not be infinite in size, and (2) be a single pancake, and not collection of disjoint pieces. The first condition is easy to describe by simply requiring the set to be bounded. The second is a bit trickier, but a good place to start is to require that between any two points in the pancake there is a path inside the pancake that connects them. However, paths in general can be very thin (e.g. a curve) and are in a sense irrelevant when we want to actually eat the pancake. So additionally we want the path to have some (edible) area to them. More simply, we will require each point in the pancake to have a small circle around it which is contained in the pancake.

Formally, we have the following definition:

Definition: A “pancake” is a measurable set of points \Omega in \mathbb{R}^2 such that:

1. \Omega is bounded: There is M>0 such that |p|<M for all p\in \Omega.

2. \Omega is path connected: For each two points p_0, p_1 \in \Omega there is a continuous path connecting them, namey \varphi:[0,1]\to\Omega continuous with \varphi(0)=p_0 and \varphi(1)=p_1.

3. \Omega is open: For each p\in\Omega there is some r>0 such that the ball B_r(p) of radius r around p is contained in \Omega.

Once we have such a set and some line, we can talk about the measure of the points from the set on the two side of the line. The pancake theorem that we will prove will show that given two pancakes we can choose such a line that splits both pancakes exactly in half.

The definition above is very general, and while the standard round shape of a pancake satisfies it, there are many more shapes that fall under this definition, as can be seen in the figure below. But even with this wide variety of shapes, the general pancake theorem holds for even greater “family” of pancakes, and we will talk a little bit about it in the end of this post.

Cutting one pancake

Now that we have a definition for a pancake, let’s try to cut a single pancake exactly in half using a straight line. This can be a very hard job, considering how general our definition of a pancake is – we don’t even have a starting point for how to measure parts of such pancake sets.

If cutting to \frac{1}{2} and \frac{1}{2} is too difficult, then how about \frac{3}{4} and \frac{1}{4}? or 0.1 and 0.9? They all seem just as difficult, but there is a light at the end of this tunnel. If we go all the way to 0 and 1, then it is very simple to do such “cuts”. This exactly means that the whole pancake is on one side of the cut, and we can always find such cut since our pancakes are bounded. As trivial as this observation seems to be, we can go very far with it. We can start with a (0,1) cut as above, and gradually move the line in a parallel manner until we are at the other side of the pancake to get, in a sense, a (1,0) cut. Then, if there is any justice in the world, at some point where we move from 0 to 1 we will hit \frac{1}{2} which is exactly what we need.

Going from a (0,1) cut all the way to (1,0) cut.

Let’s try to formalize this notion. Consider the vertical lines, namely x=c. For each such line we can look at the area of the pancake left of the line, namely at x<c, and we denote it with f(c). This is a function f:\mathbb{R} \to \mathbb{R} where for all c small enough f(c)=0. As c increases, the area left of the line increases until c is large enough where f(c) is the area of our pancake. Normalizing the area to be one for simplicity we get that f is monotone increasing, which start with 0 and ends with 1.

The area left of the line is a monotone increasing function from 0 to 1.

This is already promising. Does every monotone increasing function from 0 to 1 hits 0.5? In general, no, since it might jump across it like this

Jump discontinuity

However, in our case this doesn’t happen. To see that let’s take two lines just before and just after such a jump, and evaluate the values of the function. At each line we need to measure the area left of the corresponding line, meaning that the difference between the values is exactly the area of the pancake between the lines. This area is bounded from above and below uniformly because the pancake is bounded. It is of course also bounded from left and right by the lines themselves, so in other words it is bounded by a rectangle, and therefore its area is at most the area of that rectangle.

The area of the rectangle is the height times the width, and while the height is bounded, we can choose the width to be as small as we want. It follows that the bounded area, and therefore the difference between the function values, is as small as we want. Or in other words, we can’t have such a jump when going monotonically from 0 to 1 so we must pass through \frac{1}{2} along the way.

This argument shows that we can find a vertical line that cuts the pancake to half. But, we can actually show something stronger – there is a unique such line. Indeed, if there were two such lines, then the area of the pancake would be split evenly between the right side of the right line and the left side of the left line. Alternatively, there is no “area” of the pancake between the two lines.

However, we required that the pancake set of points will be path connected and open exactly to avoid such cases. Hence we must have a unique such vertical line.

Remark: Note that the argument above for not having a “jump” basically shows that the function f is continuous. This allows us to use the intermediate value theorem so starting with 0 and ending with 1 means that we hit every y\in[0,1] along the way.
The second argument about the uniqueness basically shows that f is not only monotone increasing, but strictly monotone increasing outside the edges where f(x)\in\{0,1\}. Thus for any y\in (0,1) there is a unique x such that f(x)=y.

Up until now, we only looked at vertical lines, but of course the same result holds in general – given any direction, there is a unique line at that direction which splits the pancake exactly to half. As this will soon become very helpful let’s recall the mathematical representation of a line and its components.

A line in the plane is simply all the points solving an equation of the form ax+by=c where (a,b)\neq (0,0). The nonzero vector (a,b) is perpendicular to the line, so it fixes the direction of the line. Once this vector is chosen, the number c determines which line with this direction we choose. The size of the perpendicular vector should not matter in the definition of the line, or in the algebraic presentation the equation \lambda ax +\lambda by = \lambda c defines the same line as ax+by=c. It is usually convenient to therefore choose the perpendicular vector of norm 1, namely a^2+b^2=1. With this choice, the corresponding c is exactly the (signed) distance of the line from the origin.

In the argument above we used the lines 1\cdot x + 0\cdot y =c, and its two sides x>c and x<c. For general lines the two sides of the line are defines similarly, namely ax+by>c and ax+by<c. Basically what we have shown above that once we choose the direction (a,b), the function which sends c to the area of \{(x,y) \in Pancake | ax+by>c\} is a monotone continuous function from 0 to 1 and therefore passes through \frac{1}{2}.

Two pancakes

At this point we know how to cut a single pancake exactly in half with a single straight line, and moreover there is exactly one such line for each direction that we choose. Next we want to know if one of these lines can cut the second pancake exactly in half also.

When going over all the possible line we basically chose the direction (angle) of the line, then use the previous section to find a line which cuts the first pancake in half, and then see if it cuts in half the second pancake. As before, we can’t really measure the areas of the second pancake at the two sides of the line. However, as can be seen in the figure below, there are some directions in which the computations are very easy – namely those direction in which all of the second pancake is on one side of the line:

This is very similar to what we had in the previous section. If we start with a line where the second pancake is on one side, and end with a line where it is completely on the other side, then hopefully some continuity argument will show that some where in the middle exactly half of it is on each side. Putting the continuity aside for a moment, there is still another problem. The example above is misleading, and unlike the previous section we might not have any line for which the second pancake is completely on one side:

One pancake “inside” of another. No matter how we cut the inner pancake to half, the cutting line will always intersect the exterior pancake.

Fortunately, this problem has an easy solution. Choose any direction and look at the corresponding line, and let \alpha be the area of the second pancake on one of its sides. Rotating this direction 180 degrees, we get a second line which cut the first pancake exactly in half, and is also parallel to the first line. From the previous section this means that the two lines must coincide! However, we are not looking at the line itself, but on the area of the pancake over one of its sides, so together with this 180 degrees rotation, we basically just flipped the side that we look at. In other words, if we started with the area \alpha we ended with its complement 1-\alpha. If \alpha=\frac{1}{2}, then we are already done, and if not, then \alpha and 1-\alpha are one larger and one smaller than \frac{1}{2}, so we can still use the intermediate theorem (assuming continuity).

Continuity

Thus, we only need to show that our function is continuous… But what is exactly our function?
Well, we start with the perpendicular direction (a,b) defining our line direction. Then use the argument from the previous section to find c:=c(a,b) such that the half plane \{(x,y) | ax+by>c \} contains exactly half of the first pancake, and then look at the area of the intersection of this half plane with the second pancake. If we denote the second pancake with \Omega_2 and the half plane above as H_{(a,b,c)}, then the function is

\psi:(a,b) \mapsto Area(\Omega_2 \cap H_{(a,b,c(a,b))})/Area(\Omega_2).

This is a function from the unit circle (since we go over a^2+b^2=1) into [0,1], and we ask if \psi(a,b)=\frac{1}{2} for some point.

This time the proof of continuity is not as simple as in the previous case, and it is a nice exercise that you should try to prove by yourselves. One of the main claims that you should probably prove is that:

Claim: If \Omega is any bounded measurable set, then the map (a,b,c) \mapsto Area(\Omega \cap \{(x,y) | ax+by>c\} is continuous.

This should not be too surprising – if we move the line a little bit, we expect the change in area to be small. This is very similar to what we had previously, only now we don’t have a nice rectangle that always bound the difference between the areas, though we still have a nice geometric intuition why this should be true.

The difference between the halfplanes that the lines define is inside the small “triangles”.

Once you prove this claim, you should prove that (a,b) \mapsto c(a,b) is also continuous. Show that otherwise, you could find a direction with two distinct lines that cut the first pancake exactly in half, which we already know is not true. Once these two function are proved to be continuous, we get that \psi(a,b) is also continuous as a composition of continuous functions.

And we are done – you are now an expert at cutting simultaneously two pancakes with one straight cut.

Generalizing the pancake theorem

For those curious enough here are a couple of ways of generalizing the pancake theorem.

Even more pancakes

Up until now we tried to cut the pancakes so that the area in each side will be the same. However, in general the pancake can be thicker at some parts and thinner at others. We can take this into account when measuring the pancake parts at each of the side of the line. More formally, instead of simply looking at a set of points, we have a (nonnegative) density function \rho(x,y) which tells us how “dense” the pancake is at point (x,y). Then the measure of the pancake at some set is simply the integral of this density function over that set.

When the pancakes were only sets, we wanted them to be bounded and connected. Now, when we use density functions, the boundedness will simply be replaced with the integral over the whole plane being finite, which we might as well normalize to being 1 and make it a probability measure, namely

\int_{\mathbb{R}^2} \rho(x,y)\mathrm{dx}\;\mathrm{dy}  = 1.

We can no longer use the boundedness condition in our proof, however it is not hard to show that after fixing the density function, there is always a large enough ball that contains most of the mass of the pancake, namely

\int_{x^2+y^2<R} \rho(x,y)\mathrm{dx}\;\mathrm{dy} > 1-\varepsilon.

So while we can’t in general move our cutting line far enough to have all the pancake on one side, we can have almost all of it on one side, and you should check that in order to use the intermediate value theorem this is enough.

We also used the boundedness to show continuity. This was simply done by bounding the height of some rectangle where the width is as small as we want. This idea still holds with probability measures, since if the area of a rectangle is as small as we want, then so is the mass of the pancake inside it (the integral of the density).

The argument that there is a single cutting line for each direction can still hold if we require the set \rho(x,y)>0 to be path connected and open. However we can actually show that the theorem still holds when the pancake is not connected. The trick is to add a little bit of mass at each point (and still keep the whole mass finite) and prove the theorem for that new pancakes. Is we add less and less mass, at the limit we get our original probability measure, and I will leave it as an exercise to show that if the theorem holds for a sequence of measures, it also holds for its limit (if exist).

Hence the general formulation holds for any two probability measure (which you can think of as just spreading a finite amout of pancake dough anywhere that you want in the plane).

Higher dimensions

The pancake theorem can be generalized to higher dimensions as well where instead of 2 sets (or probability measures) in the plane, we look at d sets in \mathbb{R}^d and instead of cutting with a line, we cut with a hyperplane (namely, a d-1 translated vector space).

In particular in dimension 3, we have 3 sets and we try to cut them using a plane cut. This theorem is usually called the Ham sandwich theorem, since we think of the three sets as the two slices of bread and the ham in between.

The first step of the proof is quite similar to the 2d case. The half spaces defined by a hyperplane are sets of the form \sum a_i x_i > c, and showing that for each “high dimensional pancake” and each direction (a_1, ..., a_d) there is some c that cuts the pancake exactly in half, is basically the same intermediate value theorem we know from dimension 1.

For the second step, now for each direction we have a cutting hyperplane, and it cuts the other d-1 pancakes and we can measure how much of their mass is on the positive halfspace. This means that we have a function from the sphere S^d\subseteq \mathbb{R}^d into \mathbb{R}^{d-1}. When d=2, the sphere is simply the circle which is a curve, so we can use the standard intermediate value theorem there as well. When we go up in the dimension we need to use some sort of generalization of this theorem, and in this case we use the Borsuk-Ulam theorem.

In order to understand its formulation, let’s first return to the 2-dimensional case. There, we had a continuous function from the circle which had the interesting property that \psi(p)+\psi(-p)=1 (namely, the areas of both sides of a line sum up to 1). This way if we start with a value lower than half and rotate 180 degrees we end with a value larger than half. We can move to the homogeneous version of this theorem by looking instead on \xi(p)=\psi(p)-\frac{1}{2} so that \xi(p)+\xi(-p)=0, or equivalently \xi(-p)=-\xi(p) – this is an odd function. Now we look instead for a point which satisfies \xi(p)=0. This formulation is one of the several equivalent formulations of the Borsuk-Ulam theorem:

Borsuk-Ulam theorem: Let \xi:S^d \to \mathbb{R}^{d-1} be a continuous odd function. Then there is a point where \xi(p) = 0.

You should now check that this theorem is exactly what we need to generalize the proof to higher dimension.

The Borsuk-Ulam theorem has all sorts of interesting applications to the point that it has a book called Using the Borsuk-Ulam theorem. However, this will have to wait for a future post, and for now we can enjoy the fact that its 2-dimensional version Intermediate value theorem has the interesting real world application of simultaneously cutting two pancakes with a single straight line.

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

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s