What are the Odds?

By : Priscilla Crespo 
pcrespo88@yahoo.com

The game of Keno:
	This game includes the numbers 1 - 80.  The game randomly chooses 20 out of these 80 numbers.  As a player, you have the opportunity to match at most 10 numbers out of the 20 that are randomly drawn.  There are 7 types of plays that can be done; you can choose between 4 and 10 numbers.  There's a 4 Spot, 5 Spot, 6 Spot, 7 Spot, 8 Spot, 9 Spot, and 10 Spot game.  A 4 Spot game is when you choose 4 different numbers to match, a 5 Spot game is when you choose 5 different numbers to match, ...... , 10 Spot is when you choose 10 different numbers to match.  Keno has a different payout depending on the type of game you are playing and the amount of money you put down for each number.  I will be playing $1 for each number.  
	
	
My project looks at several cases :
  1. When I select a consistent set of numbers in a 5 Spot game of Keno.
  2. When I select a consistent set of numbers in a 10 Spot game of Keno.
  3. When I randomly select numbers each round in a 5 Spot game of Keno.
  4.  When I randomly select numbers each round in a 10 Spot game of Keno.

Just to get started, this is how we get mathematica to randomly choose 20 numbers in the range of 1 to 80.

RandomSample[Range[1,80],20]

This is how we get mathematica to randomly chose 20 numbers in the range of 1 to 80 (in Keno).  Note if I were to use the RandomInteger function there could be repetition which is not allowed in Keno.

Game 1: 5 Spot game of Keno with consistent set

I will start out by playing a 5 Spot game with a consistent set of 5 numbers to be chosen by me.  This is the set I have chosen:

mypick5={3,11,9,21,65}

This tells you which numbers match in the random drawing.

Intersection[mypick5,RandomSample[Range[1,80],20]]

This function plays a round in the game of keno.  After putting in your five numbers it gives you your matches in the output.

game[{x__}]:=Intersection[{x},RandomSample[Range[1,80],20]]

Now lets look at the outcome with my set of 5 numbers:

game[mypick5]

This tells you how many matches you had in that round of keno.

Length[game[mypick5]]

Now remember, Keno has a different payout depending on the amount of numbers you play. 
Payout in a 5 Spot game:
Match 0 numbers you lose your dollar
Match 1 number you win back 50 cents (lose 50 cents)
Match 2 numbers you win back your $1; where you started - $0 won
Match 3 numbers you win $2
Match 4 numbers you win $14
Match 5 numbers you win $49

This adds the value of the payout after each round in the 5 Spot game. Since we had 1 match we are now down 50 cents.

sumpick5 := Switch[Length[game[mypick5]], 0, -1, 1, -.5, 2, 0, 3, 2, 4, 14, 5, 49]

sumpick5

Now we have a while loop that tells the player their payout by playing the game of keno until the payout is greater than 50 or by playing up to 100 rounds.  We are starting with sum at 0 and counter, i at  0.

myfive:=Module[{sum=0,i=0},While[sum<50&&i<100,sum=sumpick5+sum;i++];{i,sum}]

myfive

Needs["Histograms`"]

This histogram is for when we play $100 (realistic amount) on this 5 Spot game, 1,000 times.  Mathematica is outputting the amount of times that we win (any amount) in 100,000 rounds.

