Beneath the glitter of flashing lights and free cocktails, casinos stand on a bedrock of mathematics, engineered to slowly bleed their patrons of their cash. For years, mathematically inclined minds have tried to turn the tables by harnessing their knowledge of probability and game theory to beat a system that seems designed to defeat them.

Most modern casino games originated in Europe, where they were first played in small clubhouses known as casin. The term became well established in English, and casinos of this type opened throughout the United Kingdom in the latter half of the 20th century. In the United States, the advent of Native American gaming and the expansion of state-regulated gambling has led to a rapid growth in the number of casinos.

With large amounts of money passing through their doors, casinos are often a target for cheating and stealing by both patrons and employees. To combat these dangers, most casinos employ a variety of security measures. Some of these are obvious, such as security cameras located throughout the facility. Others are more subtle, such as the routines and patterns that characterize many casino games—the way dealers shuffle cards, for example, or the locations of betting spots on a table—which make it easier for security personnel to spot deviations from the norm.

Nevertheless, the security challenges facing casinos are ever-changing. To keep up, they are increasingly turning to computer programs and sophisticated analytics to enhance their surveillance capabilities and to identify potential problem gamblers.