Awesome analysis and video. I tried to put your tables for the first & second rolls of the game into human terms. Simplification is possible because 1. Certain decisions never have to be made (you never have to decide if you're keeping 3 of a kind or a made small straight, because you can't have 3 of one die and 4 different values). 2. The exact EV isn't important. Unless I made a mistake these are equivalent to your charts.
For the overall first roll of the game ("first reroll")
1. Keep and score any Yahtzee or large straight
2. Keep any four identical dice
3. Keep any three identical dice
4. Keep the open ended small straight (2345)
5. Keep pairs of 3, 4, 5, or 6. If you have multiple keep only the highest pair
6. Keep the other small straights
7. Keep the pair of 2s
8. From 11345 keep 345
9. Keep a single 4, 5, or 6. If you have a choice prefer the 5, then the 4
Never keep a pair of 1s, the lower small straight draw (234), or two pair
After the second roll of the game ("second reroll")
1. Keep and score any Yahtzee or large straight
2. Keep any four identical dice
3. Keep and reroll any small straight
4. Keep three 4, 5, or 6s
5. Keep and score any full house with smaller values (e.g. 22266)
6. Keep any other three identical dice
7. Keep pairs of 4, 5, or 6. If multiple keep only the highest pair
8. Keep 234 or 345 (the open ended small straight draws)
9. Keep a pair of 2s or 3s. If you have a pair of 1s to go with it, keep 1122 or 1133. If you have 2233x keep only the 3s (note that 22334 keeps 234 per rule 8)
10. From 11346 keep 34
11. From all other rolls with a pair of 1s keep the 1s
12. From 12356 keep 235. From 12456 keep 456
First of all, I have seen and made numerous mistakes. One I never thought about but makes sense is the preference for keeping a lone 4 or 5 over a 6 for the slight increase in straights. The preference for 234 & 345 over the low pairs for roll two is something I got wrong. Lastly I've seen a lot of people keeping two pair in the hopes of a full house. I wonder if that becomes better later in the game.
I think this reflects a more human (or at least my) understanding of the game. I'd love to see some analysis towards questions like:
How much does the value of keeping a pair or 3 of a kind drop when that number's top box is filled? For starters one could fill in a par score as the result of turn 1 and rerun the numbers.
What about if the small or large straight is filled in?
What about situations where most of the top boxes are filled in? Does the missing digit become much more valuable?
This is great work. Thank you for putting this together. I haven't checked everything thoroughly, but things look pretty much right.
I ran the numbers with your turn 1 par suggestion. The answer changes quite a bit depending on the size of the number you're keeping, since groups of 5s and 6s are still good for 3 of a kind, 4 of a kind, and chance. After filling in sixes with an 18, keeping 3 6s on reroll 2 comes between 3 4s and 3 3s, while keeping 2 6s comes between 2 5s and 2 4s. On the first reroll, 3 6s comes between 3 4s and 3 3s, while keeping 2 6s comes between 2 4s and 2 3s.
Fives also just drop a few spots. 3 fours drop a few spots, and 2 fours drop pretty much to the bottom. 3 threes drop considerably, and 2 threes are no longer worth keeping at all. 3 twos start getting beaten by pairs of larger numbers, and 3 ones drop to one of the worst case scenarios.
If small straight is filled in, you only keep 2345 on the second reroll, and a few other combinations of 4/5 of a straight on the first reroll.
If most of the top boxes are filled in, the missing number becomes more valuable. I tried example where we had the entire top section filled in except 3s, with 54 points in the top section, and an empty bottom section. On the first reroll, not that much changed. Groups of threes basically just moved above other groups of the same size. 4 3s was between 4 5s and 4 6s. 3 3s became the best trio, 2 3s became the best pair, and 1 3 became the best singleton. On the second reroll, though, there was a pretty big difference, especially on 3 3s, which went ahead of full house, all small straights, and 4 1s or 2s. I suppose this would be different with different numbers, or if 3 of a kind/4 of a kind/chance are filled in, but that's hopefully a decent start.
That's actually less of a change than I was expecting. Pairs may get more or less valuable, but they still are mostly near other pairs.
I did have another idea to try and get some sense for the full decision tree. Take a particular roll - say 13345. You could keep the 33, you could keep the 345. We know on the overall first roll you do the former, and the second you do the latter. Why not go through every state and ask what to keep for this roll? Then you can build a pie chart showing what wins, and you can condition the choices (33 is kept on 70% of first rolls, but it drops to 40% if the top 3s box is full).
I admit your initial results imply this may not change much. On the first reroll the pair is better. Filling in the top 3 box makes it worse, but it seems to mostly make it worse compared to other pairs, and not to straights. That could just mean the interesting candidates are rolls like 22344. Maybe broadening the roll to some category is a better way to get insights. Or maybe it should be more a question of scoring. You finish your turn with a full house. How often is it a full house, 3 of a kind, or chance across all game states?
I should also mention in making the lists I was heavily inspired by video poker, of all things. The exact strategy depends strongly on the payouts of the machine you're sitting in front of, but see an example here:
That page has a strategy like the one I wrote, but it also has an alternative where the presentation is "here's a common decision and how to resolve it".
This looks fascinating. Thank you so much. I'm excited to read the page.
I definitely like this approach to the analysis. I probably won't have the time to run the analysis any time soon, but I'll let you know if an end up getting it working.
here's a question, what's the worst case scenario for your algorithm? what's the worst dice to roll if you're playing perfectly, to get minimum possible score? it'd be interesting to see if the worst rolls change as the perfect player progresses through the game and how the player responds (what they decide to sacrifice or settle on after a while)
Edited. There are plenty of examples that work for most of the zeros (as well as possibly for the twos roll). The ones that were actually chosen are essentially random.
would you consider sharing tables of optimal strategy for other boxes if yahtzee bonus is possible? i was very intrigued by the small straight and large straight tables with that in consideration
I put in some tables for the last reroll for 3kind, 4kind, chance, and threes (with 54 points in the top section, so you need 3 3's for the bonus). I'll try to add the first reroll if I have some time later.
I found your channel via your first video about battleship, but this one for me was even more interesting. I recently started playing some Yahtzee, mostly by myself (as you said, it really IS a disguised single player game) just to see how hight I could score. Maybe I can enhance my score even further now :)
My friend and I are currently students at the university of Passau, Germany and we are doing a research project about becoming successful on youtube. Your channel is really outstanding in a way that it got traction so fast. It seems that after all quality gets rewarded on this platform ;)
For our project we would love to talk to someone like you, who managed to start and grow a channel seemingly out of thin air.
So if you'd be willing to do a short interview with us, that would be amazing! If you are interested, I'll send you our contact information.
Sorry to bother you here, I couldn't really find another way to contact you. Keep up the great work! :D
Thank you so much for reaching out! I'd be happy to talk. The best way to reach out might be via email (you can find it in my YouTube channel description), but I'm looking forward to talking.
To expand on that, "Kniffel" (the German version of Yahtzee) has only minor variations regarding extra yahtzees:
* The bonus points for an extra yahtzee are only 50, and they don't count for the game score. They are added to the total score across multiple games, but don't count for your single game score.
* A yahtzee (extra or not) cannot be used as a "joker". It can never count as a straight or full house, and only scores points on the upper half for the corresponding number you rolled.
I didn't talk much about how to handle Yahtzee bonuses, so most of the things in the video don't actually change much. A Kniffel would become slightly less valuable, meaning that it would pretty much always be the first thing to zero out, even earlier in the game. It also means that in endgame scenarios, it would almost be better to just ignore the possibility of getting a Kniffel and just focus on the empty box (In Yahtzee, it sometimes becomes better to try for a Yahtzee instead of the boxes that you're missing).
It would take a lot of work to adapt and run my code, but I can talk a bit about the differences. I think the biggest change is the addition of the pair and two pair. Those aren't very hard to get, and they aren't worth much, so they sort of just give you two extra chance squares (maybe not as much for the two pair, but definitely for the pair). This means that it's even more important to get the other bonuses, especially the top bonus, since you effectively have more chances to mess up, giving you more chances to get the other bonuses. They also make it slightly more important to keep high numbers, since they are scored using the sum of the relevant dice.
Hi Patrick, Thank you for the great analysis and the reply, really interesting to see.
I think that the differences are quite a bit bigger and ends up resulting in quite different strategies being important ... with interesting questions on best trade-offs that are hard to work out. Some examples:
- Lack of bonus for multiple Yatzy and lack of joker rules on multiple yatzy changes when you will want to zero it out (and makes straights harder to get)
- small straight is 1,2,3,4,5 so much harder to get - and only worth 15 - so best square to zero out early? ... but large strait is 2,3,4,5,6 and worth 20 - so good to keep both available so that keeping 2,3,4,5 gives you a good chance of one or the other? (also when should you keep a 6 to go for 20 points vs keep 2,3,4,5 to maximize chance of one straight or the other?)
- for 3/4 of a kind & full house only the matching dice count (i.e. 1,1,1,5,6 is worth 3) - so you never want to make them with 1s or 2s - but when do you want to keep which dice under these rules?
- 1&2 pair are not so useful as a chance as you need to make them with high dice (only the matching dice count). 2 pair is interesting because of tradeoffs on when to keep which dice I think.
Overall strategy is quite different because of the importance of having high dice in so many combos below the line ... but at some stage you need to aim for at least 3x 2s,3s or 4s to fill up above the line to get the bonus there...
These are good points. I checked the rules and saw that the game still had small and large straights, but forgot to check to see whether they meant the same thing as in my version.
Having the straights worth less points while also making both of them significantly harder probably makes them much less worth trying for. Small straight presumably becomes one of the first boxes to zero out, followed closely by the large straight.
Granted, most of the other bottom section boxes are also worth less (you don't get points for unused dice in 3kind and 4kind, and full house is also worth less). The Yatzy and top bonus become much more important here. It's probably important to get the top bonus almost every time, both because it's more important, and because the game has more turns. The Yatzy also becomes more important, although the odds are still probably only about 50%.
There's also a much bigger emphasis on getting big numbers, since essentially every bonus except for the straights and Yatzy depend on it. I still think the pair is one of the best places to put a roll that otherwise doesn't do that well, since it's worth a maximum of 12 points compared to 22 for two pair and 30 for the chance. Getting 4 points on the pair would be bad, but a lot less bad than getting something like a 15 on chance.
It probably takes away a lot of the variation in the game, since keeping your biggest dice becomes the dominant strategy for most of the game, and you have more fallbacks if you miss on the 3 of a kind, 4 of a kind, full house, and good top boxes.
Excellent content and you communicated it very well in the video. Maybe I missed it and I can probably google an answer but think it would be good to add somewhere.... What is the MEDIAN score when played optimally? Would be fun to see how often I can beat that using my intuited strategy. Thanks!
Awesome analysis and video. I tried to put your tables for the first & second rolls of the game into human terms. Simplification is possible because 1. Certain decisions never have to be made (you never have to decide if you're keeping 3 of a kind or a made small straight, because you can't have 3 of one die and 4 different values). 2. The exact EV isn't important. Unless I made a mistake these are equivalent to your charts.
For the overall first roll of the game ("first reroll")
1. Keep and score any Yahtzee or large straight
2. Keep any four identical dice
3. Keep any three identical dice
4. Keep the open ended small straight (2345)
5. Keep pairs of 3, 4, 5, or 6. If you have multiple keep only the highest pair
6. Keep the other small straights
7. Keep the pair of 2s
8. From 11345 keep 345
9. Keep a single 4, 5, or 6. If you have a choice prefer the 5, then the 4
Never keep a pair of 1s, the lower small straight draw (234), or two pair
After the second roll of the game ("second reroll")
1. Keep and score any Yahtzee or large straight
2. Keep any four identical dice
3. Keep and reroll any small straight
4. Keep three 4, 5, or 6s
5. Keep and score any full house with smaller values (e.g. 22266)
6. Keep any other three identical dice
7. Keep pairs of 4, 5, or 6. If multiple keep only the highest pair
8. Keep 234 or 345 (the open ended small straight draws)
9. Keep a pair of 2s or 3s. If you have a pair of 1s to go with it, keep 1122 or 1133. If you have 2233x keep only the 3s (note that 22334 keeps 234 per rule 8)
10. From 11346 keep 34
11. From all other rolls with a pair of 1s keep the 1s
12. From 12356 keep 235. From 12456 keep 456
First of all, I have seen and made numerous mistakes. One I never thought about but makes sense is the preference for keeping a lone 4 or 5 over a 6 for the slight increase in straights. The preference for 234 & 345 over the low pairs for roll two is something I got wrong. Lastly I've seen a lot of people keeping two pair in the hopes of a full house. I wonder if that becomes better later in the game.
I think this reflects a more human (or at least my) understanding of the game. I'd love to see some analysis towards questions like:
How much does the value of keeping a pair or 3 of a kind drop when that number's top box is filled? For starters one could fill in a par score as the result of turn 1 and rerun the numbers.
What about if the small or large straight is filled in?
What about situations where most of the top boxes are filled in? Does the missing digit become much more valuable?
This is great work. Thank you for putting this together. I haven't checked everything thoroughly, but things look pretty much right.
I ran the numbers with your turn 1 par suggestion. The answer changes quite a bit depending on the size of the number you're keeping, since groups of 5s and 6s are still good for 3 of a kind, 4 of a kind, and chance. After filling in sixes with an 18, keeping 3 6s on reroll 2 comes between 3 4s and 3 3s, while keeping 2 6s comes between 2 5s and 2 4s. On the first reroll, 3 6s comes between 3 4s and 3 3s, while keeping 2 6s comes between 2 4s and 2 3s.
Fives also just drop a few spots. 3 fours drop a few spots, and 2 fours drop pretty much to the bottom. 3 threes drop considerably, and 2 threes are no longer worth keeping at all. 3 twos start getting beaten by pairs of larger numbers, and 3 ones drop to one of the worst case scenarios.
If small straight is filled in, you only keep 2345 on the second reroll, and a few other combinations of 4/5 of a straight on the first reroll.
If most of the top boxes are filled in, the missing number becomes more valuable. I tried example where we had the entire top section filled in except 3s, with 54 points in the top section, and an empty bottom section. On the first reroll, not that much changed. Groups of threes basically just moved above other groups of the same size. 4 3s was between 4 5s and 4 6s. 3 3s became the best trio, 2 3s became the best pair, and 1 3 became the best singleton. On the second reroll, though, there was a pretty big difference, especially on 3 3s, which went ahead of full house, all small straights, and 4 1s or 2s. I suppose this would be different with different numbers, or if 3 of a kind/4 of a kind/chance are filled in, but that's hopefully a decent start.
Thanks so much for the reply!
That's actually less of a change than I was expecting. Pairs may get more or less valuable, but they still are mostly near other pairs.
I did have another idea to try and get some sense for the full decision tree. Take a particular roll - say 13345. You could keep the 33, you could keep the 345. We know on the overall first roll you do the former, and the second you do the latter. Why not go through every state and ask what to keep for this roll? Then you can build a pie chart showing what wins, and you can condition the choices (33 is kept on 70% of first rolls, but it drops to 40% if the top 3s box is full).
I admit your initial results imply this may not change much. On the first reroll the pair is better. Filling in the top 3 box makes it worse, but it seems to mostly make it worse compared to other pairs, and not to straights. That could just mean the interesting candidates are rolls like 22344. Maybe broadening the roll to some category is a better way to get insights. Or maybe it should be more a question of scoring. You finish your turn with a full house. How often is it a full house, 3 of a kind, or chance across all game states?
I should also mention in making the lists I was heavily inspired by video poker, of all things. The exact strategy depends strongly on the payouts of the machine you're sitting in front of, but see an example here:
https://wizardofodds.com/games/video-poker/strategy/jacks-or-better/9-6/intermediate/
That page has a strategy like the one I wrote, but it also has an alternative where the presentation is "here's a common decision and how to resolve it".
This looks fascinating. Thank you so much. I'm excited to read the page.
I definitely like this approach to the analysis. I probably won't have the time to run the analysis any time soon, but I'll let you know if an end up getting it working.
here's a question, what's the worst case scenario for your algorithm? what's the worst dice to roll if you're playing perfectly, to get minimum possible score? it'd be interesting to see if the worst rolls change as the perfect player progresses through the game and how the player responds (what they decide to sacrifice or settle on after a while)
This is a fun question. The minimum possible score with the point maximizing strategy is 12. The sequence is
1 in ones (12355, this appeared briefly in the video as the second worst roll for round 1)
0 in 4kind (eg 11345)
0 in Yahtzee (eg 11113)
2 in twos (12366, putting a 1 in 2's sometimes becomes worth it once 1's is filled)
0 in threes (eg 11226)
0 in fours (eg 12233)
0 in fives (eg 11334)
0 in full house (eg 11334)
0 in sixes (eg 12233)
0 in large straight (eg 11233)
9 in chance (11223, anything lower would give you a 3 of a kind)
0 in 3kind (eg 45566)
0 in small straight (eg 56666)
could you share what the rolls are in each turn?
Edited. There are plenty of examples that work for most of the zeros (as well as possibly for the twos roll). The ones that were actually chosen are essentially random.
would you consider sharing tables of optimal strategy for other boxes if yahtzee bonus is possible? i was very intrigued by the small straight and large straight tables with that in consideration
I put in some tables for the last reroll for 3kind, 4kind, chance, and threes (with 54 points in the top section, so you need 3 3's for the bonus). I'll try to add the first reroll if I have some time later.
Hey Patrick,
I found your channel via your first video about battleship, but this one for me was even more interesting. I recently started playing some Yahtzee, mostly by myself (as you said, it really IS a disguised single player game) just to see how hight I could score. Maybe I can enhance my score even further now :)
My friend and I are currently students at the university of Passau, Germany and we are doing a research project about becoming successful on youtube. Your channel is really outstanding in a way that it got traction so fast. It seems that after all quality gets rewarded on this platform ;)
For our project we would love to talk to someone like you, who managed to start and grow a channel seemingly out of thin air.
So if you'd be willing to do a short interview with us, that would be amazing! If you are interested, I'll send you our contact information.
Sorry to bother you here, I couldn't really find another way to contact you. Keep up the great work! :D
Wishing you all the best,
Kilian & Josh
Thank you so much for reaching out! I'd be happy to talk. The best way to reach out might be via email (you can find it in my YouTube channel description), but I'm looking forward to talking.
Thank you so much! I'll send you an email! :D
Did you get it? I sent it at patrickhliscio@gmail.com.
Hello. I just wanted to confirm that we were still talking today? I'm not sure if you got my email.
I replied to your email. Did you not receive it?
Extremely helpful for an avid and competitive player like me. Thank you! :)
Thank you so much! I'm glad to hear it was helpful.
Could you add analysis on the European yatzy rules ?
To expand on that, "Kniffel" (the German version of Yahtzee) has only minor variations regarding extra yahtzees:
* The bonus points for an extra yahtzee are only 50, and they don't count for the game score. They are added to the total score across multiple games, but don't count for your single game score.
* A yahtzee (extra or not) cannot be used as a "joker". It can never count as a straight or full house, and only scores points on the upper half for the corresponding number you rolled.
I didn't talk much about how to handle Yahtzee bonuses, so most of the things in the video don't actually change much. A Kniffel would become slightly less valuable, meaning that it would pretty much always be the first thing to zero out, even earlier in the game. It also means that in endgame scenarios, it would almost be better to just ignore the possibility of getting a Kniffel and just focus on the empty box (In Yahtzee, it sometimes becomes better to try for a Yahtzee instead of the boxes that you're missing).
It would take a lot of work to adapt and run my code, but I can talk a bit about the differences. I think the biggest change is the addition of the pair and two pair. Those aren't very hard to get, and they aren't worth much, so they sort of just give you two extra chance squares (maybe not as much for the two pair, but definitely for the pair). This means that it's even more important to get the other bonuses, especially the top bonus, since you effectively have more chances to mess up, giving you more chances to get the other bonuses. They also make it slightly more important to keep high numbers, since they are scored using the sum of the relevant dice.
Hi Patrick, Thank you for the great analysis and the reply, really interesting to see.
I think that the differences are quite a bit bigger and ends up resulting in quite different strategies being important ... with interesting questions on best trade-offs that are hard to work out. Some examples:
- Lack of bonus for multiple Yatzy and lack of joker rules on multiple yatzy changes when you will want to zero it out (and makes straights harder to get)
- small straight is 1,2,3,4,5 so much harder to get - and only worth 15 - so best square to zero out early? ... but large strait is 2,3,4,5,6 and worth 20 - so good to keep both available so that keeping 2,3,4,5 gives you a good chance of one or the other? (also when should you keep a 6 to go for 20 points vs keep 2,3,4,5 to maximize chance of one straight or the other?)
- for 3/4 of a kind & full house only the matching dice count (i.e. 1,1,1,5,6 is worth 3) - so you never want to make them with 1s or 2s - but when do you want to keep which dice under these rules?
- 1&2 pair are not so useful as a chance as you need to make them with high dice (only the matching dice count). 2 pair is interesting because of tradeoffs on when to keep which dice I think.
Overall strategy is quite different because of the importance of having high dice in so many combos below the line ... but at some stage you need to aim for at least 3x 2s,3s or 4s to fill up above the line to get the bonus there...
Any further thoughts on these points?
These are good points. I checked the rules and saw that the game still had small and large straights, but forgot to check to see whether they meant the same thing as in my version.
Having the straights worth less points while also making both of them significantly harder probably makes them much less worth trying for. Small straight presumably becomes one of the first boxes to zero out, followed closely by the large straight.
Granted, most of the other bottom section boxes are also worth less (you don't get points for unused dice in 3kind and 4kind, and full house is also worth less). The Yatzy and top bonus become much more important here. It's probably important to get the top bonus almost every time, both because it's more important, and because the game has more turns. The Yatzy also becomes more important, although the odds are still probably only about 50%.
There's also a much bigger emphasis on getting big numbers, since essentially every bonus except for the straights and Yatzy depend on it. I still think the pair is one of the best places to put a roll that otherwise doesn't do that well, since it's worth a maximum of 12 points compared to 22 for two pair and 30 for the chance. Getting 4 points on the pair would be bad, but a lot less bad than getting something like a 15 on chance.
It probably takes away a lot of the variation in the game, since keeping your biggest dice becomes the dominant strategy for most of the game, and you have more fallbacks if you miss on the 3 of a kind, 4 of a kind, full house, and good top boxes.
Excellent content and you communicated it very well in the video. Maybe I missed it and I can probably google an answer but think it would be good to add somewhere.... What is the MEDIAN score when played optimally? Would be fun to see how often I can beat that using my intuited strategy. Thanks!