science

Peanut Butter vs. Nut Effect

·5 min read

Smooth vs. Crunchy

Want the serious version? I also wrote this up as a very straight-faced paper — Peanut Butter vs. Nut Effect: Smooth vs. Crunchy (PDF, 9 pages), with methods and 40 references. This post is the fun one.

As I stare into the sea of M&Ms that I have poured into this container, with the peanuts at the bottom and the peanut butter at the top, my mind can’t help but wonder…

That optimal bite mix

Here’s my setup. One container, two kinds of M&Ms: peanut and peanut butter. And one firm belief about snacks: every handful should be fair. Same mix of smooth and crunchy, no matter where you scoop.

So you flip the container. You shake it. At some point you’ve stopped preparing a snack and started running a small, unlicensed particle accelerator. When, exactly, were you done?

The container is a sealed tub with a square-ish footprint, which the simulation treats as a cube. The bigger, oblong peanut M&Ms start at the bottom. The smaller, disc-like peanut butter ones sit in the top third. The goal is that every part of the tub ends up with the same ratio of smooth to crunchy — without opening the lid and redistributing by hand like a snack dictator.

My container, with candies nearly reaching its lid
My container. The lid hides the top of the pile, so I can't tell exactly how much headspace there is from this photo.

First, the scale

Before any shaking, I got out a kitchen scale. Ten peanut butter M&Ms weigh 17.2 g. Ten peanut M&Ms weigh 23.8 g. That’s 1.72 g versus 2.38 g each — the peanut ones are about 38% heavier, not several times heavier.

That matters, because my simulation assumes the two candies have the same density, and the size setting I used implies roughly a fourfold difference in mass. So the simulation exaggerates the contrast. (One batch of ten each is a single-batch average, not a density measurement, so don’t read more into it than that.) The simulations are exploratory and now need a recalibration. Shape matters too: different gaps, different rolling, different ways to annoy a physicist.

A stainless steel kitchen scale with large orange and small teal candies on it
A sketch of the weigh-in. (AI-generated illustration, colors included. The real scale photos are just below.)
Ten peanut butter M&Ms on a kitchen scale reading 17.2 g
Peanut butter: 17.2 g for ten candies.
Ten peanut M&Ms on a kitchen scale reading 23.8 g
Peanut: 23.8 g for ten candies.

Both photos above are AI-retouched for presentation. The original, unretouched photos are here: peanut butter · peanut

The Brazil nut has entered the chat

In a moving pile of grains, little pieces can slip into gaps that big pieces can’t. Do that over and over and the mix can sort itself instead of getting more mixed. The famous version is the Brazil nut effect: shake a can of mixed nuts and the big ones end up on top. The real story depends on shape, friction, gravity, the container, and how you move it. There’s no universal law saying every peanut must rise to the top.

Illustration of small teal candies slipping down through the gaps between large orange candies, with arrows and dotted outlines showing the empty spaces
Why a mix can sort itself: small pieces slip into the gaps the big ones leave behind. (AI-generated illustration.)

That’s why “just shake it harder” isn’t a protocol. It’s a personality trait.

Gentle tumbling can set off little avalanches that carry candies across the old boundary. Vigorous shaking can actually make things separate more. Spinning the container continuously is a different motion again: at high enough speeds, the candies spend more time riding along the wall. Effort and fairness don’t have a straight-line relationship. You can make your snack less democratic while feeling more confident about it.

Close-up of a clear tub with large orange candies on top of a layer of small teal candies
The Brazil nut effect, imagined: the big pieces end up on top. (AI-generated illustration, so the colors are artistic license.)

Which way do you flip it?

A cube gives you a few dignified ways to look ridiculous. Spin it through the centers of opposite faces and the pile keeps meeting a familiar geometry. Spin it through opposite edge midpoints and the corners take turns joining in. Spin it along a body diagonal and the tilt relative to gravity follows yet another path.

The diagonal isn’t guaranteed to win. It has a vertical component, while my face and edge axes are horizontal, so the comparison mixes geometry with tilt. Even candy science has to show its work.

