Beneath the veneer of flashing lights and free drinks, casinos are built on a bedrock of mathematics designed to slowly bleed patrons of their cash. For years mathematically inclined minds have attempted to turn the tables by using their knowledge of probability and game theory to exploit a rigged system.

But how do casinos make rational people — people who work hard for their money and make reasoned financial decisions on a day-to-day basis — throw hundreds or even thousands of dollars away based on the literal roll of the dice, spin of the wheel, or draw of the cards? The answer is complex, but in part it involves the psychology of gambling and the allure of the jackpot.

Casinos also use a variety of other techniques to lure customers. For example, they offer booze, which can lower inhibitions and cloud judgment. They also rely on the sunk cost fallacy, encouraging players to chase their losses by placing bigger bets in the hopes that they will eventually break even. And they take advantage of the sunk-cost fallacy by offering rewards programs that allow patrons to earn points for every dollar played, no matter whether they win or lose.

Finally, the ambiance of a casino can create a sense of excitement and drama. The bright lighting, the music, and the spectacles of go-go dancers and celebrity performers all contribute to the glitz and glamour that has made casinos such a draw for millions of people.