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.
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$.