
No matter how well you plan Christmas, something always seems to go wrong. Even if you start gearing up for the big day in the middle of September, one mistimed stint in the oven or even a sudden mince pie shortage is enough to take the shine off your Yuletide.
Thatâs why this year Iâve decided to see if mathematics can help me pull off the perfect Christmas. After all, if maths can explain the mysteries of the universe, helping out with a little winter fun should be no problem.
Advertisement
The guests
Before anything else, I have to figure out who to invite. I decided my Christmas should be pretty low-key â a total of six people â but with a bigger crowd you might be worried about how guests will get along. Ideally you want a core of people who know each other to get conversation flowing, but for a great party you should also invite a few mutual strangers you hope will hit it off.
According to Ramseyâs theorem, named after British mathematician Frank Ramsey, any party with six or more guests will always feature at least three who know each other, or at least three who donât. My Christmas nearly fulfils both conditions at once: my wife Lottie, her sister Martha and Marthaâs boyfriend Nick all know each other, but Nick hasnât met our friends Josephine and Chris. Unfortunately for mathematical neatness, the two of them arenât strangers: theyâre a couple.
But what if you want to guarantee a larger number of friends or strangers? Over the years mathematicians have tried to calculate the , R(m,n), which tell you the number of people, R, needed to ensure m friends or n strangers, but itâs tricky. The number of possibilities grows so rapidly as the size of your party increases that while R(4,4) is known to be 18, mathematicians have only pinned R(5,5) down to between 43 and 49. Hungarian mathematician Paul ErdĹs once said that if aliens demanded an accurate calculation of R(5,5) within a year to deter an invasion, we could probably just about do it â but if they demanded R(6,6), we would be better off launching a pre-emptive attack.
Thankfully no aliens are invited to my Christmas, so with the guests lined up I had better start thinking about food.
The food

Whipping up a traditional Christmas dinner of turkey and all the trimmings requires some basic arithmetic to ensure everything finishes cooking at the same time, but is there anything that more advanced maths can do to make my meal really zing?
Browsing through some maths papers, I come across the spicy chicken theorem, by at New York University and his colleagues. Not your traditional Christmas fare, perhaps, but letâs run with it. Suppose you have a bunch of chicken breasts that youâre planning to chop up and marinate in a spicy sauce before frying, to give it a crisp outer coating. Is it possible to cut the breasts so that everyone gets an equal amount of succulent chicken and spicy skin?
The team also proposes a vegetarian version of the problem that swaps spicy chicken out for roast potato â an essential part of Christmas dinner. I study the proof in detail, trying to figure out some cooking instructions to ensure all my guests get a fair share, but itâs just too advanced. I get in touch with Aronov for help; bad news, he says, as the proof is non-constructive. That means they have proved it is definitely possible to cook my potatoes fairly, but they have no idea how to actually go about it. Guess Iâll stick to the real recipe books then.
The crackers

