Rocks, paper, scissors. Odds & evens. Highest roll. Heads or tails. And for at least a certain generation—let’s call it Old Millennials—the Oreo twist-off game.

When you’re a kid, you constantly need ways to make quick, unbiased decisions on issues like who gets first pick in the recess basketball draft, who gets to keep the comic book you found in the science lab, and who has to go up to the cute new transfer and ask him to the Sadie Hawkins Dance. One quick way was introduced by Nabisco in a mid-1990s TV ad campaign for Oreos, their famous cream-filled cookie sandwich: Hold one side of the cookie while your friend holds the other, twist, and see who ends up with the cream.

Except, as a group of Princeton University physicists recently discovered, there’s a way to predict exactly which side the cream ends up on.

“The Oreo was our generation’s wishbone”

In 2014, John Cannarella, Dan Quinn, and Joshua Spechler were all graduate students in the mechanical and aerospace engineering program at Princeton. At 4pm every day, their department would put out coffee and cookies, including—surprise—Oreos. For months, teatime went by without the trio giving a second thought to the cookies, but then one day the Oreo twist-off game came up. “The Oreo was our generation’s wishbone,” says Quinn, currently a postdoc at Stanford University.

Cannarella claimed he had a childhood friend who always won the Oreo twist-off game. This being a group of scientists, they decided to investigate.

“It’s interesting from an engineering standpoint since the cookie is similar to many modern composites: a strong brittle layer (the wafer) for strength coupled with a weaker ductile layer (the cream) for toughness,” says Cannarella, currently a mechanical engineering consultant at DuPont. “Shatterproof glass and batteries are other good examples of material systems that are mechanically analogous to Oreos.” Carbon fiber and glass fiber composites—common in aerospace and racecar design— also fit the description. These are all systems that combine high-strength but brittle materials with low strength ductile ones for high toughness.

“One of our first thoughts was someone must know [the answer],” says Spechler, now a hardware engineer at Apple. But there was nothing in the literature—or in Google’s search results, which made them think that they might be the only ones who actually cared. Or maybe there just was no way to predict the outcome of an Oreo twist-off. Intuition would say there’s no advantage,” says Spechler. In other words, the twist-off game should provide results analogous to a coin flip.

Nevertheless, they sat down and really tried to analyze the mechanical physics of the cookie. ”We threw the books at it,” Spechler says.

“We’d break the cookies out at parties and tell people they needed to be live subjects.”

That meant a combination of lab tests and real-world experiments. For example, they stuck the cookies into a load frame, a support structure designed to repeatedly test forces on objects. In this case, the cookie was held in place by two metal arms, and the top arm pulled the upper wafer to apply and measure tensile load (the capacity of the cookie to withstand a pulling force) and displacement (basically, what happened to the cream). They also used a rotation rig to see what would happen to the cream when the two wafers were twisted separate, as opposed to pulled straight apart.

In the meanwhile, “we’d break them out at parties and tell people they needed to be live subjects,” says Quinn. “The hope was we’d find some sort of strategy like twisting faster or at an angle.”

Nothing seemed to work. They were going through hundreds, if not thousands of cookies. “We’d go to Sam’s Club and get the bulk boxes,” says Spechler. “We’re talking on an order of 300-500 Oreos.”

The history of the Oreo is a master class in marketing. In 1908, Sunshine Biscuits debuted the Hydrox cookie: two embossed chocolate wafers with a vanilla cream between. Four years later, the National Biscuit Company (aka Nabisco) filed a patent for a cookie comprised of “two beautifully embossed chocolate-flavored wafers with a rich cream filling.” The Oreo was released soon after.

It rapidly overtook its competitor, due in part to Nabisco’s superior size and marketing budget, but also because of the company’s wise strategy: to present the Oreo as the “highest class biscuit.” (The name also may have helped. “Hydrox” was a combination of “hydrogen” and “oxygen” and meant to imply purity of ingredient, but it mostly sounds like a cleaning product—not exactly what you want someone to think of when they’re eating dessert.)

Over the years, Nabisco continued to innovate, coming out with variations like the lemon-filled Oreo, the “Double Stuf” [sic] Oreo, and more. In the 21st century, Nabisco’s parent company Mondelez International became a sort of marketing media darling with its real-time marketing strategies, including putting out ads responding directly to the zeitgeist (e.g. a multi-layered rainbow cookie for Pride Week) and releasing a mobile app called Twist, Lick, Dunk that was so successful it reportedly turned a profit.

In my mind, though, nothing compares to the advertising success Oreos had in the 1990s. Of course, this has everything to do with the fact that mine was a Hydrox family. I was eternally jealous of those who got to eat Oreos, which I thought “unlocked” some sort of “magic” that would maybe get me a golden retriever puppy and, more importantly, tell me which middle-school girl was destined to be my wife, with just one twist.

Thousands of cookies later, the Princeton researchers finally realized the 25-year-old game was rigged: The cream ends up on the same side, for every cookie in a box.

Here’s how it works: Position the Oreo box so that the text on the packaging is facing the right way, and take out the cookie in the upper left hand corner. If the cream ends up on the left biscuit on one cookie, it’ll end up on the left biscuit for every cookie in that box. If it’s on the right, vice versa.

Once they figured that out, “it was easy to make the leap that it’s a feature of the manufacturing process,” says Quinn.

Which side is the weaker wafer-to-cream interface?

Nabisco won’t divulge its Oreo secrets, but in 2010, Newman’s Own—which makes a very similar “Newman-O”—let the Discovery Channel into its factory to see how their version of cookies are made. The key aspect for twist-off purposes: A pump applies the cream onto one wafer, which is then sent along the line until a robotic arm places a second wafer on top of the cream shortly after. The cream always adheres better to one of these wafers—and all of the cookies in a single box end up oriented in the same direction.

Which side is the stronger wafer-to-cream interface? “We think we know,” says Spechler. The key is that fluids flow better at high temperatures. So the hot cream flows easily over the first wafer, filling in the tiny cracks of the cookie and sticking to it like hot glue, whereas the cooler cream just kind of sits on the edges of those crevices.

It’s a bit mundane, the three engineers admit, but it’s concrete. So you can throw out the loaded dice and give up on trying to solve the rocks-paper-scissors game theory. To rig a decision, just keep a box of Oreos at hand.