I’ve been asked in- and off-blog to compute the probability of getting three-of-a-kind or better when throwing 3, 4, 5, or 6 dice. (That is, I only care about scoring combinations other than singleton 1s and 5s.) This is straightforward, so I just give the answers for anyone interested (after the jump).
1. Three-of-a-kind or better
(The answers for 3, 4, and 5 dice are copied from a recent comment.)
With 3 dice, there are 6 possible three-of-a-kinds out of 216 possible throws. The odds are 35:1 against (2.78%).
With 4 dice, there are 6 possible four-of-a-kinds and (4)(6)(5)=120 possible three-of-a-kinds out of 1296 possible throws. The odds of three-or-more-of-a-kind are 65:7 against (9.72%).
With 5 dice, there are 6 possible five-of-a-kinds, (5)(6)(5)=150 possible four-of-a-kinds, and (10)(6)(5)(5)=1500 possible three-of-a-kinds out of 7776 possible throws. The odds of three-or-more-of-a-kind are 85:23 against (21.30%).
With 6 dice, there are 6 possible six-of-a-kinds, (6)(6)(5)=180 possible five-of-a-kinds, (15)(6)(5)(5)=2250 possible four-of-a-kinds, (20)(6)[(5)(5)(5)-5]=14400 possible three-of-a-kinds, and (15)(20)=300 possible double three-of-a-kinds. We should probably also include the 6!=720 straights and the (20)(90)=1800 possible three-pairs. This is a total of 19656 “good” throws out of a total of 46656. The odds are 125:91 (which lies between 4:3 and 5:4) against (42.13%).
2. Expectation
Ultimately I’d like to use these numbers (and the ones from the previous FARKLE post, and a few others that aren’t much harder to generate) to formulate an “optimal strategy” for playing FARKLE. But before we can do that, we have to nail down what it would mean to play a game of chance “well”. (It turns out it’s not so obvious and clear cut as you might think!)
To do this, we’ll need a basic concept from probability and statistics, the expected value or expectation. If we have a universe of possible outcomes, each of which has a certain “value”, then the expected value is a sort of weighted average of these values.
Example 1. I roll a fair, ordinary 6-sided die. This die has six sides, each of which comes up with probability 1/6. The expected number of dots to come up is (1/6)1+(1/6)2+(1/6)3+(1/6)4+(1/6)5+(1/6)6=3.5.
Example 2. I roll a fair, ordinary 6-sided die. This time, if I roll the side with dots, I get
points (at whatever game I’m playing). The expected number of points to come up is (1/6)1+(1/6)4+(1/6)9+(1/6)16+(1/6)25+(1/6)36=15.1667.
Example 3. I roll a 6-sided die, but the die is loaded so that the side with six pips comes up half the time, and the other five sides are equally likely. The expected number of dots to come up is (1/10)1+(1/10)2+(1/10)3+(1/10)4+(1/10)5+(1/2)6=4.5.
Simple concept, relatively easy to work with and apply.
Note that the expectation is not necessarily the most likely outcome. So expected value doesn’t mean “value I expect” or “predicted value”. In the case of flipping ten coins, it so happens that the expected number of heads is 5, which is also the most likely number of heads, but this phenomenon is not universal. If you choose a number between 0 and 10 which each outcome equally likely, the exxpected value is 5 even though all the other numbers are just as likely as 5. More drastically, if you roll a fair 6-sided die, then the expected value of the throw is , which is not even possible.
It’s used very frequently in applications, particularly financial applications, because it is very often the most convenient to work with. But, the expectation is not necessarily the only number that matters when evaluating the relative merits of something.
Good ol’ FARKLE provides a good illustration of this phenomenon.
3. Back on task: FARKLE
So where are we on the bigger task of finding an “optimal strategy” for FARKLE?
Well, using the point values of each of the various scoring combinations and the probabilities of each combination occuring with a certain number of dice (many of these numbers have already been given in this blog), it would be pretty straightforward to answer the following.
1) In any situation, what should I do (what to hold/reroll and when to stop) in order to maximize the expected score on a given term.
The only real trick is to think about how to properly value the opportunity to reroll all six dice.
A slightly more sophisticated question, then, is
2) In any situation, what should I do (what to hold/reroll and when to stop) in order to maximize the expected score over a ten-turn period? (In other words, how do I maximize the expected value of my score for FARKLE simple?)
The reason problems 1 and 2 are different is that there is a 500 point penalty for farkling three times in a row. Solving this problem is a bit more tedious but still quite feasible.
It turns out, though, that this probably isn’t what we actually want to know! It’s easy to assume that since a high score is a good thing, maximizing expected score is the goal. But no! If you’re actually playing this game, you’re probably trying to get a score high enough to top the high score list, or beat a particular friend, os something like that. So the problem we actually want to solve is the following.
3) Given a certain target score, in any situation, what should I do (what to hold/reroll and when to stop) in order to maximize the probability that I will get a score higher than my target?
Why isn’t that the same as problem 2? Because if I want 9000 points, then a final score of 8950 is no better that a score of 100 in my eyes. To get a chance at a high score, it may be necessary to make risky choices that will give very low scores if they fail.
This is easiest to see in an example. The all-time high score in my friend group, which I am trying most fervently to beat, is Maura’s unbelievable 13950. Imagine I had a cheat option where I could just score 1350 points for a turn instead of rolling normally. Now, the expected value of a well-played FARKLE turn is far below 1350, so from a problem 1 or 2 point of view, I should always use this option. My average score would be MUCH higher that way. But my chances of beating that elusive 13950 would be zero.
So far we’ve been talking about the solitaire FARKLE variation. What about the classic version, where the goal is to get to 10000 points before your opponent? Can we solve this problem?
4) In any situation, what should I do (what to hold/reroll and when to stop) in order to maximize the probabiity of winning FARKLE original?
To do this and do it rigorously is seems intractable (mathematicians’ jargon for hopelessly hard). What makes it hard is how to factor in information about the opponent’s score. We can probably use this to our advantage, at least in principle (we could take more risks when it is comparatively safer to do so). Much easier, and probably just as useful, is to simplify the problem by ignoring the opponent and just playing to finish as fast as possible.
5) In any situation, what should I do (what to hold/reroll and when to stop) in order to minimize the expected number of turns it will take to get to 10000?
Notice that problem 5 is NOT, in general, equivalent to problem 1! It might seem that trying to get as many points as possible each turn is the same as trying to get to a certain total as fast as possible, but this is not true. Let this serve as a final lesson of how misleading intuition can be. To make this exaggeratedly clear, imagine a variation on FARKLE in which there is the option, instead of taking a normal turn, to take a one in a million chance at getting a trillion points. From an expected-score-per-turn point of view, this is a great option — it yields an expected score of a million points! But from a expected-time-to-finish point of view, it’s terrible; the expected number of times to finish is a thousand turns.
[…] Permalink: FARKLE, Expectation, and Knowing What You Want […]
This is an interesting problem, optimizing dice rolls with a particular, non-simple game in mind.
The strategy I have taken is to play for the N-of-a-kind. That is, to remove the least number of dice possible, in order to maximize the odds of the big points. So, if I roll a 1-1-5-5-3-4, I’ll pull a 1 out and roll 5 dice. I throw out 2-2-2 and sometimes 3-3-3 unless I don’t have an option.
The probabilities I’m looking for (and I’m too lazy to compute right now) are the odds of using all of the dice. IOW, if I roll N dice, what are the odds of all N of them being useful at once and I get a full cup of dice to shoot again.
The other part of this is, what is the cutoff score for rerolling N dice? What are you willing to risk to roll 1 die? I’ve farkled 2700 points off of 6 dice, but I never would have gotten that far had I not been willing to throw 2 dice. What score are you willing to risk for a 33% chance of getting at least 500, more probably 750, and possibly 2000 if you manage a straight on your next roll. 450? 300? 900?
What I have done is cooked up a spreadsheet that tracks my farkle scores. I track the min/med/max, +/-2 sigma. As for your friends’ 13950, look at my distibution, and you can see I have 3 10k games that are all on a long tail. Those games were gifts. In one, I rolled 2 straights in a row, another I rolled 3 pair, 5×1+5, and then 4×6. My 12450 I farkled twice, the 12k not once. Few games are like that. My 10500 game was the one I farkled 2700 points. I think its mostly luck but you need to have a strategy that takes advantage and plays for lucky streaks, with a conservative backup. And play a lot of games 🙂
Here is the spreadsheet.
http://spreadsheets.google.com/ccc?key=0AiCaQ3LQ24c2dFJyQTJETWNGeDV0d184SG5mUThjaHc&hl=en
Great work and great analysis. You’re on the right track! I know that the type of strategy you describe is the right one, at least in almost every situation. There are still some borderline cases I need to analyze before I can make the conclusive statement. (“When do I take a set of three 3’s?”, for example, is just outside the reach of what I can say for sure.)
But I can answer the question you asked. If you roll n dice, the probability of being able to score them all and get a new batch of dice is given below. (Picky point: this calculation uses the facebook convention where three pairs is necessarily three different pairs, not a four of a kind and a pair.)
n=1: 1/3 (33.33%)
n=2: 1/9 (11.11%)
n=3: 1/18 (5.56%)
n=4: 13/324 (4.01%)
n=5: 59/1944 (3.03%)
n=6: 101/1296 (7.79%)
I’ve been thinking about this problem myself, and getting serious enough that I realized I ought to be looking to see if anyone else had done this already (Clearly the best idea I’ve had all day).
Knowing what score I am trying to beat definitely changes my strategy. You have to take risks to score high, and at the same time cash in your winnings.
A tale to tell: Yesterday I scored my all time high of 12000+, beating my friend’s top score by at least 2000 points. Within 8 hours he had me beaten again with a score of 14000+! Sometimes life just is not fair.
Well done!
I follow a similar strategy and have questioned that ‘threshold’. I ran with 1000 for a while, meaning I didn’t ever take anything less than a thousand. I set a couple new high scores, but had a bunch of lousy games as expected. Higher aggression leads to lower average, but higher upside.
So I wrote a simulation. Full on Farkle game. Then wrote in my ‘system’ for when to go and when to hold. I am using the Facebook scoring system.
Once I worked out the bugs, I started running many games – a couple thousand games at the following thresholds: 300, 500, 750, 1000, 1500.
Here’s what I learned. If I simulate only a couple hundred games. The above simple theory holds. Regardless of the system, the threshold sets your aggression to a point. So over a couple hundred games, I wouldn’t receive any big games, maybe 8k or 9k for 300 and 500 thresholds.
And the averages were in the 4k’s.
The higher the threshold, the lower the average, but there were some big hitters in there. 10, 11, 12k. But some diminishing returns on 1500.
I then figured, it was obviously, being that aggressive will only pay off after MORE games. But it’ll pay off BIG.
Not quite, and it made sense afterwards. It did pay off big, but like 12k. hmm. And the average sucked. So there seemed to be diminishing returns with only 10 rounds. I then noticed that at 2000+ games, the MAX on the 300 and 500 were also way up there.
It started to click. As mentioned above, to get to the really high scores you aren’t keeping 300 or even 1000/round. You need BIG scores. So the higher threshold ups your chance to sticking around long enough in a round to get on a lucky streak. But once on the streak it doesn’t matter what your threshold was. If the basis is only 300, you just won’t stick around long enough, but the lucky streak may hit from the first roll and again, the threshold is irrelevant.
Interesting to me.
So there’s a balance in there. Higher threshold gives you a chance of getting to a higher max score more readily. But it doesn’t mean you will get any higher than with a lower threshold. And it’ll be frustrating while you do it. You have to have confidence and keep at it.
Thoughts?
p.s. the results are on another machine or I’d post some of the numbers. Perhaps if there is interest I’ll still do it.
Another way of thinking about the problem would be to set a threshold based on the score and the number of dice.
For instance, what is the threshold score you would require yourself to have in order to bank with three dice left. Then what is it for four, five, and six. Obviously it should increase with the amount of dice you have for the next throw.
I imagine you could run a simulation setting rules for each of these situations (3-6 dice thresholds), possibly always rerolling 6 dice no matter what.
Great article. It’s not nearly as simple a question as it seems. I’m tackling this problem too at my website, and have written a farkle simulator in C which so far I’ve used to come up with probability charts for all the rolls. If playing someone else, and merely trying to win, there is a “dueling strategy” element which really complicates the situation.
Thanks for writing this article.
Your example of the 1 in a million chance at a trillion points is interesting. It says that you shouldn’t pursue options with positive scoring expectation if the probability of the payoff event is so small that it’s unlikely to occur within the scope of a game bounded by turns or points. By similar argument, you can (should) pursue options with negative scoring expectation if the probability of the loss event is so small that it’s unlikely to occur within the scope of the game. This starts to sound a little more like a possible Farkle situation: even if you have a very large number of points accumulated, maybe you should go ahead and roll 6 dice because the chance of a 6-die farkle over the course of a game is small.
So when you’re dealing with extremely improbable events relative to the length of a game, the strategy that (on average) lets you reach your goal quickly can deviate from the strategy that gives you a high expected score.
But what about choices associated with events that are NOT improbable relative to the game length? Do fast strategies and high expected point strategies faced with these choices tend to make the same decisions?
Clearly if the game is long enough (enough turns, or the target score is high enough) then the fastest strategy degenerates into highest expected score strategy. Even the option to take a 1 in a million shot at a trillion points becomes attractive to the fast strategy if the game doesn’t end till you reach a quadrillion points.
But when you’re dealing with only 10 turns or a smallish 10,000 point goal, it’s not so clear to me when the fast strategy will agree with the high expected point strategy.
My thinking is muddled. I should ponder this some more.
[…] FARKLE, Expectation, and Knowing What You Want, Cap Khoury, August 2009. Post a comment | Trackback URI […]