What are the probabilities in this particular spin-off of BlackJack A few of my friends are playing on a gaming server where this game exists. I was curious about the probabilities in it but i was unable to derive them.
Any help would be MUCH appreciated.
Note: For this problem, please assume that /dice is absolutely random. It is generated by a computer using a pseudo random code but i would appreciate it if that didnt work its way in here.
As for the game itself, here is how it works, there are two people who play the game, The Player and The Dealer.
As the game begins, the player uses /dice as many times as he wants(Each /dice has 6 outcomes which have absolutely equal chances). The player then dices as many times as he wants but his total must not go over 21.
For example when the total reaches 19, it would be a good choice to stop.
If he gets 22, 23 or so on then he automatically loses.
Once he has "stayed" at a particular amount the dealer then rolls. His aim is to ensure that he gets a number higher than the player. If he succeeds, he wins. If he trips and gets 22, 23 or so on then he loses.
Now what is the probability that the dealer will win? What is the probability that the player will win? On a average game what is the probability of a 21 being rolled. 
 A: With Shard's notation, the probability that the player wins if she rolls until she has at least $b$ is
$$
p_b=\sum_{a=b}^{21}\sum_{c=22}^{a+6}p(a,b)p(c,a+1)\;,
$$
and she will choose $b$ to maximize this. Here's code that calculates these probabilities using Shard's recurrence:
$$
\begin{array}{c|c}
b&p_b\\\hline
16&0.28518\\
17&0.39679\\
18&0.47400\\
19&0.49650\\
20&0.44231\\
21&0.28597\\
\end{array}
$$
Thus the player should roll until she has at least $19$, and then her winning probability is very nearly even. The probability that she rolls $21$ is $p(21,19)\approx0.19091$, and the probability that the dealer rolls $21$ is $p(19,19)p(21,20)+p(20,19)p(21,21)\approx0.13597$, for a total of about $0.32689$.
A: Each players turn can be described by a set of probabilities based on the "sticking number" $b$ they choose which is the lowest total number at which they will stop rolling the dice. The dealer always picks $b=n+1$ where $n$ is the score the player got to try and beat them. The player has a more tricky decision which will be based off what the probabilities are of him winning after sticking vs the probability of immediately going bust.
Let $p(a,b)$ be the probability that the the total = $a$ given we keep rolling until the total is $\ge b$. Clearly $p(a,b)=0$ if $a<b$ as we are supposed to keep rolling until $a\ge b$. Also $p(a,b)=0$ for $a>=b+6$ since a single roll of the die cannot take us from a number less then $b$ to one greater then or equal to $b+6$.
Also if we choose $b=1$ then clearly we stop after our very first roll and so $$p(1,1)=p(2,1)=p(3,1)=p(4,1)=p(5,1)=p(6,1)=\frac16$$ Now let us consider $b=2$. After our first roll we would only choose to roll again if we rolled a one, and so we end up with 
$p(2,2)=p(3,2)=p(4,2)=p(5,2)=p(6,2)=\frac16+\frac1{6^2}$ and $p(7,2)=\frac1{6^2}$
In general we end up with the recurrence relation $$p(a,b)=p(a,b-1)+\frac{p(b-1,b-1)}6$$
where $b\le a\le b+5$ and zero for other values of $a$.
It should be easy to calculate the table of probabilities up to $b=21$, and thus work out the chance the dealer wins given that the player "stuck" on a certain number. Knowing these probabilities the player can now decide their own sticking number by working out if the chance of going "bust" on the next roll is less then the chance they would lose anyway by "sticking" and letting the dealer play.
