Skip to content
/ Keno Public

Grad school Algorithm Analysis Keno payoff calculator. Exports results into an Excel Spreadsheet using ole automation.

Notifications You must be signed in to change notification settings

mlshort/Keno

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Keno Simulation

DIRECTORY STRUCTURE:

\Keno Simulation

  • --- \KenoProject (source)
  • --- \Bin (compiled executable)
  • --- \Data (output file data) (Keno.xlsx)
  • --- \Documentation (implementation documentation)
  • --- \Obj (discardable binary intermediaries)

KenoProject Overview

  1. Assignment CMPS 5243 Algorithm Analysis:

The casino game 'KENO' involves the selection of 20 balls from 80 balls numbered 1 ... 80. The player selects k numbers (1-20). The payoff depends on how many of the player's numbers that the casino machine selects. For example, if the player selects 9 numbers and 5 of them are generated by the machine, he/she wins $4.00; if 6 are generated, the player wins $43.00.

This program is to determine the probability of each possible situation and place these probabilites in a 20 x 21 array of real values. The entries in the [ith] row assume that the player has selected i numbers. The entry in the [jth] column is the probability that the player catches j spots out of i possible. Of course, if j > i, the probability is 0.0. In general, if i <= j, the probability is given by:

      P (catch j out of i numbers) = C ( i, j ) * P1 * P2 / P3, where
      C (i, j) = i! / ((i-j)! * j!)

      P1 ( factors ) = 20 * 19 * 18 ... factors, where factors = j
      P2 ( factors ) = 60 * 59 * 58 ... factors, where factors = i - j
      P3 ( factors ) = 80 * 79 * 78 ... factors, where factors = i

Together with this program specification there is a sheet of payoffs for between 1 & 9 spots marked. Calculate for each number of spots marked the "expected value" of a $1 bet.

Implementation

  • The program used combinatorics to calculate the payout probabilities.

  • It further used COM Automation to create an MS Excel Spreadsheet (from within a Native C++ Console Application) as the final output file for the the calculated probability data.

About

Grad school Algorithm Analysis Keno payoff calculator. Exports results into an Excel Spreadsheet using ole automation.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages