How many dice rolls are needed for N people to hit a target?
There is a group of n people, where n is more than 0. Everybody rolls a dice with a successful probability p. If a person’s roll is successful, they stop. If unsuccessful, they keep rolling. How many rounds of rolling dice until everyone has succeeded?
The expected amount of rolls for n people with an individual roll having p success, where n is a positive integer and p is a probability between 0 and 1, is the following equation:
Pretty complicated! I’ll break it down.
Background
A few years ago, I was playing The Oregon Trail: Hunt for Food Card Game with some friends. The goal of the game is to hunt for food before starving or running out of bullets. Each animal card requires a different dice roll to kill – a buffalo might require a 4 or lower on a dice roll (a 2/3 chance), while a rabbit might require rolling a 5 or a 6 (1/3 chance). To successfully get the food every active player needs to roll the target number. On every round of rolling one bullet is discarded. If some players do not meet the target number the group has the option of spending another bullet and re rolling (only those who did not meet the number roll again). You have a limited amount of bullets. Players can exit the game, lowering the amount of succesful dice rolls needeed.
In the interest of conserving bullets in order to win the game, tradeoffs need to be made. Is it smart to go for a low % chance target with 6 people playing? Should you wait until you only have 2 people left? Etc.
Basic Probability and Math
Feel free to skip this section if you’re familiar.
When calculating the expected value of a random outcome, you multiply the result of each outcome and the probability. The expected value doesn’t measure the most likely result to happen, but rather the average of all results over a long enough time.
For example, flipping a fair coin has a 50% chance to be tails, and a 50% chance to be heads. If we say tails is 0 and heads is 1, we can get the expected value by multiplying each value by it’s probability (.5) and adding the two values. We get an expected value of .5. On any individual coin flip we can only ever get 0 or 1, but over the long run we know the average will be in the middle.

The same goes for a dice. There are 6 sides, each are equally likely. If we get the expected value of a dice roll [(1 * 1/6) + (2 * 1/6) …] then we get an expected value of 3.5. Again, we can’t roll a 3.5, but if you roll a dice 10,000 times the average will be very very close to 3.5.

When all outcomes are equally likely (as in a dice roll or coin flip) it’s equivalent to taking the average of all outcomes. If certain outcomes are more likely than another, those will weigh more heavily. It’s important that all of the probabilities sum to exactly 1 (or 100%).
Independent events
If two events are independent (e.g. two people flipping a coin), the probability that both events will occur are multiplied. If person A is flipping a coin with probability .5 to be heads, and person B is flipping a coin with probability .5 to flip heads, the odds they will both flip heads is , or 25%.
Piecewise function
Throughout this article I’ll be using piecewise functions. The easiest way to think about it in this context is that each row on the right side refers to a possible outcome. The first column is the expected value and the second column is the probability.
For example, here’s an equation modeling the expected value of a dice flip, where the odds of flipping a heads is denoted by p:
The top row on the right side represents a heads: the outcome is 1 and the
probability is p. The bottom row is a tails flip: outcome 0, probability
is 1-p. To get the total expected value, we multiply each outcome by its
probability and sum the totals. E.g.
The expected value of a coin flip (where heads is 1 and tails is 0) is the probability of flipping heads.
Binomial coefficient
The binomial coefficient function
(also known as a “choose function”) is a way of choosing k elements from n options.
As an example, if you flip a coin 4 times, how many times can you flip exactly 3 heads? Four ways. Here are the possible outcomes:
- {H, H, H, T}
- {H, H, T, H}
- {H, T, H, H}
- {T, H, H, H}
Using the binomial coefficient, we can set n to 4 and k to 3 and calculate:
The function gets really useful with large numbers. What about flipping exactly 25 heads in 50 coin flips? There are far too many options to fill out that table we did earlier. Plugging it in to the binomial coefficient function, we get 126,410,606,437,752 ways to flip exactly 25 heads in 50 coin flips.
Summation
More on the algebra side than probability, but in case you forgot a summation function simply sums each value where the variable range is set at the bottom and top. In the following example, k is 1, then 2, then … all the way up to ∞.
Solving the Problem
Now that we have the background knowledge needed for the solution, let’s walk through the problem. We’ll start with the simplest case - one person - and work our way up.
One Person
The simplest case is one person shooting – what is the expected number of dice rolls before you complete a roll with probability p?
Let’s say a person is rolling a fair dice. If they roll a 1, 2, or a 3 they stop, otherwise roll again. There’s a 50% chance they’ll only need one roll, and a 50% chance they’ll have to roll again. The probability of the negative outcome can also be represented as one minus the probability of the positive. In this case, they’re both .5.
We can get the total expected value by multiplying each outcome and the probability that it will happen.
For an probability of success of 50%, the expected amount of rolls is 2. Running a simulation over 10,000 times, we get the following result:

