Editor's note: The following is an excerpt from The Power of Habit: Why We Do What We Do in Life and Business (Random House, 2012) by Charles Duhigg

In 2010, a cognitive neuroscientist named Reza Habib asked twenty-two people to lie inside an MRI and watch a slot machine spin around and around.

I spoke to Reza Habib when I was reporting my book, The Power of Habit: Why We Do What We Do in Life and Business, because I was researching the case of a woman named Angie Bachmann who had lost of $1 million gambling, and then had claimed in court that she shouldn't be held accountable for her losses, because the casinos had taken advantage of gambling habits over which she had no control.

It wasn't a ridiculous claim. Just a few years earlier, a man in Britain had defended himself from murdering his wife as they slept by claiming that he suffered from 'night terrors,' and that he had strangled her while dreaming of an intruder. His self-defense habits, he argued, had kicked in, and thus he bore no blame. He was set free by the jury. Bachmann was hoping for something similar, and was hoping that experiments like Habib's would make her case.

Half of the participants in Habib's experiment were “pathological gamblers” — people who had lied to their families about their gambling, missed work to gamble, or had bounced checks at a casino — while the other half were people who gambled socially but didn’t exhibit any problematic behaviors.

Everyone was placed on their backs inside a narrow tube and told to watch wheels of lucky 7s, apples, and gold bars spin across a video screen. The slot machine was programmed to deliver three outcomes: a win, a loss, and a “near miss,” in which the slots almost matched up but, at the last moment, failed to align. None of the participants won or lost any money. All they had to do was watch the screen as the MRI recorded their neurological activity.

“We were particularly interested in looking at the brain systems involved in habits and addictions,” Habib told me. “What we found was that, neurologically speaking, pathological gamblers got more excited about winning. When the symbols lined up, even though they didn’t actually win any money, the areas in their brains related to emotion and reward were much more active than in nonpathological gamblers.

“But what was really interesting were the near misses. To pathological gamblers, near misses looked like wins. Their brains reacted almost the same way. But to a nonpathological gambler, a near miss was like a loss. People without a gambling problem were better at recognizing that a near miss means you still lose.”

Two groups saw the exact same event, but from a neurological perspective, they viewed it differently. People with gambling problems got a mental high from the near misses— which, Habib hypothesizes, is probably why they gamble for so much longer than everyone else: because the near miss triggers those habits that prompt them to put down another bet. The nonproblem gamblers, when they saw a near miss, got a dose of apprehension that triggered a different habit, the one that says I should quit before it gets worse.

It’s unclear if problem gamblers’ brains are different because they are born that way or if sustained exposure to slot machines, online poker, and casinos can change how the brain functions. What is clear is that real neurological differences impact how pathological gamblers process information—which helps explain why Angie Bachmann lost control every time she walked into a casino. Gaming companies are well aware of this tendency, of course, which is why in the past decades, slot machines have been reprogrammed to deliver a more constant supply of near wins.

In fact, Harrah’s Entertainment—the company that owned the casino where Bachmann played—was known within the gaming industry for the sophistication of its customer-tracking systems. At the core of that system were computer programs that studied gamblers’ habits and tried to figure out how to persuade them to spend more. The company assigned players a “predicted lifetime value,” and software built calendars that anticipated how often they would visit and how much they would spend. The company tracked customers through loyalty cards and mailed out coupons for free meals and cash vouchers; telemarketers called people at home to ask where they had been. Casino employees were trained to encourage visitors to discuss their lives, in the hopes they might reveal information that could be used to predict how much they had to gamble with. One Harrah’s executive called this approach “Pavlovian marketing.”

And it's not just Harrah's. Gamblers who keep betting after near wins are what make casinos, racetracks, and state lotteries so profitable.

“Adding a near miss to a lottery is like pouring jet fuel on a fire,” said a state lottery consultant who spoke to me on the condition of anonymity. “You want to know why sales have exploded? Every other scratch- off ticket is designed to make you feel
like you almost won.”

The areas of the brain that Habib scrutinized in his experiment—the basal ganglia and the brain stem—are the same regions where habits reside (as well as where behaviors during sleep terrors start). In the past decade, as new classes of pharmaceuticals have emerged that target that region— such as medications for Parkinson’s disease—we’ve learned a great deal about how sensitive some habits can be to outside stimulation. Class action lawsuits in the United States, Australia, and Canada have been filed against drug manufacturers, alleging that pharmaceuticals caused patients to compulsively bet, eat, shop, and masturbate by targeting the circuitry involved in the habit loop.

In 2008, a federal jury in Minnesota awarded a patient $8.2 million in a lawsuit against a drug company after the man claimed that his medication had caused him to gamble away more than $250,000. Hundreds of similar cases are pending.

“In those cases, we can definitively say that patients have no control over their obsessions, because we can point to a drug that impacts their neurochemistry,” said Habib. “But when we look at the brains of people who are obsessive gamblers, they look very similar—except they can’t blame it on a medication. They tell researchers they don’t want to gamble, but they can’t resist the cravings. So why do we say that those gamblers are in control of their actions and the Parkinson’s patients aren’t?”

But for Angie Bachmann, the arguments would become much, much more complicated.