100-Sided Dice "Blackjack" Game I am attempting to determine two variables in this game:


*

*The optimum strategy: (What number the bettor should stay at)

*The expected value given perfect play: (The percent return on a bet when using the optimum strategy)


Here is how the game works: There are two players. One is the "dealer" and the other is the bettor. A bet is placed, and the "dealer" rolls a 100-sided die, having the numbers 1-100. The bettor wants to get close to or at 100, without going over. If they go over 100, they "bust" and lose the game. The first roll(s) are for the bettor, and they have the option to hit or stay until they either bust or choose to stay. Each time a player hits, the numbers are added together. After the bettor stays, the dealer rolls until they beat the bettor's score, draw, or bust. In the case of a draw, the bettor will have their money returned to them.
Example game: The dealer rolls for the bettor and the 100-sided die shows a 60. The bettor decides to stay. Now, the dealer rolls for them self and the 100-sided die shows a 3. The dealer hits, rolling an 8. The dealer adds these numbers, and is at 11. The dealer rolls again and the die shows a 50. The dealer adds 50 and 11, making 61. The dealer has beat the bettor without going over 100, winning the game.
Additional info: I have tried my best to determine the optimum strategy and return on investment for this game, but the math is too complex for me. There are too many variables involved and when multiple rolls come into play it becomes overwhelming to fully understand. I only have basic knowledge of statistics and probability. Help is greatly appreciated.
 A: In the following I shall treat the continuous version of the game: The rolling of the die is modeled by the drawing of a real number uniformly distributed in $[0,1]$.
Only the bettor can have a strategy, and this strategy is completely characterized by some number $\xi\in\ ]0,1[\> $. It reads as follows: Draw once more if the current sum $x$ is $<\xi$, and stay if the current sum is $>\xi$. The problem is to find the optimal $\xi$.
Claim: When the bettor stays at some $x\in[0,1]$ his chance $q(x)$ of losing is $=(1-x)e^x$.
Proof. The bettor loses if the successive drawings of the dealer produce a partial sum $s_{n+1}$ in the interval $[x,1]$. This means that there is an $n\geq0$ with $s_n\leq x$ and $x\leq s_{n+1}\leq1$. The probability for $s_n\leq x$ is easily seen to be ${x^n\over n!}$, and the probability that the next drawing causes $s_{n+1}$ to lie in the given interval of length $1-x$ is $1-x$.  It follows that
$$q(x)=\sum_{n=0}^\infty{x^n\over n!}\>(1-x)=(1-x)e^x\ .$$
From this we draw the following conclusion: If the bettor has accumulated $x$ and decides to make one additional draw then his chances of losing are
$$\tilde q(x)=\int_x^1 q(t)\>dt\>+x =(2-x)e^x+x\ ,$$
whereby the $+x$ at the end is the probability of busting.
The function $x\mapsto q(x)$ is decreasing in $[0,1]$, and $\tilde q$ is increasing in this interval, whereby $q(x)=\tilde q(x)$ when $x=\xi$ with $\xi\doteq0.570556$. When $x<\xi$ then $\tilde q(x)<q(x)$. This means that an additional drawing at $x$ decreases the probability of losing. When $x>\xi$ then the converse is true: An additional drawing would increase the probability of losing.
A: I would approach this by essentially working backwards. First, you can figure out what the dealer's probabilities are if the bettor outcome is fixed. Let $p_w(m,n)$, $p_d(m,n)$, $p_l(m,n)$ be the probabilities that the dealer wins, draws or loses respectively if his current total is $n$ and bettor's total is $m$. (Assume the bettor hasn't already lost and $m \le 100$.)
$$
\begin{aligned}
p_w(n,m) &= \begin{cases} 
   1 & n > m \\
   0 & n = m \\
\frac{1}{100} \sum_{k = n+1}^{100} p_w(k,m) & n < m \end{cases}\\
p_d(n,m) &= \begin{cases} 
   0 & n > m \\
   1 & n = m \\
\frac{1}{100} \sum_{k = n+1}^{100} p_d(k,m) & n < m\end{cases}\\
p_l(n,m) &= \begin{cases} 
   0 & n \ge m \\
\frac{n}{100}+\frac{1}{100} \sum_{k = n+1}^{100} p_l(k,m) & n < m\end{cases}\end{aligned}
$$
Then recursively applying the formulas, when $n<m$ we have:
$$
\begin{aligned}
p_w(n,m) &= 1-\frac{m}{100} + \frac{1}{100} \sum_{k = n+1}^{m-1} p_w(k,m)  \\
p_d(n,m) &= \frac{1}{100}+\frac{1}{100} \sum_{k = n+1}^{m-1} p_d(k,m)\\
p_l(n,m) &= \frac{n}{100}+\frac{1}{100} \sum_{k = n+1}^{m-1} p_l(k,m) \end{aligned}
$$
So noting $p_w(n,m)=p_w(n+1,m)+\frac{1}{100}p_w(n+1,m)$, we get closed form formulas when $n<m$:
\begin{aligned}
p_w(n,m) &= (1+1/100)^{m-n-1} (1 - m/100)\\
p_d(n,m) &= (1+1/100)^{m-n-1} (1/100)\\
p_l(n,m) &= 1-p_w(n,m)-p_d(n,m)
\end{aligned}
So if the bettor stays with a total of $m$, the dealer's probabilities are:
\begin{aligned}
p_w(m) &= (1+1/100)^{m-1} (1 - m/100)\\
p_d(m) &= (1+1/100)^{m-1} (1/100)\\
p_l(m) &= 1-p_w(n,m)-p_d(n,m)
\end{aligned}
To calculate the expected payoff, we'll use the convention that if the bettor wins his payoff is $+1$, if he loses his payoff is $-1$, and if he draws his payoff is $0$. If the bettor stays on the value $m$, his expected payoff will be $p_l(m)-p_w(m)$.
Let $v(m)$ be the expected value of the bettor winning if his current total is $m$ and he is playing to maximize his expected payoff. Then we can be calculate it recursively like this:
$$
v(m) = \max\left( p_l(m)-p_w(m), -\frac{m}{100}+\frac{1}{100}\sum_{k=m+1}^{100} v(m) \right)
$$
By my calculations, I find the bettor should continue rolling until he has $58$ or better, and the expected payoff is $\approx -0.14674914$.
