I watched the Hamilton Awards Tony Awards on Sunday, and I was delighted to see some mathematics in the number from Waitress.

A little after the 1:30 mark, the waiters and waitresses in the video do a cute spin trick with their pies. I don’t know if the choreographers intended it, but it is an illustration of something called the plate trick, the Dirac belt trick, the Balinese cup trick, or one of several other colorful nicknames. I’m going to call it the pie trick in honor of its appearance in this number. Let’s take another look.

Video from CBS, gif-ified on gifs.com.

At its core—or maybe at its fruit filling—the pie trick shows that there are some times when 360° of rotation is not enough to arrive back at the starting point. You need 720° instead. That idea—the idea that doing the same thing twice is the same thing as leaving it alone—shows up not only in mathematics, but also in physics in forms such as the spin of an electron.

As Mark Staley writes in a paper explaining the trick, it “can leave the student wondering if a real understanding of quaternions and spinors has been achieved, or if the trick is just an amusing analogy.” After spending a few hours yesterday wrapping my head (and wrist) around it, I think the trick is helpful, but it rewards lengthy pondering instead of spilling its secrets immediately.

I first heard of the pie trick as a way to show that the fundamental group of SO(3) is nontrivial. Let’s unravel that. SO(3), short for the special orthogonal group in dimension 3, is the set of rotations of 3-dimensional space that fix one center point. The fundamental group of a space is the set of loops in the space that are fundamentally different—if you can wiggle one of them into another one, they’re the same loop. Only loops that can’t be wiggled into each other are truly different loops from the point of view of the fundamental group.

This is where it really gets abstract. An element of the fundamental group of SO(3) is a loop in SO(3). This loop is a set of points in SO(3). But points in SO(3) aren’t points in space the way we normally think of points—each "point" is actually a rotation. Here is where the pie trick can help us see what’s happening.

In the pie trick, your hand’s orientation—what direction the palm is facing and the direction the fingers are pointed—represents a rotation in SO(3). For anatomical reasons, the hand moves up, down, and around in space during the trick, but for our purposes those motions don’t matter, only the orientation of the hand. During the pie trick, the hand rotates 360° horizontally, keeping the palm face up the entire time. At that point, the elbow is pointed up awkwardly. Then the hand continues rotating in the same direction 360 more degrees, and suddenly the elbow is in a neutral position again. If you took a bunch of photos of your hand while you were doing the pie trick, the orientation of your hand in those photos would be a path in SO(3).

Halfway through the pie trick, your hand is in exactly the same orientation it started in, or, in terms of rotations, you’re at the same point in SO(3) you started at. This means the journey your arm took to get there is a loop in SO(3)—a path where the starting and ending points are the same. The contortion of your elbow, however, suggests that the path you took to get there is nontrivial. 

For more information about how the pie trick works and what it all means, the Wikipedia article has a little bit of explanation and links to more resources. A search for Dirac belt on Youtube yields several more demonstrations and explanations of the trick. I’m partial to this physics student’s demonstration using first a cup of water and then her braid.

I feel like I still have some pondering to do before I truly grok the connection between the pie trick and rotations of 3-dimensional space and even more abstract spaces, but I need to give it a rest for a little while. My arm is sore, and all that pie is making me hungry.

Thanks to my friend Daniel Studenmund, a mathematician at the University of Utah, for showing me this trick at lunch a few years ago and helping me remember what it was about earlier this week.