If thereâs one thing that makes a meal truly Christmassy, itâs pulling crackers. But donât you hate that slightly awkward moment after the bang goes off, when you have to redistribute paper hats and bad jokes to the less successful guests? In a traditional cracker pulling, where everyone crosses arms and pulls at the same time, youâve got a 25 per cent chance of ending up with nothing. Can maths help make everyone a winner?
If we set aside all those who won in the first round of pulling â some of whom may have lucked out with a double cracker win â and keep going until everyone has won, in the worst-case scenario of a double cracker win each time Iâll need to buy at most two crackers per person to make sure there are enough.
But I donât want to blow my whole party budget on crackers, so I by David Clifford of CSIRO, Australiaâs national science agency, and his colleagues. They have simulated all the possible outcomes, and found that on average you will need eight crackers to ensure a party of six all go home happy, although to be 95 per cent certain you are better off with nine.
Sure enough, on the first round Josephine and Nick win two crackers each, leaving Chris and Lottie with none. When they pull again, Chris gets two, meaning Lottie has to pull one by herself â which means weâve used nine crackers, just as predicted.
As the team points out, this method does still waste crackers, so itâs possible to get more frugal. Instead of pulling in a circle, pair people up and have them pull an individual cracker, then move on to a new round featuring only the losers. The loser at the end has to pull a cracker by themselves, as Lottie had to. It will take a bit longer, but you will only need as many crackers as there are people. Itâs hardly very festive though, which is why Clifford and colleagues dub it the Scrooge system.
The dessert
Paper hats jauntily in place, we tuck in. Fortunately no one grumbles about uneven potatoes, and before long itâs time for dessert: yule log and two other cakes. Mathematicians have devoted a surprising amount of time to studying ways of dividing cakes, often because a mathematical cake can stand in for a variety of other resources â but Iâm interested in the real thing.
Initially we try a fairly basic method, in which one person sweeps a knife across the cake from left to right. The first of the others to shout out when they think the piece to the left of the knife is fair gets that slice, and the game continues until all the cake is gone. You might think this would work well on the elongated yule log, but Chris panics, calling it far too early and ending up with a pitiful slice, while a nail-biting finish leaves Lottie with a massive piece.
This scenario nicely describes why mathematicians say the moving-knife procedure isnât âenvy-freeâ â because the size of another playerâs piece can make you feel hard done by. But designing an envy-free method that works in all situations is taxing. For two people, the old âI cut, you chooseâ method works just fine. For three â letâs call them Alice, Bob, and Carol â things get more complicated.
There are a few three-person techniques to choose from, but Iâve gone for the SelfridgeâConway procedure. Alice cuts the cake into three pieces she believes are equal. Bob takes what he thinks are the two largest, and trims them to be the same size, putting aside the trimmings. Carol picks what she thinks is the largest of the three to be her slice, followed by Bob, who must pick the trimmed piece if Carol hasnât already. Alice gets whatâs left. Finally, Carol divides the trimmings into three, and Bob, Alice and Carol take their pick in order â unless Carol took the trimmed piece to begin with, in which case her role is swapped with Bob.
Confused? Essentially itâs extending the principle of âI cut, you chooseâ â the less choice you have over the division of the cake, the more choice you get over which piece to take. Three of us attempted this method with a salted caramel cake, and found we were all terrible at dividing into threes, but for the most part everyone was happy with their share.
But with six people at the party, sharing a cake between three isnât very sociable. For the final cake, a white chocolate and strawberry number, we turned to the Robertson-Webb protocol, an envy-free method that works for any number of people. It involves repeated rounds of splitting the group into those satisfied and disappointed with the size of all of the slices, and continuing to divide until everyone is happy. The theory is sound, but after repeated cuttings and selections we ended up with a cake that was so finely sliced and mucked about with that it was basically inedible. Thatâs certainly one way of minimising envy.
The presents

With the food over, our minds turned to presents. We had decided to do a Secret Santa, picking names out of a hat to choose who we would buy gifts for. Anyone whoâs done Secret Santa knows that frequently someone picks their own name and you have to start the whole process again again. But what are the odds of that happening? Calculating this involves a couple of lovely sets of numbers, known as factorials and derangements.
The former is simply the number of ways of arranging n different objects, and is calculated by multiplying n and all the numbers below it together. Itâs written as n!, so for example four different objects can be arranged in 4! ways, which is equal to 4Ă3Ă2Ă1 = 24. Derangements, written !n, are similar, but exclude any configurations where an object appears in its original position â which is exactly what we want to avoid for a successful Secret Santa. The odds of everyone picking somebody elseâs name is therefore the derangement divided by the factorial, the rather satisfying-looking !n/n!.
The good news is that you donât actually need to calculate any of this. It turns out that for five or more people, !n/n! is always roughly one divided by e, a mathematical constant called Eulerâs number, which comes to around 0.37 That means for any decent-sized Secret Santa pool, thereâs a roughly two-thirds chance you will need to start over.
As an extra complication, we prohibited any of our guests from choosing their partner. This added complication reduces the odds of success to around 1/e^2, or roughly 0.14. It took us six increasingly mind-numbing rounds to hit a secret Santa arrangement that worked â so my advice is to dump the hat and get an impartial friend to do the picking.
The wrapping

Eventually, I drew Chris and decided to get him a suitably festive chocolate orange. Iâm truly awful at wrapping presents, so I was keen to get mathematical help from of the Massachusetts Institute of Technology and colleagues, who wrote a paper detailing the . If you have ever attempted to wrap something curved, you will know that the end result is never very pretty. Thatâs because the flat paper canât take on the curvature of whatever youâre wrapping â the same reason cartographers have to distort Earthâs geography to fit a flat map.
Demaineâs solution is to split the surface of the sphere into âpetalsâ, symmetrical segments that meet at a central point. If you imagine cutting an orange into slices, then eating the fruit and flattening out the peel, youâll have a rough idea of the shape of each petal.
The team helpfully provide templates for their petal wrappings, so I cut one out and traced it on to wrapping paper. Itâs only when I take the chocolate orange out of its box that I discover it isnât exactly spherical, as it has a flattened top and bottom. As such, my present wears its wrapping like a loose-fitting shirt, and is visible through the gaps in the paper. Oh well, at least I saved on Sellotape â just one piece on top is enough to hold all the petals together. âItâs pretty good,â says Chris, but I think heâs just humouring me.
So, has mathematical rigour translated into festive perfection? My efforts were a mixed bag, but as we all lounge on the sofa, stuffed full of precisely cut cake, everyone seems to have enjoyed a mathsy little Christmas. Maybe next year Iâll try quantum physics.
All images: Jeff J Mitchell/Getty