Simple Dice Game: Dragon's Dice
Whee! Math!
First question: what happens when both players roll over 21? Say both roll nothing but 6s, and pass on their public die to the other, getting 24 anyway?
Second question what about ties?
I'll assume the answer to both is to play another round.
Third observation: a cutoff of 17 or less means you have a chance to automatically lose no matter what you roll, and a cutoff of 18 or less means you sometimes have an incentive to give away your die no matter what.
Lots of numbers follow. Summary: there are a few levels of depth to devising an optimal strategy, and it's going to have to be fairly flexible. Game theory is advised.
If you roll an 18 (hidden) and a 4 or more (public), you have every incentive to pass the die on, as you're sure to lose otherwise, with a total of 22 or more. Same with a 17 and a 5+ or a 16 and a 6.
So that's 15 / 1296 chance of automatically giving your die away. A bit more than 1%.
Let's expand on that. What happens if someone declares "I will always keep!". You can follow the same strategy, and get better odds, by giving when your hidden + public score is 22 or more.
So what about "I will always keep if my hidden + public is 21 or less, and give otherwise"?
If the other player rolled 1, they're keeping. You can't make them go over 21 by giving a 1 or a 2, so you keep those. If you roll a 3 (public), you have a 1/216 chance that they rolled an 18 and will lose if you give. Otherwise, if you give, you're trying your hidden roll against 3d6+4 - poor odds. If your hidden roll was 3-6, you can't win in this case, so with a low hidden roll you'd only have a 1/216 of winning if you give, while if you keep you have a total of 6-9 against their 3d6+1, which means you win if they rolled a 3 or a 4 at least, for 4/216.
So with a low hidden roll, you keep on a roll of 3. On a higher hidden roll, you're going to think things through. And keep, in this case.
Which suggests that it may be possible to refine the strategy above based on your hidden roll. If you have a low hidden total, you could have a better chance of winning by giving, and hoping the other goes over 21, than by keeping, and getting a low score out of the deal.
Let's assume your hidden total is 3, and your public roll is a 6.
The other player rolled a 1, and is therefore keeping (old strategy). They get 3d6+7 if you give, and so they lose on a 15+ (20/216). If you keep, you have a total of 9, and so they lose on a 3-7 (35/216). Therefore, it's better to keep.
The other player rolled a 2, and is therefore keeping (old strategy). They get 3d6+8 if you give, and so they lose on a 14+ (35/216). If you keep, they lose on a 3-6 (20/216), so it's better to give.
The other player rolled a 3, and is therefore keeping (old strategy). They get 3d6+9 if you give, and so they lose on a 13+ (56/216). If you keep, they lose on a 3-5 (10/216), so it's better to give.
The other player rolled a 4. If you give, they get 3d6+10, and so lose on a 12+ unless they rolled an 18, in which case they gave, and lose anyway (you get a 7) (81/216). If you keep, they lose on a 3-4. If they rolled an 18, you get a 13 and they still win. They lose with probability 4/216, so it's better to give.
The other player rolled a 5. If you give, they get 3d6+10, and so lose on an 11+ unless they rolled a 17 or 18, in which case they gave and lose anyway (you get an 8) (108/216). If you keep, they lose on a 3. If they rolled a 17 or 18, you get a 14 and they still win. They lose with probability 1/216, so it's better to give.
The other player rolled a 6. If you give, they get 3d6+11, and so lose on a 10+ unless they rolled 16-18, in which case they gave and lose anyway (you get a 9) (135/216). If you keep, you have a 9 unless they rolled a 16 or more, in which case you have a 15 and still lose. You want to give.
So that tells us that it can be very effective to give if you expect the other player to keep and have a low hidden roll and a high public roll - a public roll of 1 won't help you if you have a hidden total of 3 (the only way you can win then is by keeping and hoping the other player also has a low hidden and gives you his roll).
What we want to look at to refine the strategy further is the sum and difference between the rolls. If both public rolls are 6s and you have a hidden 10 or more, you'll lose if you get both dice - so there is an incentive to give if there is a high enough chance the other will give. On a hidden 9 or less, you get a large boost from getting both dice, so there is an incentive to keep if there is a high enough chance the other will give (or you can hope to make the other explode).
And that leads us to game theory, which says that it's possible to design strategies where you randomize your choice. If you're sure the other is going to keep most of the time, you can give when both public dice are high and your hidden total is low, and increase your odds of winning. If you're sure the other is going to give most of the time, you can also devise a suitable response. If the other is (ahem) rolling a die to decide whether to give or keep... your best response might be to do the same.