// Functions for predicting lottery or Keno probabilities. // balls is the number of total balls to draw from // drawn is the number of balls actually drawn from the above pool // chosen is the number of balls chosen by the player // matches is the number of balls chosen by the player that match drawn balls lottery[balls, drawn, chosen, matches] := { binomial[balls,drawn] / (binomial[chosen, matches] * binomial[balls-chosen, drawn-matches]) }