Keno Game: What percentage of the sum of 20 balls has a value of 210 to 695?

90 Views Asked by At

In the Keno game, a player starts by selecting 20 numbers from the numbers 1 to 80. What percentage of the sum of 20 balls has a value of 210 to 695?. I don't have an idea to solve this. May anyone gives me a hint to solve this problem? Thanks

1

There are 1 best solutions below

4
On BEST ANSWER

A related question: Lottery "Sum" forecasting

The smallest possible draw is $1+2+\cdots +20 =210$, so this lower constraint does not really affect the calculation, but it does no harm.

The probability of getting a sum $s$ is the number of partitions of $s$ into $20$ distinct positive parts each not greater than $80$, divided by the number of ways of choosing $20$ numbers from $80$. This partition number can be found with a recursion, where if $n$ is the number of parts and $k$ is the largest part:

$$r(s,n,k) = \sum\limits_{i=1}^{s-k} r(s-i,n-1,i)$$ starting at $r(0,0,0)=1$. Here we want $\sum\limits_{s=210}^{695} \sum\limits_{k=1}^{80} r(s,20,k)$. The following R code does the recursion and finds the probability of $0.1025153$ (exact up to rounding)

library(matrixStats)
balls <- 80 
draws <- 20      # from 2 to balls-1

maxsum <- draws*(balls + (balls-draws+1))/2
partitions <- matrix(rep(0, balls*maxsum), ncol=balls)
partitions[cbind(1:(balls-draws+1), 1:(balls-draws+1))] <- 1 
cumpartitions <- rowCumsums(partitions)

for (nthdraw in 2:draws){
  for (thisdraw in nthdraw:(balls-draws+nthdraw )){
    partitions[, thisdraw] <- 
      c(rep(0, thisdraw), cumpartitions[1:(maxsum-thisdraw), thisdraw-1]) 
    }
  partitions[, 1:(nthdraw-1)] <- 0  
  cumpartitions <- rowCumsums(partitions)
  }

results <- cumpartitions[, balls]
c(sum(results), choose(balls, draws))  # check should be equal
# 3.535316e+18 3.535316e+18
sum(results[210:695]) / sum(results) # answer to the question
# 0.1025153

Other approaches include simulation, such as

set.seed(2021)
kenosum <- function(balls, drawn){sum(sample(balls, drawn))}
simdata <- replicate(10^6, kenosum(80, 20))
mean(simdata >= 210 & simdata  <= 695)
# 0.102791

which is quite close.

An alternative is a normal approximation. The mean score is $\frac{20 \times 81}{2} = 810$ and the standard deviation is $\sqrt{\frac{20 \times (80-20) \times 81}{12}}=90$ so we could try about $\Phi\left(\frac{695+ \frac12-810}{90}\right) - \Phi\left(\frac{210 -\frac12-810}{90}\right)$ or in R:

pnorm(695.5, 810, 90) - pnorm(209.5, 810, 90)
# 0.1016471

which is not too far away from the exact answer.