We can generalize this for any probability p:
Solving for E:
The expected number of rolls to hit a probability p is 1/p. So if the dice roll has a 50% success, the expected roll amount is 2. If there’s a 1/3 chance (say, a 1 or a 2), the expected roll amount is 3. If there’s a 2/3 chance (say, roll a 1, 2, 3, 4), the expected roll number is 1.5.
Two people
Things get a little more complicated here. Now we only stop rolling once everyone has had a successful roll.
What the above function signifies is that the chance of both players rolling successfully (denoted by p) is . Remember: two independent events (like dice rolls) multiply their probabilities together.
The middle row is the event that one person has a successful roll and the other fails. The expected value is : 1 for the roll we just had, and the expected value of 1 person rolling p. The probability that one person will succeed and one person will fail is . We need a multiplier of 2 here, as there are two ways for only one person to succeed (either A succeeds or B succeeds).
The third row is two failed rolls – the expected value is 1 plus the expected value of 2 people rolling with p (as there are no successes, we are in the same spot).
Solving for this is a little trickier. We know from the one person exercice that can be simplified to
Plugging .5 into the equation, we get an expected value of 2.66 rolls. Let’s see
if the simulation backs that up.

What about ? Plugging it in to the function gets an expected # of rolls of 4.2, does the simulation back that up?

Great!
Three or More
Solving out the equation for 1 or 2 people is trivial. It starts to get more complicated with 3 or more dice. We could do the same thing as earlier: write out the piecewise function for each n, plug in the previous solved result, and continue. What we’d rather have is an equation that solves the issue for any n.
Let’s start by writing out the piecewise function for n=3 and n=4 and see if there are any patterns that emerge:
Starting to see a pattern? This is where both the summation and binomial coefficient come in. Look at row 2 in the case –– the probability that 3 people will succeed and 1 person will fail is . The 4 multiplier is there because there are 4 ways for 3 people to succeed and one to fail: {Y, Y, Y, N}, {Y, Y, N, Y}, {Y, N, Y, Y}, {N, Y, Y, Y}.
We can substitute the choose function into the equation as so:
The numbers all start to line up here. Notice how the exponent for p, (1-p), the input to choose, and the input to the inner expected value all line up. We can further combine this piecewise function into a nice summation to simplify the whole equation:
Substituting 4 for a generic n, we get:
This could work as a solution. There’s a big problem, though: we are defining by using itself. When k=n, appears on the right side of the equation. We need to edit the equation so that cannot happen.
Because a summation is additive, we can change the bounds at the top and pop out the final part.
There’s one final problem – what happens when ? In the summation it will call , which will result in a divide by zero error. We need to start the summation from and add , the expected value of everyone rolling perfectly the first time.
Solving for and give the same closed-form solutions we found earlier.
We can verify the equation is correct by running the simulations and comparing the expected result. The following table is for (roll a 1, 2, or a 3):
| n | expected | simulation (10,000 iterations) |
|---|---|---|
| 1 | 2.00 | 2.00 |
| 2 | 2.67 | 2.67 |
| 3 | 3.14 | 3.14 |
| 4 | 3.50 | 3.54 |
| 5 | 3.79 | 3.84 |
| 6 | 4.03 | 4.02 |
| 7 | 4.24 | 4.24 |
| 8 | 4.42 | 4.42 |
| 9 | 4.58 | 4.58 |
| 10 | 4.73 | 4.71 |
Our equation matches up with the simulated averages.
Here is the final result table, for each probability that exists in the game:
| N | P | ||
|---|---|---|---|
| 1/3 | 1/2 | 2/3 | |
| 1 | 3.00 | 2.00 | 1.50 |
| 2 | 4.20 | 2.67 | 1.88 |
| 3 | 5.02 | 3.14 | 2.16 |
| 4 | 5.64 | 3.50 | 2.39 |
| 5 | 6.13 | 3.79 | 2.58 |
| 6 | 6.54 | 4.03 | 2.73 |
| 7 | 6.89 | 4.24 | 2.86 |
| 8 | 7.20 | 4.42 | 2.98 |
| 9 | 7.48 | 4.58 | 3.08 |
| 10 | 7.72 | 4.73 | 3.17 |
Conclusion
In the context of the game, it’s pretty obvious that you want to conserve your shots until you have far fewer people rolling. The difference between a 1/3 chance shot (e.g., roll 1 or 2) when you have one person or three people is two full rolls. Also, even though the 1/3 roll is half as likely as the 2/3 roll, you quickly begin to be less than half as likely to complete. With 1 person rolling the odds of getting the 2/3 shot are twice as likely as 1/3, when you get up to 6 people, it’s 2.4x as likely.
If you ever decide to play this game, consult the chart before you rush off and attempt a 1/3 shot with 6 people.
-C