Photo by Quinn Dombrowski (CC BY-SA 2.0)

A Russian mathematician from St. Petersburg named Alex has quite the talent: he reverse engineers the pseudorandom number generators (PRNGs) that govern how slot machines behave. His team of field agents roams casinos around the world and “milk” the machines whose algorithms they’ve cracked.

Here’s how it works: an agent records a video of a targeted slot machine, sends the footage back to St. Petersburg, and Alex analyzes the slot’s behavior to determine the moment it will pay out. “By using these cues to beat slots in multiple casinos,” writes Brendan Koerner in Wired, “a four-person team can earn more than $250,000 a week.”

After interviewing Alex on the record, Koerner tells the story of this programmer-turned-hacker and what he views as his Robin Hood-like crusade against the global gambling industry.

In the course of reverse engineering Novomatic’s software, Alex encountered his first PRNG. He was instantly fascinated by the elegance of this sort of algorithm, which is designed to spew forth an endless series of results that appear impossible to forecast. It does this by taking an initial number, known as a seed, and then mashing it together with various hidden and shifting inputs—the time from a machine’s internal clock, for example. Writing such algorithms requires tremendous mathematical skill, since they’re supposed to produce an output that defies human comprehension; ideally, a PRNG should approximate the utter unpredictability of radioactive decay.

After wrapping up the casino gig, Alex spent six months teaching himself everything he could about PRNGs—in part because he admired their beauty but also because he knew that such expertise could prove profitable. “I mastered it to the point where I can develop such algorithms myself, on a level I am yet to see in a gambling machine,” says Alex, who will never be accused of lacking confidence. “It’s in my bloodstream now. I feel the numbers; I know how they move.”

Read the story

Cheri Lucas Rowlands

Cheri has been an editor at Longreads since 2014. She's currently based in the San Francisco Bay Area.