Headspace is where the plot happens

A nearly full container leaves the candies no room to rearrange. A little empty space lets them tumble; too much changes the collisions again. The best fill level is something to test, not something to announce while waving a jar at an authoritative angle.

Three clear tubs on a lab bench with low, medium and nearly full amounts of orange and teal candies
Same tub, three fill levels. How much headspace is best is something to test. (AI-generated illustration.)

To measure how mixed it is, I count the peanut fraction in three equal-count height bands and compute a Lacey-style mixing index: zero means fully separated, and roughly one means random mixing at the scale I’m sampling. I also require every band to be within five percentage points of the overall peanut fraction, because one nice-looking number can hide a pocket of trouble somewhere in the cube.

Critical applications, obviously

Picture a lone astronaut on Mars. After months of potatoes, a statistically unfair handful of trail mix could become a diplomatic incident involving one person. Picture a rocket whose snack inventory shifts during launch — nobody wants dessert destabilizing the vehicle, though to be clear this is emphatically not a flight qualification test. Picture submarine morale, Antarctic game night, and the International Committee for Equitable Trail Mix. (Those sponsors are imaginary. Their snack opinions are extremely real.)

An astronaut in a white spacesuit sits on a rock on Mars, holding a clear tub of orange and teal candies, with a rocket and a setting sun in the background
The Mars snack emergency, as imagined by an AI illustrator. Note the carefully rationed tub.

What my kitchen says

My own unscientific finding is that about six spins seemed to work well: a few end-over-end turns, then some sideways shuffles. The photo shows rounded corners and candies nearly up to the lid, with very little headspace. The lid is opaque, so a precise fill percentage would be a guess, and candy colors aren’t a reliable way to tell the two types apart. So this is a useful household observation, not a counted mixing measurement.

A person shaking a clear tub of orange and teal candies, shown with motion blur
The technique, as imagined by an AI illustrator: a few end-over-end turns, then some sideways shuffles. (AI-generated illustration.)

The question I find most interesting is the sequence. Does changing the motion break up the regions that one repeated motion leaves behind? My next small comparison tests fixed-axis tumbling, switching to a perpendicular axis, and flips followed by horizontal shuffles. Those are controlled approximations, not a reconstruction of what my hands actually do. And my original sweep used a nominal fill of 35–65%, which doesn’t reproduce this much fuller container — so the snacks have asked for a more realistic lab.

Here’s the toy version of that comparison: a few flips, then some sideways shuffles.

Four flips, then eight sideways shuffles, same toy simulation. In this run the shuffles did not help: it ends with the worst band 27.5 points off, versus 19.6 after the flips. A toy for illustration, not a result.

The ten-flip rule

Here’s my household rule: try ten gentle end-over-end flips, leave some headspace, and take a look. Ten is a memorable starting point, not an experimentally established minimum, and my loosely counted six-spin sequence is a separate observation. One more detail: a flip here means a half-turn, while the simulation reports full 360-degree rotations. Ten flips is five rotations, not ten. That distinction might save the entire field from doubling its snack budget.

Want to watch it? Here are ten flips in a little blueprint-style toy simulation (pause and restart it as much as you like):

Ten flips, as a blueprint. This is a toy 2D simulation for fun, not the Godot results from the paper. In this run the candies are nearly mixed after flip 3 (the worst band is 2.6 points off), un-mix by flip 6 (46 points off), and are back within 7 points by flip 10. Effort and fairness really don't make a straight line.

The simulation is a Godot experiment with 900 rigid bodies and Jolt physics. I call it “plausibly granular”: good for exploring ideas, not a substitute for measured candy friction or a proper model of granular materials. The sweep tests the joke rather than coding ten into the answer.

My Ig Nobel pitch is ready: work out how much effort humanity should spend before eating something it was going to eat anyway. Funding: self-funded, snacks. The main obstacle to replication is that the test subjects keep disappearing during peer review.

Further reading

The full paper (PDF, 9 pages) — the straight-faced version, with methods, pilot results and 40 references.

Granular mixing and segregation · Shape and mixing · Lacey mixing index