thousandmy5=Table[myfive[[2]],{i,1000}];
Histogram[thousandmy5]
Print["The chances of winning money is: "]
Length[Select[thousandmy5,#>0&]]/100000

Here we have a while loop that tells the player their payout by playing the game of keno until the payout is greater than 50 or by playing up to 1000 rounds.  We are starting with sum at 0 and counter, i at  0.

myfive2:=Module[{sum=0,i=0},While[sum<50&&i<1000,sum=sumpick5+sum;i++];{i,sum}]

myfive2

This histogram is for when we play $1000 (uncommon amount) on this 5 Spot game, 1,000 times. Mathematica is outputting the amount of times that we win (any amount) in 1,000,000 rounds.

thousandmy52=Table[myfive2[[2]],{i,1000}];
Histogram[thousandmy52]
Print["The chances of winning money is: "]
Length[Select[thousandmy52,#>0&]]/1000000

Observations : The less times you play Keno the more chances you have of winning money.

Game 2 : 10 Spot game of Keno with consistent set

mypick10={5,8,12,35,61,80,22,28,3,47}

Intersection[mypick10,RandomSample[Range[1,80],20]]

sumpick10:=Switch[Length[game[mypick10]],0,-1,1,-1,2,-.5,3,0,4,1,5,2,6,4,7,9,8,29,9,599,10,1799]

myten:=Module[{sum=0,i=0},While[sum<50&&i<100,sum=sumpick10+sum;i++];{i,sum}]

myten

thousandmy10=Table[myten[[2]],{i,1000}];
Histogram[thousandmy10]
Print["The chances of winning money is: "]
Length[Select[thousandmy10,#>0&]]/100000

myten2:=Module[{sum=0,i=0},While[sum<50&&i<1000,sum=sumpick10+sum;i++];{i,sum}]

myten2

thousandmy102=Table[myten2[[2]],{i,1000}];
Histogram[thousandmy102]
Print["The chances of winning money is: "]
Length[Select[thousandmy102,#>0&]]/1000000

Observations : Again the less times you play the better off you are.

Game 3 : 5 Spot game of Keno with inconsistent set

random5=RandomSample[Range[1,80],5]

Intersection[random5,RandomSample[Range[1,80],20]]

sumrandom5:=Switch[Length[game[random5]],0,-1,1,-.5,2,0,3,2,4,14,5,49]

rdmfive:=Module[{sum=0,i=0},While[sum<50&&i<100,sum=sumrandom5+sum;i++];{i,sum}]

rdmfive

thousandrdm5=Table[rdmfive[[2]],{i,1000}];
Histogram[thousandrdm5]
Print["The chances of winning money is: "]
Length[Select[thousandrdm5,#>0&]]/100000

rdmfive2:=Module[{sum=0,i=0},While[sum<50&&i<1000,sum=sumrandom5+sum;i++];{i,sum}]

rdmfive2

thousandrdm52=Table[rdmfive2[[2]],{i,1000}];
Histogram[thousandrdm52]
Print["The chances of winning money is: "]
Length[Select[thousandrdm52,#>0&]]/1000000

Observations : Again the less times you play the better off you are.

Game 4 : 10 Spot game of Keno with inconsistent set

random10 = RandomSample[Range[1,80],10]

Intersection[random10,RandomSample[Range[1,80],20]]

sumrandom10:=Switch[Length[game[random10]],0,-1,1,-1,2,-.5,3,0,4,1,5,2,6,4,7,9,8,29,9,599,10,1799]

rdmten:=Module[{sum=0,i=0},While[sum<50&&i<100,sum=sumrandom10+sum;i++];{i,sum}]

rdmten

thousandrdm10=Table[rdmten[[2]],{i,1000}];
Histogram[thousandrdm10]
Print["The chances of winning money is: "]
Length[Select[thousandrdm10,#>0&]]/100000

rdmten2:=Module[{sum=0,i=0},While[sum<50&&i<1000,sum=sumrandom10+sum;i++];{i,sum}]

thousandrdm102=Table[rdmten2[[2]],{i,1000}];
Histogram[thousandrdm102]
Print["The chances of winning money is: "]
Length[Select[thousandrdm102,#>0&]]/1000000

Observations : Again the less times you play the better off you are.

Results :
	In general it does not matter if you have a consistent or an inconsistent set of numbers.  The only factor that will affect you winning money in a game of Keno is the number of times played.  Observing out results you have a higher probability of winning when you play 100,000 versus 1,000,000 rounds of Keno.