How Pinball Leagues and Chemistry Work: The Mathematics

My love and I play in several pinball leagues. I need to explain something of how they work.

Most of them organize league nights by making groups of three or four players and having them play five games each on a variety of pinball tables. The groupings are made by order. The 1st through 4th highest-ranked players who’re present are the first group, the 5th through 8th the second group, the 9th through 12th the third group, and so on. For each table the player with the highest score gets some number of league points. The second-highest score earns a lesser number of league points, third-highest gets fewer points yet, and the lowest score earns the player comments about how the table was not being fair. The total number of points goes into the player’s season score, which gives her ranking.

You might see the bootstrapping problem here. Where do the rankings come from? And what happens if someone joins the league mid-season? What if someone misses a competition day? (Some leagues give a fraction of points based on the player’s season average. Other leagues award no points.) How does a player get correctly ranked?

This demands another question: what is correct ranking? One obvious answer is to say the ranking depends on who beats who. If a player regularly beats all those lower-ranked than she is, but regularly loses to all those higher-ranked than she is, then she’s correctly ranked. Note the phrase “regularly”. Pinball is a skilled game, but that doesn’t mean there’s no randomness. Wizards have lousy nights and newbies have incredibly lucky games. And don’t think the experienced players aren’t silently fuming when someone who had to be shown how to hit the flippers puts up the highest score of the night. But, on average, if she’s ranked correctly, she beats lower-ranked players and loses to higher-ranked ones.

If everybody’s correctly ranked, then … well, people are going to be playing people roughly as skilled as they are. Most players are going to have average nights. They might expect one first, one second, one third, and one fourth place finish, and the lats game of the night will be … something.

Now here’s the interesting thing. What happens if a player is dislodged from her “correct” ranking?

Suppose that she missed a night, and so, having no points for that night, was put well below her skill level. It’s easy to imagine what will happen. She’ll clean up. If she’s playing against people much less skilled, she could get five first-place finishes and shoot back up in the rankings easily.

Consider the less-happy-for-her alternative. The first night of the league’s season, let’s say, she gets lucky and hits first and second place finishes. This wins enough points to be ranked at the top of the league, far better than her real skill level directs. (This has happened to me!) It’s easy to picture the next league night, too. Playing against much better people she can expect a string of fourth-place finishes, with maybe a third-place to save pride. Her rank plummets. (See previous parentheses.)

Where does the rise stop? Where does the plummet stop? And we know already. It stops when she’s playing roughly equally skilled players and is as likely to come in first as in fourth.

There’s a term for this. It comes from statistical mechanics, the study of systems where there are too many things interacting in such complicated ways that it’s impossible to track everything. We track instead what the distributions are. In the pinball league example that is things like how likely it is our player will be ranked #1, or #2, or #20, or #40, or so.

The term is “detailed balance”. This is the state in which we are just as likely to see the system move away from its current state as we are to see it move back in again. In the pinball league case, that means we’re as likely to see our player jump from (say) #22 up to #20 as we are to see her drop from #20 to #22. At least we do if the player really should be ranked around #20 or #22 or so.

If the player’s ranked too low, say she’s placed at #44 when she should be at #20, then she’s very likely to rise and not at all likely to fall. If the player’s ranked too high, say she’s placed at #3 when she should be at #22, then she’s very likely to fall and not very likely to rise. There will be fluke events, certainly; everyone has good and catastrophic nights. But in the long run, if the season goes on enough, we can expect her ranking to settle somewhere near her relative skill level.

“Detailed balance” comes to us from chemistry and thermodynamics and mathematical physics rather than competitive pinball. It describes when the state of the system stops changing.

The classic example from thermodynamics is to imagine a room in which all the gas molecules are crowded into the left side of the room, and none in the right. The gas molecules may all be moving randomly around. But we’ll see molecules move from the left half to the right much more than we’ll see them move from the right half to the left. We have to be; there aren’t any molecules on the right half, while some of the ones on the left half are moving to the right. This is a time when exciting stuff is happening, as introductory thermodynamics problems go, and gas is rushing from the left half to the right.

But fairly soon the gas spreads out to be about uniformly distributed, left and right. When that happens there’ll be about as many molecules on the left half moving right as there are on the right half moving left. And that’s the detailed balance. Stuff is still happening, the molecules are still shuffling around, but the overall system is settled down.

The concept appears in chemistry as well, in subtler forms. When we mix together molecules, there might be a chemical reaction. They interact and turn into some new set of molecules. There’s some probability of the thing you start with — the substrate — turning into the thing you end with — the product. At least if the right ingredients and maybe catalyst are close enough together and if they have the energy available and whatnot. But there’s also some probability of the products undoing the reaction, restoring the molecules we started with.

(I should point out this is a very cartoon sketch of chemistry. Don’t try to pass a course on this basis. Also, chemists, please don’t get mad at me. I know. I’m also cutting out a lot of competitive-pinball rules for the sake of getting this point across.)

In your typical chemical reaction, the probability of going from the substrate to the product is high, while the probability of going from the product to the substrate is low. If you have a lot of the substrate and almost none of the product, that indicates we’ll see a lot of the product being made fairly soon. This is like the gas molecules all being on the left-hand side of the chamber, or like the pinball player being ranked well below her skill level.

Imagine there were no substrate, nothing but product molecules. (And maybe catalyst, if we need that.) Then we would have to see some of the reverse reaction, product turning back into substrate; nothing else is possible.

Eventually, though, we get to the detailed balance. The amount of substrate turning into product at any moment will be about equal to the amount of product turning back into substrate. This will happen when there’s little enough substrate, likely enough to turn into product, that it equals the large amount of product, barely likely to turn into substrate.

The mathematics of that detailed balance can be simple, mercifully. If we know the mass of the substrates and the probability of their reacting in a moment, we can say that mass times that probability is turning into product. If we know the mass of the product and the probability of their reversing the reaction, we can say that mass times that probability is the amount turning back into substrate. Which of those numbers is larger tells us what chemical reaction is happening. And, to an extent, the mathematics of it working is similar to the mathematics of how someone’s pinball league ranking works.