User:JohnH~enwiki/sandboxP

Reasons for this page
This page exists for the purposes of archiving my major contributions to Wikipedia. Someone may delete my efforts and I would like to capture them for future use. Archives so far are:
 * Keno odds
 * Hypergeometric distribution comments

Background
Keno payouts are based on how many numbers the player chooses and how many of those numbers are hit, multiplied by the proportion of the player's original wager to the base rate of the house's paytable. Typically, the more numbers a player chooses and the more numbers hit, the greater the payout, although some paytables pay for hitting a lesser number of spots. For example, it is not uncommon to see casinos paying $500 or even $1,000 for a catch of 0 out of 20 on a 20-spot ticket with a $5.00 wager. Payouts vary widely by casino. Most casinos allow paytable wagers of 1 through 20 numbers, but some limit the choice to only 1 through 10, 12 and 15 numbers, or spots as keno aficionados call the numbers selected.

The probability of a player hitting all 20 numbers on a 20-spot ticket is approximately 1 in 3.5 quintillion (1 in 3,535,316,142,212,174,320).

Even though it is highly improbable to hit all 20 numbers on a 20 spot ticket, the same player would typically also get paid for catching 0, 1, 2, 3, and 7 through 19 out of 20, often with the 17 through 19 catches paying the same as the solid 20 hit. Some of the other paying catches on a 20-spot ticket or any other ticket with high solid catch odds are in reality very possible to hit.

Below is a set of tables giving both the probability and odds of catching N numbers when playing M spots for all 0 &leq; N &leq; M &leq; 20 where M &geq;1.

This assumes a “casino standard” of drawing 20 balls from a group of 80.

Note there is a slight (but important) difference between the odds to 1 figure (given below) and a similar value, the 1 chance in figure (not given). Consider the simple case of catching exactly 1 number when playing a 1-spot ticket. While the odds figure reads “3 to 1” against, the chance in figure is “1 in 4”. The tables below give only the odds to 1 figure, since it's quite easy to calculate the chance in figure: just add 1 to the odds figure to get the chance in figure as was done in the 3-to-1 example above. When the odds against figure gets large (as it often does in Keno!) you can consider the two to be interchangeable for all intents and purposes.

Similarly, if you prefer your probabilities in percent form, simply take the probability number and move the decimal point two places to the RIGHT, drop any leading 0's (those to the LEFT of the decimal point) and stick a %-sign on the end of the value. Thus the probability of catching 2 numbers on a 3-spot ticket reads 0.1388 or (moving the decimal point 2 places) 013.88% or just 13.88%, for example.

For very large, or very small (but positive) values the numbers are shown in “e-notation” where values are displayed as x.xxxxe&plusmn;nnn. In these cases the e should be read as “times 10 to the power of” nnn, or “&times;10^nnn”. For example, the odds against (not probability of) catching 13 spots on a 14-spot ticket are 3.2425e+008 to 1. This is 3.2425 &times; 10^+008. (+008 is of course just 8). You can convert to full decimal notation by moving the decimal point 8 places to the RIGHT (because of the '+' in e+008), supplying 0's for placeholders as needed. In this case 3.2425e+008 is (just adding extra 0's to fill) 324250000. to 1 against. This could also be written as 324,250,000. to 1 against. (In the USA anyhow. In Europe the uses of ',' and '.' in numbers are interchanged.)

For negative values of nnn you do the same thing but shift the decimal point to the LEFT. For example, the probability (not odds) of catching 13 spots on a 14-spot ticket is 3.0840e&minus;009. This is 3.0840 &times; 10^&minus;009 (&minus;009 is of course just &minus;9). You can convert to decimal notation by moving the decimal point 9 places to the LEFT (because of the '&minus;' in e&minus;009), supplying 0's for placeholders as needed. In this case 3.0840e&minus;009 is (just adding extra 0's to fill) .0000000030840 or sometimes .000 000 003 084 by analogy with the use of commas for large numbers.

Probability Tables
The following tables should be self-explanatory.

Derivation of Tables
Keno probabilities come from a Hypergeometric distribution, specifically its Application to Keno. To calculate the probability of hitting 4 spots on a 6-spot ticket, the formula is:
 * $$ P(X=4) = {{{6 \choose 4} {{80-6} \choose {20-4}}}\over {80 \choose 20}} \approx 0.02853791$$

where $${n \choose r}$$ is calculated as $$n! \over r!(n-r)!$$, where X! is notation for X Factorial.

Some calculators (e.g. the TI-36X) and spreadsheets (e.g., Microsoft Excel) have built-in functions for $${n \choose r}$$. In Microsoft Excel the function is COMBIN(n,r). Entering =COMBIN(8,5)to Excel results in the number 56 appearing in the cell.

For Keno one calculates the probability of hitting exactly $$r$$ spots on an $$n$$-spot ticket by the formula:
 * P(hitting $$r$$ spots) $$ = {{n \choose r} \times {{80-n} \choose {20-r}} \over {80 \choose 20}} $$ for an $$n$$-spot ticket.

The probability of hitting exactly $$8$$ spots on a $$14$$-spot ticket is therefore $$ {{{14 \choose 8} \times {66 \choose 12}} \over {80 \choose 20}}$$. This is $${ {3003 \times (4.922879482\times 10^{12})} \over 3.535316142\times 10^{18} }$$ $$\approx 0.004181637$$.

Application to Keno
The hypergeometric distribution is indispensable for calculating Keno odds. In Keno, 20 balls are randomly drawn from a collection of 80 numbered balls in a container, rather like American Bingo. Prior to each draw, a player selects a certain number of spots by marking a paper form supplied for this purpose. For example, a player might play a 6-spot by marking 6 numbers, each from a range of 1 through 80 inclusive. Then (after all players have taken their forms to a cashier and been given a duplicate of their marked form, and paid their wager) 20 balls are drawn. Some of the balls drawn may match some or all of the balls selected by the player. Generally speaking, the more hits (balls drawn that match player numbers selected) the greater the payoff.

For example, if a customer bets (&ldquo;plays&rdquo;) $1 for a 6-spot (not an uncommon example) and hits 4 out of the 6, the casino would pay out $4. Payouts can vary from one casino to the next, but $4 is a typical value here. The probability of this event is:
 * $$ P(X=4) = f(4;80,6,20) = {{{6 \choose 4} {{80-6} \choose {20-4}}}\over {80 \choose 20}} \approx 0.02853791$$

Similarly, the chance for hitting 5 spots out of 6 selected is $$ {{{6 \choose 5} {{74} \choose {15}}} \over {80 \choose 20}} \approx 0.003095639$$ while a typical payout might be $88. The payout for hitting all 6 would be around $1500 (probability &ap; 0.000128985 or 7752-to-1). The only other nonzero payout might be $1 for hitting 3 numbers (i.e., you get your bet back), which has a probability near 0.129819548.

Taking the sum of products of payouts times corresponding probabilities we get an expected return of 0.70986492 or roughly 71% for a 6-spot, for a house advantage of 29%. Other spots-played have a similar expected return. This very poor return (for the player) is usually explained by the large overhead (floor space, equipment, personnel) required for the game.

A complete set of Keno probabilities can be found in the Wikipedia Keno article. A fairly complete set of typical payouts can be found in Probabilities in Keno. Other payouts can be found by searching the web for &ldquo;keno payouts&rdquo;, but formats vary and are less convenient than the site referenced.