A casino is a gambling establishment where people come to try their luck at games of chance like poker, roulette, and blackjack. They’re often designed to be exciting places with flashy decor and upbeat music where guests can drink and socialize while trying their hand at luck. Many casinos also offer restaurants and entertainment options for guests to enjoy.

Beneath the varnish of glitzy lights and free drinks, casinos stand on a bedrock of mathematics, engineered to slowly drain patrons of their cash. For years, mathematically inclined minds have tried to turn the tables on a system they believe is rigged by applying the principles of probability and game theory.

In the opening scene of Robert De Niro’s 1995 classic Casino, a prowling Steadicam glides through closed doors into the inner sanctum of the Tangiers, a notorious casino in Las Vegas where Sam “Ace” Rothstein (De Niro) runs the money operations. Skimming off the top is an art, one that Ace counts on to fund his lifestyle and maintain his position as Sin City’s king of big bets.

In a casino, the goal is to distract and disorient players so they keep playing and spending money. To accomplish this, designers remove all indications of time and space, from the clock to signs that point the way to the bathroom. This way, the player never knows how long they’ve been in the casino and can’t rationally consider leaving. It’s a strategy that has worked for many casinos, but it’s not foolproof.