So there's this one gambling site and they have game of 'blackjack' which is played very differently than the usual game.

The host has dice which has all the numbers from 1 to 100. He rolls it for you as many times as you want, the rolls are added up and you must not exceed 100. If theyre over 100, it's an instant loss. Now lets say he rolls 10 and 67 and you decide to stay, your total would be 77 and it'll be the hosts turn. He must now roll higher total than you without exceeding 100 also. If he rolls 100 in the beginning it's an instant win, and there are no ties(meaning if you both have same total, the host must roll another time).

It seems to me that the probability of host winning this game is way higher than the players, because the player goes first and you might go over 100 even before the hosts turn, and also if you stay at something like 80 and the host rolls 79, the host can just keep on rolling more without thinking about it, whereas if your score was 79 you most likely wouldnt roll another time.

Now is there a chance to calculate exact probability that the player wins, or atleast approximate it with say 5%error? I have tried, but i'm pretty lost in how i should begin tackling this problem.

  • $\begingroup$ Since this depends on strategy (when does the first player stop?) it is probably best to sample the game. That is, play thousands (or millions) of the game first to determine optimal strategy and then to determine probabilities. $\endgroup$ – lulu Dec 22 '17 at 10:57
  • $\begingroup$ @lulu - I think a full calculation might be easier than a simulation $\endgroup$ – Henry Dec 22 '17 at 11:12
  • $\begingroup$ @Henry Really? You may well be right but even so I'd want to see a suite of runs just to check the calculation! $\endgroup$ – lulu Dec 22 '17 at 11:15
  • $\begingroup$ Very similar to math.stackexchange.com/q/1315270/420432 though not identical because that question doesn't ask for a probabilty. $\endgroup$ – nickgard Dec 22 '17 at 11:30
  • $\begingroup$ @nickgard - a very small difference between the two games: in this game ties do not happen as the host must roll again while in your linked game ties result in the original stake being returned $\endgroup$ – Henry Dec 22 '17 at 12:23
  1. Let's call the probability of hitting a particular value $n$ at any stage if you do not stop throwing $a_n$. Clearly $a_0=1$ while $a_n=\sum\limits_{m= \min(0,n-100)}^{n-1} a_m /100$. For $1 \le n \le 100$ this will give $a_n=\frac{101^{n-1}}{100^n}$

  2. Suppose the player stays at a value $s$. Then the probability that the host reaches a value from $s$ through to $100$ is $(100-s)a_{s+1} = \frac{(100-s)101^{s}}{100^{s+1}}$ while the probability the bank goes bust is $1-\frac{(100-s)101^{s}}{100^{s+1}}$

  3. If the probability that a player using the optimal strategy and who has reached $k$ then wins is $w_k$ then $w_{100}=1$ and $w_k=\max\left(1-\frac{(100-s)101^{s}}{100^{s+1}}, \sum\limits_{j= k+1}^{100} w_k /100\right)$ for $0 \le k \lt 100$, and the optimal strategy is to stay when the left hand part of the maximum expression is greater

It turns out that the probability that the player wins is $w_0=0.4316936\ldots$ following a strategy of the player staying with a total of $58$ or more

lulu asked for a simulation to check - the following R script comes close to the same value for $w_0$ when staying at $58$ or above though does not prove optimality (choosing $57$ or $59$ to stay would give similar results)

stayat <- 58
sides <- 100
maxtarget <- sides
cases <- 1000000

playertot <- rep(0, cases) 
while( sum(playertot < stayat) > 0) {
  dice <- sample(sides, cases, replace=TRUE) 
  playertot <- playertot + ifelse(playertot < stayat, dice, 0) 
hosttot <- rep(0, cases)
while( sum(hosttot <= playertot ) > 0) {
  dice <- sample(sides, cases, replace=TRUE) 
  hosttot <- hosttot + ifelse(hosttot <= playertot, dice, 0) 

which gives the very close estimate of the probability

> mean(playertot <= maxtarget & hosttot > maxtarget) 
[1] 0.431478
  • $\begingroup$ Thank you! The probability seems higher than what i assumed, but more than likely they didnt have optimal strategy. $\endgroup$ – J sx Dec 22 '17 at 12:37

Your Answer

By clicking "Post Your Answer", you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.