Beneath the varnish of flashing lights and free cocktails, casinos stand on a bedrock of mathematics engineered to slowly bleed their patrons of cash. For years mathematically inclined minds have tried to turn the tables by harnessing their knowledge of probability and game theory. Several have even succeeded in the short run, winning big bets and impressing fellow gamblers with their ability to “beat the house.” But in the long run, all casino games are statistically designed to make money for the house.

In an age where the concept of gambling is often misunderstood, it is useful to take a closer look at the history of casinos and the role they play in our society. While casinos rely on the allure of free drinks, exotic locales and elaborate themes to lure patrons in, they are essentially business enterprises that rake in billions of dollars each year for their owners, investors, Native American tribes and state and local governments.

In the 1990s, technological advances made it possible for casinos to incorporate computers into all aspects of their operations. These technologies have radically improved casino security by providing an “eye-in-the-sky” effect that allows surveillance workers to monitor every table, room and window simultaneously. Some casinos also use computer technology to assist their dealers in detecting cheating or suspicious behavior. For example, in a system called chip tracking, betting chips have built-in microcircuitry that interacts with electronic systems to enable the casinos to supervise the exact amounts placed minute by minute and instantly discover any statistical deviation from expected results.