Gambling mathematics
Experiments, events and probability spaces. The technical processes of a game stand for experiments that generate aleatory events. Here are a few examples: The probability model. A probability model starts from an experiment and a mathematical structure attached to that experiment, namely the space (field) of events. The event is the main unit probability theory works on. In gambling, there are many categories of events, all of which can be textually predefined. In the previous examples of gambling experiments we saw some of the events that experiments generate. They are a minute part of all possible events, which  in fact is the set of all parts of the sample space. For a specific game, the various types of events can be: Each category can be further divided into several other subcategories, depending on the game referred to. These events can be literally defined, but it must be done very carefully when framing a probability problem. From a mathematical point of view, the events are nothing more than subsets and the space of events is a Boolean algebra. Among these events, we find elementary and compound events, exclusive and nonexclusive events, and independent and non-independent events. In the  experiment of rolling a die: In the experiment of dealing the pocket cards in Texas Hold’em Poker: These are a few examples of gambling events, whose properties of compoundness, exclusiveness and independency are easily observable. These properties are very important in practical probability calculus. The complete mathematical model is given by the probability field attached to the experiment, which is the triple "sample space—field of events—probability function". For any game of chance, the probability model is of the simplest type—the sample space is finite, the space of events is the set of parts of the sample space , implicitly finite, too, and the probability function is given by the definition of probability on a finite space of events: Combinations. Games of chance are also good examples of combinations, permutations and arrangements, which are met at every step: combinations of cards in a player's hand, on the table or expected in any card game; combinations of numbers when rolling several dice once; combinations of numbers in lottery and bingo; combinations of symbols in slots; permutations and arrangements in a race to be bet on, and the like. Combinatorial calculus is an important part of gambling probability applications. In  games of chance, most of the gambling probability calculus in which we use the classical definition of probability reverts to counting combinations. The gaming events can be identified with sets, which often are sets of combinations. Thus, we can identify an event with a combination. For example, in a five draw poker game, the event "at least one player holds a four of a kind formation" can be identified with the set of all combinations of (xxxxy) type, where "x" and "y" are distinct values of cards. This set has 13C(4,4)(52-4)=624 combinations. Possible combinations are (3♠ 3♣  3♥ 3♦ J♣) or (7♠ 7♣ 7♥ 7♦ 2♣). These can be identified with elementary events that the event to be measured consists of. Expectation and strategy. Games of chance are not merely pure applications of probability calculus and gaming situations are not just isolated events whose numerical probability is well established through mathematical methods; they are also games whose progress is influenced by human action. In gambling, the human element has a striking character. The player is not only interested in the mathematical probability of the various gaming events, but he  or she has expectations from the games while a major interaction exists. To obtain favorable results from this interaction, gamblers take into account all possible information, including statistics, to build gaming strategies. The oldest and most common betting system is the martingale, or doubling-up, system on even-money bets, in which bets are doubled progressively after each loss until a win occurs. This system probably dates back to the invention of the roulette wheel. Two other well-known systems, also based on even-money bets, are the d’Alembert system (based on theorems of the French mathematician Jean Le Rond  d’Alembert), in which the player increases his bets by one unit after each loss but decreases it by one unit after each win, and the Labouchere system (devised by the British politician Henry Du Pré Labouchere, although the basis for it was invented by the 18th-century French philosopher Marie-Jean-Antoine-Nicolas de Caritat, marquis de Condorcet), in which the player increases or decreases his bets according to a certain combination of numbers chosen in advance. The predicted average gain or loss is called "expectation" or expected value and is the sum of the probability of each possible outcome  of the experiment multiplied by its payoff (value). Thus, it represents the average amount one expects to win per bet if bets with identical odds are repeated many times. A game or situation in which the expected value for the player is zero (no net gain nor loss) is called a "fair game. "The attribute "fair "refers not to the technical process of the game, but to the chance balance house (bank)–player. Even though the randomness inherent in games of chance would seem to ensure their fairness (at least with respect to the players around a table—shuffling a deck  or spinning a wheel do not favor any player except if they are fraudulent), gamblers always search and wait for irregularities in this randomness that will allow them to win. It has been mathematically proved that, in ideal conditions of randomness, and with negative expectation, no long-run regular winning is possible for players of games of chance. Most gamblers accept this premise, but still work on strategies to make them win either in the short term or over the long run. House advantage or edge. Casino games provide a predictable long-term advantage to the casino, or "house" while  offering the player the possibility of a large short-term payout. Some casino games have a skill element, where the player makes decisions; such games are called "random with a tactical element." While it is possible through skillful play to minimize the house advantage, it is extremely rare that a player has sufficient skill to eliminate his inherent long-term disadvantage (the house edge or house vigorish) in a casino game. The common belief is that such a skill set would involve years of training, extraordinary memory, and numeracy, and/or acute visual or even aural observation, as in the case  of wheel clocking in Roulette. For more examples see Advantage gambling. The player's disadvantage is a result of the casino not paying winning wagers according to the game's "true odds", which are the payouts that would be expected considering the odds of a wager either winning or losing. For example, if a game is played by wagering on the number that would result from the roll of one die, true odds would be 5 times the amount wagered since there is a 1/6 probability of any single number appearing. However, the casino may only pay 4 times the  amount wagered for a winning wager. The house edge (HE) or vigorish is defined as the casino profit expressed as a percentage of the player's original bet. In games such as Blackjack or Spanish 21, the final bet may be several times the original bet, if the player doubles or splits. Example: In American Roulette, there are two zeroes and 36 non-zero numbers (18 red and 18 black). If a player bets $1 on red, his chance of winning $1 is therefore 18/38 and his chance of losing $1 (or winning -$1) is 20/38. The  player's expected value, EV = (18/38 x 1) + (20/38 x -1) = 18/38 - 20/38 = -2/38 = -5.26%. Therefore, the house edge is 5.26%. After 10 rounds, play $1 per round, the average house profit will be 10 x $1 x 5.26% = $0.53. Of course, it is not possible for the casino to win exactly 53 cents; this figure is the average casino profit from each player if it had millions of players each betting 10 rounds at $1 per round. The house edge of casino games varies greatly with the game. Keno  can have house edges up to 25% and slot machines can have up to 15%, while most Australian Pontoon games have house edges between 0.3% and 0.4%. The calculation of the Roulette house edge was a trivial exercise; for other games, this is not usually the case. Combinatorial analysis and/or computer simulation is necessary to complete the task. In games that have a skill element, such as Blackjack or Spanish 21, the house edge is defined as the house advantage from optimal play (without the use of advanced techniques such as card counting or shuffle tracking), on the first hand  of the shoe (the container that holds the cards). The set of the optimal plays for all possible hands is known as "basic strategy" and is highly dependent on the specific rules, and even the number of decks used. Good Blackjack and Spanish 21 games have to house edges below 0.5%. Online slot games often have a published Return to Player (RTP) percentage that determines the theoretical house edge. Some software developers choose to publish the RTP of their slot games while others do not. Despite the set-theoretical RTP, almost any outcome is possible in the short term. Standard  deviation. The luck factor in a casino game is quantified using standard deviation (SD). The standard deviation of a simple game like Roulette can be simply calculated because of the binomial distribution of successes (assuming a result of 1 unit for a win, and 0 units for a loss). For the binomial distribution, SD is equal to formula_1, where formula_2 is the number of rounds played, formula_3 is the probability of winning, and formula_4 is the probability of losing. Furthermore, if we flat bet at 10 units per round instead of 1 unit, the range of possible outcomes increases 10  fold. Therefore, SD for Roulette even-money bet is equal to formula_5, where formula_6 is the flat bet per round, formula_2 is the number of rounds, formula_8, and formula_9. After enough large number of rounds the theoretical distribution of the total win converges to the normal distribution, giving a good possibility to forecast the possible win or loss. For example, after 100 rounds at $1 per round, the standard deviation of the win (equally of the loss) will be formula_10. After 100 rounds, the expected loss will be formula_11. The 3 sigma range is six times the standard deviation : three above the mean, and three below. Therefore, after 100 rounds betting $1 per round, the result will very probably be somewhere between formula_12 and formula_13, i.e., between -$34 and $24. There is still a ca. 1 to 400 chance that the result will be not in this range, i.e. either the win will exceed $24, or the loss will exceed $34. The standard deviation for the even-money Roulette bet is one of the lowest out of all casinos games. Most games, particularly slots, have extremely high standard deviations. As the size of the potential  payouts increase, so does the standard deviation. Unfortunately, the above considerations for small numbers of rounds are incorrect, because the distribution is far from normal. Moreover, the results of more volatile games usually converge to the normal distribution much more slowly, therefore much more huge number of rounds are required for that. As the number of rounds increases, eventually, the expected loss will exceed the standard deviation, many times over. From the formula, we can see the standard deviation is proportional to the square root of the number of rounds played, while the expected loss is proportional to the number  of rounds played. As the number of rounds increases, the expected loss increases at a much faster rate. This is why it is practically impossible for a gambler to win in the long term (if they don't have an edge). It is the high ratio of short-term standard deviation to expected loss that fools gamblers into thinking that they can win. The volatility index (VI) is defined as the standard deviation for one round, betting one unit. Therefore, the VI for the even-money American Roulette bet is formula_14. The variance formula_15 is defined as the square of  the VI. Therefore, the variance of the even-money American Roulette bet is ca. 0.249, which is extremely low for a casino game. The variance for Blackjack is ca. 1.2, which is still low compared to the variances of electronic gaming machines (EGMs). Additionally, the term of the volatility index based on some confidence intervals are used. Usually, it is based on the 90% confidence interval. The volatility index for the 90% confidence interval is ca. 1.645 times as the "usual" volatility index that relates to the ca. 68.27% confidence interval. It is important for a casino to know both  the house edge and volatility index for all of their games. The house edge tells them what kind of profit they will make as percentage of turnover, and the volatility index tells them how much they need in the way of cash reserves. The mathematicians and computer programmers that do this kind of work are called gaming mathematicians and gaming analysts. Casinos do not have in-house expertise in this field, so they outsource their requirements to experts in the gaming analysis field. Bingo probability. The probability of winning a game of Bingo (ignoring simultaneous winners, making wins mutually exclusive ) may be calculated as: since winning and losing are mutually exclusive. The probability of losing is the same as the probability of another player winning (for now assuming each player has only one Bingo card). With formula_2 players taking part: formula_18 with formula_2 players and our player being designated formula_20. This is also stated (for mutually exclusive events) as formula_21. If the probability of winning for each player is equal (as would be expected in a fair game of chance), then formula_22 and thus formula_23 and therefore formula_24. Simplifying yields For the case where more than one card is bought , each card can be seen as being equivalent to the above players, having an equal chance of winning. formula_26 where formula_27 is the number of cards in the game and formula_28 is the card we are interested in. A player (formula_20) holding formula_30 cards therefore will be the winner if any of this cards win (still ignoring simultaneous wins): A simple way for a player to increase his odds of winning is therefore to buy more cards in a game (increase formula_30). Simultaneous wins may occur in certain game types (such as online bingo, where the winner is determined automatically , rather than by shouting "Bingo" for example), with the winnings being split between all simultaneous winners. The probability of our card, formula_28, winning when there is either one or more simultaneous winners is expressed by: where formula_35 is the probability of there being formula_36 simultaneous winner (a function of the game type and number of players) and formula_37 being the (fair) probability that formula_28 is one of the winning cards. The overall expected value for the payout (1 representing the full winning pot) is therefore: Since, for a normal bingo game, which is played until there is a winner, the  probability of there being a winning card, either formula_41 or formula_42 or ... or formula_43, and these being mutually exclusive, it can be stated that and therefore that The expected outcome of the game is therefor not changed by simultaneous winners, as long as the pot is split evenly between all simultaneous winners. This has been confirmed numerically. To investigate whether it is better to play multiple cards in a single game or to play multiple games, the probability of winning is calculated for each scenario, where formula_30 cards are bought. where n is the number of players (assuming each opposing  player only plays one card). The probability of losing any single game, where only a single card is played, is expressed as: The probability of losing formula_30 games is expressed as: The probability of winning at least one game out of formula_30 games is the same as the probability of not losing all formula_30 games: When formula_54, these values are equal: but is has been shown that that formula_56 for formula_57. The advantage of formula_58 grows both as formula_30 grows and formula_2 decreases. It is therefore always better to play multiple games rather than multiple cards in a single game , although the advantage diminishes when there are more players in the game.