~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-
The Ham Sandwich Theorem / 9 months ago
~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-

Once again Algebraic Topology compelled me to write code. This time it was the Ham Sandwich Theorem, when I realized that it wouldn’t be too hard to demonstrate the two dimensional version of the theorem with another interactive doohickey.

The interpretation from which the Ham Sandwich Theorem gets its name says that if you have two slices of bread and a slice of ham between them, then no matter what their respective shapes or volumes or how they are positioned relative to each other, it’s always possible to make a single straight slice through the sandwich resulting in all three pieces being exactly bisected.

The Ham Sandwich Theorem applies to any N solids in N-dimensional space, so the 2D version says that any two sets of geometric shapes can be simultaneously bisected by a line. I said “two sets” rather than “two shapes” because the theorem actually doesn’t rely on the shapes even being connected. So we can talk about a collection of red and blue circles, as in the image below:

No matter how the circles are arranged, and no matter how many of them there are, there will always be at least one line that bisects both sets by area simultaneously. The interactive version lets you add, remove, and rearrange the circles.

--------------------
:::Comments:::

\__________ Rachelle -- 9 months ago __________/
Gary, you never write posts I can understand anymore.
--------------------
\__________ Me -- 9 months ago __________/
Crap. We need to learn you a topology, and fast!
--------------------
\__________ Nebu Pookins -- 9 months ago __________/
I figured I had falsified the Ham Sandwich theorem, by simply pulling out the ham all the way out of the sandwich. I tried it in your interactive applet, and I realized the theorem relies on cheating, because if I asked a waitress to "cut" my sandwich in half, and she did that, I'd be unsatisfied.
--------------------
\__________ Me -- 9 months ago __________/
I bet the waitress would be unsatisfied that you had called it a sandwich at that point.
--------------------
\__________ David J Seed -- 7 months ago __________/
why is this a problem at all. the red set of dots has a centre of gravity (R) any line through the centre of gravity will bisect the set of red dots. similarly the blue dots centre(B). the line RB will bisect both sets in 2D. In a ham sandwich, the plane through the centres of gravity will bisect both breads and the ham
--------------------
\__________ Me -- 7 months ago __________/

That seemed like a quite intuitive explanation at first, but after thinking about it for a bit I’m starting to doubt the idea that any line through the center of gravity necessarily bisects the set.

For example, take two circles at (100,0) and one circles at (-100,0). Unless I misunderstand center of gravity, I think it would be at roughly (100/3,0). But clearly not all lines through this point (for example the vertical line through the point) bisect the three circles by area.

--------------------
\__________ Aarex -- 7 months ago __________/
That a Lot!
--------------------
(New comment)