Skip to Content
 

Can Someone Compute the Probability of Success in my New Game Mechanic?

26 replies [Last post]
Toa Lewa
Toa Lewa's picture
Offline
Joined: 10/31/2013

As far as I know, I have created a new dice battle mechanic. Because I am not great at statistics theory, I was wondering if someone could compute some probabilities for me. Here is how the battle mechanic works. Each player rolls a number of dice equal to his or her attack or defense value and checks the value of his or her highest valued die. Whoever has the highest die value wins. If there is a tie, each player checks the value of his or her second highest die, and whoever has the highest value on their second die wins. If there is still a tie, the players check their third highest die and so on. If all dice are ties, the defender wins (I doubt this will be rare). If players tie, but another player have more dice leftover, the player with more dice wins.

Here is an example of a battle. Player One has an attack value of 3, so he rolls three dice. The values are 6, 5, and 4. Player Two has an attack value of 4, so he rolls four dice. The values are 6, 5, 2, and 1. Both of the player’s highest dice are 6s, so each player checks his second highest die. The second highest dice are both 5s, so each player checks his third highest die. Player One has a value of 4, and Player Two has a value of 2. Therefore, Player One wins the battle. Here is one more example. Player One has six dice, and Player Two has 1 die. Player One rolls five 1s and one 2. Player Two rolls a 6. Player Two wins the battle.

I’m wanting to know what the nuances are of this battle system, and I’m wondering how drastically the number of dice each player has effects the probability of winning a battle. I’m assuming that the chance of winning or losing will be 50:50 when players roll the same amount of dice, but what is the probability of winning when one player has 1 die, and the other player has 2? What about 1 vs 3, 1 vs 4, and 1 vs 5? Is the chance of winning with 4 vs 5 the same as 1 vs 2? A probability table would be very helpful. I don’t know how to compute values like these, and I would be very grateful if someone could help me with this.

RyanRay
Offline
Joined: 03/27/2014
http://anydice.com/
N_Andersen
Offline
Joined: 01/07/2013
I think the way to solve this

I think the way to solve this is -

First consider the probability of two dice rolling the same value. With 2 d6 you have 36 total combinations. If you wrote out every combination, you would see 6 results have the same value on each die. Assuming every value is an equal probability on both dice, the probability of the first roll is 6/36 or 1/6.

Then consider the same probability a second time. Again, the probability of the second roll is 1/6. The two events (roll 1 and roll 2) are independent so you multiply the two probabilities = 1/36.

Repeat until you get an uneven number of dice. If both sides have three dice, the odds of tying all three times is 1/216. Four dice would be 1/1296.

So if your base system is to have three dice most of the time, sometimes more, that fourth die will only be an advantage (automatic win) 1/216 of the time. If your base system is to have two dice most of the time, the third die is an advantage 1/36 of the time.

If I've got this wrong then please don't be shy about correcting me. It's been a little while since stats.

N_Andersen
Offline
Joined: 01/07/2013
No, I am wrong. The dice

No, I am wrong. The dice rolls aren't sequential. I will need to think this through some more. I enjoy this sort of problem, so thank you for posting it!

FWyver
Offline
Joined: 06/14/2014
This is a tricky one.. For a

This is a tricky one..

For a second I thought it was really simple, as all the mechanic is really doing is comparing the dice to find the highest value. However I'm a little stuck at the resolving draws situation (and I'm not even sure that it makes a significant difference..).

Lets consider a simpler system for the moment;

If we ignore draws for now, and take out the idea that the dice are grouped by players, we can just worry about how many dice there are in total the problem becomes pretty straightforward,

With two dice, the likelihood of any given dice being the highest (ignoring draws) is 1/2 as the probabilities of any result on either die are absolutely even. I.e. each dice is just as likely to roll higher than the other.

If we add in an additional dice, the probability of any individual dice being the highest becomes 1/3
With four dice it's 1/4 and so on.

So, if we group these dice by players, say 1 player has 2 dice and the other has 5, the probability of any individual dice being the highest is 1/5. As the dice are unevenly distributed, the probability of the player with 2 dice winning is 2/5 and the probability of the player with three dice wining is 3/5.

This should hold true with any number of dice; if one player has 36 dice and the other has 64 the probabilities are 36/100 vs 64/100

However, as I said at the start, this does not take into account draws..

The chance of any two dice rolling the same result is 1/6, but the chance of a double ALSO being the highest result is trickier to calculate..

For each number we can roll we know how many other numbers will beat it,
2, 3, 4, 5 & 6 beat 1; so 1 has 0 chance of winning
3, 4, 5 & 6 beat 2; so 2 has 1/6th chance of winning
4, 5 & 6 beat 3; so 3 has 1/3rd chance of winning
5 & 6 beat 4; so 4 has 1/2 chance of winning
and 6 beats 5; so 5 has 2/3rd chance of winning
Nothing beats 6; so 6 has 5/6th chance of winning

We also know that any given result has a 1/6 chance of drawing against the opponents roll.

Lets draw a little chart:

Result---Win---Draw---Lose
1--------0 ----1/6----5/6
2-------1/6---1/6----2/3
3-------1/3---1/6----1/2
4-------1/2---1/6----2/6
5-------2/3---1/6----1/6
6-------5/6---1/6----0

Somehow we need to factor in the likelihood of draws on the highest roll, and the subsequent likelihood of successes.. This is where I get out of my depth!

However, I suspect the simpler solution at the top is a pretty close model of the actual probabilities (there will be probably be a small skew in favour of the player with more dice), and if I were working with your system it's probably the one I'd have in my head when distributing dice.

X3M
X3M's picture
Offline
Joined: 10/28/2013
I would love to help you. But

I would love to help you. But calculating this proves to be very complex.

First of all, the best die is put in the first place. And no matter what you throw, you get a line of dice lined up from high to low.

The defender does exactly the same. And the 2 lines are compared.

Of course there are dice that can be discarded at a certain point. After all, the difference of the check is only 1. For example 3 versus 2 where the third die declares the winner. However, this may not be done before the throw, only afterwards. Because each die, no matter how many, gives a chance to throw a high number. (Many would fail to think of doing that correctly)

At this point, I can only conclude. It can be done.
But it takes a lot of time.
Why? Because during the calculating path, rules for calculating, "change". The calculation needs to be done in steps. (Don't get me wrong, I normally go to 10 dice, but even 3 are a nuisance right now).

Just trying to get the rules straight:
- Attacker dice lined up
- Defender dice lined up
- Only 1 die is checked.
- If a tie, next die. Until we run out of dice. (If one player has more dice, the other player has a "0")
- Still a tie? Results for the defender to win.
Correct?

With lining up, there will be doubles. Whoever calculates this, the doubles have higher chances to occur. So no scratching possibilities in this one ;).

Ok, lets start, so we get an impression of how long it would take. (And perhaps some one comes with an easier way to calculate)

First I create a 1 die versus 1 die situation.
Excel is great for this. And I simply compare 1 to 6 with 1 to 6. With 36 possibilities, an easy way to have an overview is by subtracting the defender from the attacker.
- All 0 means a tie. If it is the last die, the defender gets extra wins.
- Any lower then 0 means the defender wins.
- And any positive number is the attacker winning.

1 2 3 4 5 6
1 0 -1 -2 -3 -4 -5
2 1 0 -1 -2 -3 -4
3 2 1 0 -1 -2 -3
4 3 2 1 0 -1 -2
5 4 3 2 1 0 -1
6 5 4 3 2 1 0

More then 1 die comparison:
Attacker 15, Tie 6, Defender 15
The last die comparison:
Attacker 15, Defender 21

From this I can conclude that with 1 attacker versus 1 defender.
The win/loss is 41,7%/58,3%.

But wait, we will be needing more specific numbers if we want to use this table in the future.
When the attacker throws something specific, the chance of winning changes as well, we need to keep track of that.
Die, chance/36
1 0
2 1
3 2
4 3
5 4
6 5
And if the attacker has more die than the defender, each comparison needs to be taken in account. Then the thrown die equals the chance/36. So a 6 is 6 out of 36 that the attacker wins.

For a 2 attacker versus 1 defender. The complexity grows exponential. I need to check all combinations that the attacker has. Lining them up. Then compare them with the 6 possible outcomes of the defender.

36 possibilities, results in 21 possibilities with doubles:
High, Low, chance/36
1 1 1
2 1 2
2 2 1
3 1 2
3 2 2
3 3 1
4 1 2
4 2 2
4 3 2
4 4 1
5 1 2
5 2 2
5 3 2
5 4 2
5 5 1
6 1 2
6 2 2
6 3 2
6 4 2
6 5 2
6 6 1

As specific rule for this 2 versus 1. We have that if there is a tie, the attacker wins by default. Since the defender has only 1 die. This specific rule will change with certain combinations of the number of dice pitted out.

It just so happens:
High, chance/36
1 1
2 3
3 5
4 7
5 9
6 11

And those 6 can be compared in the table that I created at the start. In fact, the chance of getting a certain high is multiplied by the chance of winning with a specific throw. And after that, all is added up.
1 has 1 x 1 = 1
2 has 3 x 2 = 6
3 has 5 x 3 = 15
4 has 7 x 4 = 28
5 has 9 x 5 = 45
6 has 11 x 6 = 66
A total of 161
The total number of dice is 3, thus 6x6x6 = 216.
The winning chance is divided by 216.

The win/loss is 74,5%/25,5%.

Since there is only 1 die that is compared. If the defender has 2 and the attacker has 1 die. Then the calculated situation will revert. Instead of 161, we only have 55.

The win/loss is 25,5%/74,5%.

And there you have it, 1v1, 2v1 and 1v2.

If I continue expanding the number of dice (2 versus 2). I need to add two more steps in the calculating. And that is calculating the chance of a tie with each comparison (it differs with each number of dice). And the chance of having a certain second number/third number etc. Maybe there is logic in that last one as well.

X3M
X3M's picture
Offline
Joined: 10/28/2013
@FWyver

Nope. Entirely wrong.

Sorry.

If there is one thing that I learned these past years:
Never simplify a system when calculating chances.
If you are dealing with combinations and permutations, outcomes might be the opposite.

There are people saying that the chance of throwing a 6 with 6 dice is 100%. I am sure you know this is wrong as well.

FWyver
Offline
Joined: 06/14/2014
In all fairness, I didn't

In all fairness, I didn't claim it was right, just a roughly representative working estimate.. But you may be right, it's likely I'm still too far off to be useful ;). I think this one may be beyond me (at least in terms of the time I can devote to thinking about it...)

let-off studios
let-off studios's picture
Offline
Joined: 02/07/2011
One-Set Probability

I have a hunch that treating each player's dice pool separately is causing the massive complexity here. Isn't there some way to calculate the outcome of the dice as if they were all a single set or dice pool?

What I mean is: take ALL the dice used in the battle, and calculate the probabilities in that. From that probability, determine the chance that one player would win over the other.

For example, Player 1 has 3 dice, and Player 2 has 2 dice. Make calculations based on a set of 5 dice, and see how they shake out: two 6's, three 6's, etc.

I'm sure there's a way to develop a formula once you combine all the dice together. If there's no difference between the dice (as in, they all have the numbers 1 through 6 on them), then the calculations may be helpful.

EDIT: and this mechanic sounds a lot like RISK to me, only with no limit on dice pools.

X3M
X3M's picture
Offline
Joined: 10/28/2013
Doing correctly takes time

Not to be saying that this is easy either. I checked this one on how to calculate. (That was actually fun)
Not doing the calculations themselves (Only up to 2v1/1v2, and dice pools results up to 3)

Unfortiately making just 1 huge dice pool was not one of them. And it is the same story again as said before with the combinations/permutations. There is another problem here, and that problem is the sorting. And it is this sorting that stops calculating a big picture. You compare 2 situations, 2 sorted lines of dice. And each die in the line has its own situation.

For example (as I can recall), with 3 dice, having the first die being a 6 is 91/216. The second die being 6 was only 16/216 and the third die being 6 is of course only 1/216. For the 5 I had 61, 40 and 7 out of 216. And all these numbers are very important.

There is a way, but it takes time. I do manage to cut it into smaller problems. While I don't have the file here on my work but at home. I can say that I could do the multiplications up to 3 vs 3 now. And no one is going to be happy about that. Since it also indicates that having the 4 vs 4, will take exactly 6 times longer. Since creating the 3 dice propabilities, and sorting them out, took about 1 hour. You can guess that having 4 dice will take 6 hours.

So, while I know exactly what to do, to get the job done. I don't have the right tool for it. Excel does not support horizontal sorting, only vertical :(
If it did, I could have had all sorted propabilities up to the 10 dice already. And the next step would simply be multiplying the propabilites. (yes, that is simply) Then sum them up. And it would be done.

N_Andersen
Offline
Joined: 01/07/2013
I thought I had a solution

I thought I had a solution until I re-read "Player One rolls five 1s and one 2. Player Two rolls a 6. Player Two wins the battle." I will start with a very simplified version of the problem, and I will use letters to identify the players to make this readable (I hope)-

So given two rolls of d6, by player A and player B. The result set size is 36. The number of events where player A rolls higher than player B is 15. The number of ties is 6. The number of events where player B is higher than player A is 15.

So now let's say that player A still rolls d6 and player B rolls 2 d6. The result set size of three rolls is now 216, even though the rules essentially say Player B ignores the lower die. The number of events where player A rolls higher than player B is 55. The number of events where player A's roll ties the higher of player B's rolls is 36. The number of events where one of player B's rolls is higher than player A's roll is 125.

So giving player B 2d6 and player A 1d6 increased player B's chance of winning from 15/36 to 125/216, or from 41.67% to 57.87%. The odds of player A winning dropped from 41.67% to 25.46%.

(The way I arrived at these numbers was to map out the result sets in Excel. I usually do something visual to map out the problem until I can put my finger on the formula that is at work. But I am having a problem figuring out that formula. It would be possible to continue mapping this problem out in Excel, but it would take a lot of work!)

EDIT: It sounds like X3M is a little bit ahead of me in terms of the Excel work. I started working out the 2 dice vs. 3 dice probabilities results but realized I had missed some things, and after an hour & a half I don't want to start over. I was only through about 1/3 of the results.

Zag24
Offline
Joined: 03/02/2014
Too hard to compute

This is too hard to compute, so I wrote a program to simulate.

Offense: 1 Defense: 1 Offense Wins 41%
Offense: 1 Defense: 2 Offense Wins 25%
Offense: 1 Defense: 3 Offense Wins 17%
Offense: 1 Defense: 4 Offense Wins 12%
Offense: 1 Defense: 5 Offense Wins 9%
Offense: 1 Defense: 6 Offense Wins 7%
Offense: 1 Defense: 7 Offense Wins 5%
Offense: 1 Defense: 8 Offense Wins 4%
Offense: 1 Defense: 9 Offense Wins 3%
Offense: 2 Defense: 1 Offense Wins 74%
Offense: 2 Defense: 2 Offense Wins 47%
Offense: 2 Defense: 3 Offense Wins 34%
Offense: 2 Defense: 4 Offense Wins 25%
Offense: 2 Defense: 5 Offense Wins 19%
Offense: 2 Defense: 6 Offense Wins 15%
Offense: 2 Defense: 7 Offense Wins 12%
Offense: 2 Defense: 8 Offense Wins 9%
Offense: 2 Defense: 9 Offense Wins 8%
Offense: 3 Defense: 1 Offense Wins 82%
Offense: 3 Defense: 2 Offense Wins 65%
Offense: 3 Defense: 3 Offense Wins 48%
Offense: 3 Defense: 4 Offense Wins 38%
Offense: 3 Defense: 5 Offense Wins 30%
Offense: 3 Defense: 6 Offense Wins 24%
Offense: 3 Defense: 7 Offense Wins 19%
Offense: 3 Defense: 8 Offense Wins 16%
Offense: 3 Defense: 9 Offense Wins 13%
Offense: 4 Defense: 1 Offense Wins 87%
Offense: 4 Defense: 2 Offense Wins 74%
Offense: 4 Defense: 3 Offense Wins 62%
Offense: 4 Defense: 4 Offense Wins 49%
Offense: 4 Defense: 5 Offense Wins 40%
Offense: 4 Defense: 6 Offense Wins 33%
Offense: 4 Defense: 7 Offense Wins 27%
Offense: 4 Defense: 8 Offense Wins 22%
Offense: 4 Defense: 9 Offense Wins 18%
Offense: 5 Defense: 1 Offense Wins 90%
Offense: 5 Defense: 2 Offense Wins 80%
Offense: 5 Defense: 3 Offense Wins 69%
Offense: 5 Defense: 4 Offense Wins 59%
Offense: 5 Defense: 5 Offense Wins 49%
Offense: 5 Defense: 6 Offense Wins 41%
Offense: 5 Defense: 7 Offense Wins 35%
Offense: 5 Defense: 8 Offense Wins 29%
Offense: 5 Defense: 9 Offense Wins 25%
Offense: 6 Defense: 1 Offense Wins 92%
Offense: 6 Defense: 2 Offense Wins 84%
Offense: 6 Defense: 3 Offense Wins 75%
Offense: 6 Defense: 4 Offense Wins 66%
Offense: 6 Defense: 5 Offense Wins 58%
Offense: 6 Defense: 6 Offense Wins 49%
Offense: 6 Defense: 7 Offense Wins 42%
Offense: 6 Defense: 8 Offense Wins 36%
Offense: 6 Defense: 9 Offense Wins 31%
Offense: 7 Defense: 1 Offense Wins 94%
Offense: 7 Defense: 2 Offense Wins 87%
Offense: 7 Defense: 3 Offense Wins 80%
Offense: 7 Defense: 4 Offense Wins 72%
Offense: 7 Defense: 5 Offense Wins 64%
Offense: 7 Defense: 6 Offense Wins 57%
Offense: 7 Defense: 7 Offense Wins 49%
Offense: 7 Defense: 8 Offense Wins 43%
Offense: 7 Defense: 9 Offense Wins 37%
Offense: 8 Defense: 1 Offense Wins 95%
Offense: 8 Defense: 2 Offense Wins 89%
Offense: 8 Defense: 3 Offense Wins 83%
Offense: 8 Defense: 4 Offense Wins 77%
Offense: 8 Defense: 5 Offense Wins 70%
Offense: 8 Defense: 6 Offense Wins 63%
Offense: 8 Defense: 7 Offense Wins 56%
Offense: 8 Defense: 8 Offense Wins 49%
Offense: 8 Defense: 9 Offense Wins 43%
Offense: 9 Defense: 1 Offense Wins 96%
Offense: 9 Defense: 2 Offense Wins 91%
Offense: 9 Defense: 3 Offense Wins 86%
Offense: 9 Defense: 4 Offense Wins 81%
Offense: 9 Defense: 5 Offense Wins 75%
Offense: 9 Defense: 6 Offense Wins 68%
Offense: 9 Defense: 7 Offense Wins 62%
Offense: 9 Defense: 8 Offense Wins 56%
Offense: 9 Defense: 9 Offense Wins 49%

Here's the code, which I haven't figured out how to make formatted correctly.

~~~~~~~~~~~~~~~~~~~~~
package net.zag;

import java.util.Arrays;
import java.util.Random;

public class DiceSim {

private static final int TRIALS = 1000000;
static Random rnd = new Random(System.currentTimeMillis());

static double calc(int offCount, int defCount) {
int offenseWinCount = 0;
for (int trial = 0; trial < TRIALS; trial++) {
if (offenseWins(offCount, defCount)) {
offenseWinCount++;
}
}

return ((double) offenseWinCount) / (double) TRIALS;
}

static boolean offenseWins(int offCount, int defCount) {
int[] offArray = getRolls(offCount);
int[] defArray = getRolls(defCount);

int shorter = offCount > defCount ? defCount : offCount;
for (int i = 0; i < shorter; i++) {
// Because Arrays.sort returns in ascending order, lower roll wins.
if (offArray[i] < defArray[i]) {
return true;
} else if (defArray[i] < offArray[i]) {
return false;
}
}
return offCount > defCount;
}

private static int[] getRolls(int count) {
int[] result = new int[count];
for (int i = 0; i < count; i++) {
result[i] = rnd.nextInt(6);
}
Arrays.sort(result);
return result;
}

public static void main(String[] args) {
for (int offCount = 1; offCount < 10; offCount++) {
for (int defCount = 1; defCount < 10; defCount++) {
double result = calc(offCount, defCount);
int resultPercent = (int) (result * 100);
System.out.println("Offense: " + offCount + " Defense: "
+ defCount + " Offense Wins " + resultPercent + "%");
}
}
}
}

~~~~~~~~~~~~~~~~~~~~~

X3M
X3M's picture
Offline
Joined: 10/28/2013
You're the man!

By checking those lines, I know the simulation goes correctly. And your low dice pool results are equal to my calculations. I have to say, AWESOME job.

Normally I don't like simulators. But that is only when facing a low number of simulations (like play testing). 1 million is more then enough to cover the 1% difference that might occur.

I guess I have to ask you when I need to calculate something :D.

Toa Lewa
Toa Lewa's picture
Offline
Joined: 10/31/2013
Thanks!

Thanks guys! I didn't realize it would be as complicated as it turned out to be when I first posted this question. I was in the process of writing my own simulation, but Zag beat me to it. Anyway, it will be nice to see if my program comes up with the same percentages.

seo
seo's picture
Offline
Joined: 07/21/2008
I took a different

I took a different approach.

To start with, there are two sets of cases:
A) Defender has as much or more dice as the attacker (which means a tie in the last tie is enogh for defender to win)
B) Attacker has more dice (which means a tie is NOT enough for the defender on the last die. In other words, roles are reversed in favor of the attacker).

So, for one die (or the last die after one or more ties), it is pretty easy to calculate the chances of winning for whoever has the upper hand (i.e. The defender in most cases, the attacker when he has more dice).

Rolls a 6 ==> wins 6 out of 6 possible rolls by the other player
Rolls a 5 ==> wins 5 / 6 (opponent only wins if he rolls a 6)
Rolls a 4 ==> wins 4 / 6 (opponent needs a 5 or a 6)
Rolls a 3 ==> wins 3 / 6
Rolls a 2 ==> wins 2 / 6
Rolls a 1 ==> wins 1 / 6

Add all those up and you get: defender or attacker with more dice wins 21 out of 36 times (58.33%) and loses 15/36 (41.67%).

For the previous dice, you need to consider the posibility of a tie, which results in equal chances of winning for both players. Lets do the roll by roll analysis:

Rolls a 6 ==> wins 5 out of 6 times (if opponent rolls a 6 it's a tie and we proced to the next die)
Rolls a 5 ==> wins 4 / 6
Rolls a 4 ==> wins 3 / 6
Rolls a 3 ==> wins 2 / 6
Rolls a 2 ==> wins 1 / 6
Rolls a 1 ==> cannot win (best hope is a tie)

Now we have a total of 15/36 (41.67%) chances of winning, 6/36 (16.67%) chances of a tie, and 15/36 (41.67%) chances of losing. Which is similar to 50/50 chance of winning/losing, but not quite.

To recap, for all but the last die, chances are even for boh players, which means the it makes no difference if both roll 1 or 5 dice BEFORE the last one, but on the last pair, one of the players has the upper hand with 58.33% chances of winning.

Now, while I wrote that in a way that might suggest succesive rolls, it only means succesive evaluation of dice rolled at the same time.

But it is an uncomplete picture, focusing only on the evaluation, which means the number of extra dice one player might have was not taken into account in terms of the increased chance to get a better set of results (because only the best n dice wiuld be considered).

I will end his post here, though, and maybe post those calculations later. In any case, those would only increase the advantage for the player with more dice stated here.

SugarPillStudios
SugarPillStudios's picture
Offline
Joined: 03/25/2013
Great Problem!

Thanks for sharing this fun problem! Here's how I'd suggest thinking through it. And I have run a simulation to verify these results, but would appreciate any 3rd party confirmation.

Start by thinking about the chances of rolling each possible value 1-6 as your highest die given different numbers of starting dice. For one die this is easy, each die value has the same chance of being your highest roll: 1/6 = 16.6% chance each.

If you start writing out the possibilities when rolling 2, 3, and 4 d6s, you are likely to notice a pattern develop. Specifically, your chance of rolling a high value of X across N dice is: (X^N - (X-1)^N)/6^N. The way to understand this formula is that X^N is the number of ways you can have N dice contain values that are less than or equal to X. But we need to ensure that we have at least one value of X. So we subtract all of the arrangements of dice that do not include an X, and there are (X-1)^N of those. The final piece of this formula is simply dividing by the number of possible ways of rolling N dice which is 6^N.

You can use this formula to build a table with your chance of rolling a high value of 1-6 for as many different numbers of dice as you'd like. From this table you can derive another slightly different table with your chances of rolling a high die that is less than every possible die face with different numbers of dice. For instance, your chance of rolling a high die that is less than 5 on 3D6 can be found by summing the the chances of rolling high die values of 1, 2, 3, and 4 on 3D6.

If you're still with me, we now have two tables. One essentially lets us look up our chance of rolling each value with any number of dice. And the other essentially lets us look up our chances of losing (or rolling a high die smaller than each value) with any number of dice. We can combine these two table into a single table that gives us our chances of strictly winning with our highest die (no ties) between any two competing numbers of dice. For each possible value 1-6, we multiply the our chance of rolling that value with the chances that our opponent will roll less than that number. Then we add up all six of those products to find our chance of strictly beating an opponent (without ties). Here's what the table looks like in my spreadsheet:

W\L 1D6-- 2D6-- 3D6-- 4D6-- 5D6-- 6D6--
1D6 0.417 0.255 0.174 0.126 0.095 0.073
2D6 0.579 0.390 0.281 0.211 0.162 0.128
3D6 0.660 0.472 0.352 0.271 0.212 0.169
4D6 0.707 0.526 0.403 0.315 0.250 0.201
5D6 0.738 0.564 0.440 0.348 0.279 0.226
6D6 0.760 0.591 0.468 0.374 0.302 0.246

From this table we can look up our chances of strictly beating or losing to another number of dice without any ties. However we can find our chance of ties by subtracting our chances of winning and losing from 1. For instance our chances to tie when rolling 4D6 against an opponents 2D6 is 1 - 0.526 - 0.211 = 0.263. And if we want to find our chances of winning with ties we can add our chances of winning without ties to our chances of winning with ties: 0.526 + 0.263 * (chance of win when high dice are tied). Our chances of winning when the high dice are tied, are basically the odds of winning with 3D6 against 1D6 (subtract one tied die from each side), which we can also look up in the table. Also notice that a tie here will result in the player with more dice winning, since the other player runs out of dice after their second die ties. According to the table, 3D6 beats 1D6 with a chance of 0.660, loses to it 0.174, and therefore ties 1-0.660-0.174=0.166. So we can plug these chances of winning after the tie into our previous formula above to get our final answer for 4D6 beating 2D6: 0.526 + 0.263 * (0.660 + 0.166) = 0.743.

I'm sure that this tie breaking calculation could be worked into a new table of its own, but I don't currently see a non-tedious way of building this into my current spreadsheet. And the strictly beating with your highest die table that I posted above seems more generally useful, so I'll stop here for now. I hope you find this interesting and understandable, and would love to hear if it raises any questions. My enjoyment of solving and attempting to explain this kind of problem has lead me to start a blog on BGG, for anyone interested in reading more: http://boardgamegeek.com/blog/2948/probability-in-games

X3M
X3M's picture
Offline
Joined: 10/28/2013
@Zag24 Although I don't

@Zag24

Although I don't understand programming. I do know that you have done it right by looking at the numbers. However. How come the almost tie result is stil 49%, even with 9 versus 9 dice? A flaw in rounding? It should return 50% for certain by then.

The very first 1 vs 1 should return 42% instead of 41%. After all, you have done 1 milion simulations. I think you need to check the rounding of numbers.
The second, 2 v 2 should return 48%.
The third one is 50% after rounding.

Zag24
Offline
Joined: 03/02/2014
Always rounding down.

X3M wrote:
@Zag24

Although I don't understand programming. I do know that you have done it right by looking at the numbers. However. How come the almost tie result is stil 49%, even with 9 versus 9 dice? A flaw in rounding? It should return 50% for certain by then.


Now that you mention it, I realize I made a mistake. The conversion of double to int does not round off, it performs a floor operation. So even if the actual result was 49.999%, in my table is would show as 49%.

Here's the corrected table.

Offense: 1 Defense: 1 Offense Wins 42%
Offense: 1 Defense: 2 Offense Wins 25%
Offense: 1 Defense: 3 Offense Wins 17%
Offense: 1 Defense: 4 Offense Wins 13%
Offense: 1 Defense: 5 Offense Wins 9%
Offense: 1 Defense: 6 Offense Wins 7%
Offense: 1 Defense: 7 Offense Wins 6%
Offense: 1 Defense: 8 Offense Wins 5%
Offense: 1 Defense: 9 Offense Wins 4%
Offense: 2 Defense: 1 Offense Wins 75%
Offense: 2 Defense: 2 Offense Wins 47%
Offense: 2 Defense: 3 Offense Wins 34%
Offense: 2 Defense: 4 Offense Wins 26%
Offense: 2 Defense: 5 Offense Wins 20%
Offense: 2 Defense: 6 Offense Wins 15%
Offense: 2 Defense: 7 Offense Wins 12%
Offense: 2 Defense: 8 Offense Wins 10%
Offense: 2 Defense: 9 Offense Wins 8%
Offense: 3 Defense: 1 Offense Wins 83%
Offense: 3 Defense: 2 Offense Wins 66%
Offense: 3 Defense: 3 Offense Wins 49%
Offense: 3 Defense: 4 Offense Wins 38%
Offense: 3 Defense: 5 Offense Wins 30%
Offense: 3 Defense: 6 Offense Wins 24%
Offense: 3 Defense: 7 Offense Wins 20%
Offense: 3 Defense: 8 Offense Wins 16%
Offense: 3 Defense: 9 Offense Wins 13%
Offense: 4 Defense: 1 Offense Wins 87%
Offense: 4 Defense: 2 Offense Wins 74%
Offense: 4 Defense: 3 Offense Wins 62%
Offense: 4 Defense: 4 Offense Wins 49%
Offense: 4 Defense: 5 Offense Wins 40%
Offense: 4 Defense: 6 Offense Wins 33%
Offense: 4 Defense: 7 Offense Wins 27%
Offense: 4 Defense: 8 Offense Wins 23%
Offense: 4 Defense: 9 Offense Wins 19%
Offense: 5 Defense: 1 Offense Wins 91%
Offense: 5 Defense: 2 Offense Wins 80%
Offense: 5 Defense: 3 Offense Wins 70%
Offense: 5 Defense: 4 Offense Wins 60%
Offense: 5 Defense: 5 Offense Wins 50%
Offense: 5 Defense: 6 Offense Wins 42%
Offense: 5 Defense: 7 Offense Wins 35%
Offense: 5 Defense: 8 Offense Wins 29%
Offense: 5 Defense: 9 Offense Wins 25%
Offense: 6 Defense: 1 Offense Wins 93%
Offense: 6 Defense: 2 Offense Wins 84%
Offense: 6 Defense: 3 Offense Wins 76%
Offense: 6 Defense: 4 Offense Wins 67%
Offense: 6 Defense: 5 Offense Wins 58%
Offense: 6 Defense: 6 Offense Wins 50%
Offense: 6 Defense: 7 Offense Wins 43%
Offense: 6 Defense: 8 Offense Wins 37%
Offense: 6 Defense: 9 Offense Wins 31%
Offense: 7 Defense: 1 Offense Wins 94%
Offense: 7 Defense: 2 Offense Wins 88%
Offense: 7 Defense: 3 Offense Wins 80%
Offense: 7 Defense: 4 Offense Wins 73%
Offense: 7 Defense: 5 Offense Wins 65%
Offense: 7 Defense: 6 Offense Wins 57%
Offense: 7 Defense: 7 Offense Wins 50%
Offense: 7 Defense: 8 Offense Wins 43%
Offense: 7 Defense: 9 Offense Wins 38%
Offense: 8 Defense: 1 Offense Wins 95%
Offense: 8 Defense: 2 Offense Wins 90%
Offense: 8 Defense: 3 Offense Wins 84%
Offense: 8 Defense: 4 Offense Wins 77%
Offense: 8 Defense: 5 Offense Wins 70%
Offense: 8 Defense: 6 Offense Wins 63%
Offense: 8 Defense: 7 Offense Wins 57%
Offense: 8 Defense: 8 Offense Wins 50%
Offense: 8 Defense: 9 Offense Wins 44%
Offense: 9 Defense: 1 Offense Wins 96%
Offense: 9 Defense: 2 Offense Wins 92%
Offense: 9 Defense: 3 Offense Wins 87%
Offense: 9 Defense: 4 Offense Wins 81%
Offense: 9 Defense: 5 Offense Wins 75%
Offense: 9 Defense: 6 Offense Wins 69%
Offense: 9 Defense: 7 Offense Wins 62%
Offense: 9 Defense: 8 Offense Wins 56%
Offense: 9 Defense: 9 Offense Wins 50%

FWyver
Offline
Joined: 06/14/2014
I'm just glad to see that my

I'm just glad to see that my estimated results we're only off by at most ~10% for any given set, and that they match the trends in the data (in fact what seems to happen is that the actual data gets stretched out towards its extremes). So, if you happen to be out and about and away from your computer it wouldn't be an unreasonable way to estimate rough probabilities. Nice to know I'm not going totally mad..

X3M
X3M's picture
Offline
Joined: 10/28/2013
With exactly the same amount

With exactly the same amount of dice for the attacker and the defender. Each die comparison has a "41,7-41,7%" chance. And if it is a tie, it goes to the next die comparison. However, the last one has that offset to 41,7% as a win ratio, just like the 1 vs 1.

The chance that there is a tie is 16,7%. Actually 1/6th to be precise. So with this knowledge I can calculate the arms race results.

1 vs 1, 41,6667%; becomes 42%, you have 42
2 vs 2, 48,6111%; becomes 49%, you have 47
3 vs 3, 49,7685%; becomes 50%, you have 49
4 vs 4, 49,9614%; becomes 50%, you have 49
5 vs 5, 49,9936%; becomes 50%, you have 50

Or I am doing something wrong. Especially with 2 vs 2 dice.
Or you have some more rounding problems to fix.

SugarPillStudios
SugarPillStudios's picture
Offline
Joined: 03/25/2013
My Numbers Agree with Zag24's Simulation (Almost)

Alright, In order to check my numbers against Zag24's simulation I had to incorporate ties into the table in my previous post. Here's the table that I walked through calculating in that post (now with percentages instead of decimals):

W\L -1D6- -2D6- -3D6- -4D6- -5D6- -6D6-
1D6 41.7% 25.5% 17.4% 12.6% 09.5% 07.3%
2D6 57.9% 39.0% 28.1% 21.1% 16.2% 12.8%
3D6 66.0% 47.2% 35.2% 27.1% 21.2% 16.9%
4D6 70.7% 52.6% 40.3% 31.5% 25.0% 20.1%
5D6 73.8% 56.4% 44.0% 34.8% 27.9% 22.6%
6D6 76.0% 59.1% 46.8% 37.4% 30.2% 24.6%

From here, I created a table with the chance of a tie between any two numbers of dice. This is done by calculating for each cell: 1 - (Chance to Win) - (Chance to Lose). The chance to win is found in the previous table by going down to the row indicating the number of dice you are rolling, and then looking over to the column with the number of dice that your opponent is rolling. The chance to lose is found by switching those two axes: looking over for your dice count, and then down to find your opponent's. Here's what the tie table looks like:

TIES -1D6- -2D6- -3D6- -4D6- -5D6- -6D6-
1D6 16.7% 16.7% 16.7% 16.7% 16.7% 16.7%
2D6 16.7% 22.1% 24.8% 26.4% 27.4% 28.1%
3D6 16.7% 24.8% 29.5% 32.6% 34.8% 36.4%
4D6 16.7% 26.4% 32.6% 37.0% 40.2% 42.5%
5D6 16.7% 27.4% 34.8% 40.2% 44.2% 47.2%
6D6 16.7% 28.1% 36.4% 42.5% 47.2% 50.9%

And now we can build the final table for win with the consideration for ties. The formula at each cell in this table is: (Chance to Win) + (Chance to Tie) * (Chance to Win With One Less Die for Each Player). The chance to win and tie are simply pulled from the two previous tables. The chance to win with one less die for each player is generally the value above and to the left of the current cell in the same table. The two exceptions to this are in the top row and left column, since these cells do not have an upper left neighbor. In the left column, we have more dice than our opponent, so ties result in a win 100% of the time. In the top row, our opponents have more dice than us, so ties never result in a win (0% of the time). The resulting table looks like this:

W\L -1D6- -2D6- -3D6- -4D6- -5D6- -6D6-
1D6 41.7% 25.5% 17.4% 12.6% 09.5% 07.3%
2D6 74.5% 48.2% 34.4% 25.6% 19.7% 15.4%
3D6 82.6% 65.6% 49.5% 38.3% 30.1% 24.0%
4D6 87.4% 74.4% 61.7% 49.8% 40.4% 32.9%
5D6 90.5% 80.3% 69.9% 59.6% 49.9% 41.6%
6D6 92.7% 84.6% 76.0% 67.1% 58.4% 50.0%

These numbers appear to match up with the Zag24's simulation in all cases except one. The 2D6v2D6 case is about 1% more here than in Zag24's simulation. X3M pointed out the same concern about this figure above.

So I dug into my simulation a bit deeper. I confirmed that the simulation matched my predictions for number of outright wins without ties (39%), and was even encountering the expected number of ties (22%). However the simulation was winning those ties about one percent less often than expected (8% instead of the expected 22% * 41% = 9%). Again, I know that the 22% matches up... so I began to wonder about why the 41% might not be correct when breaking ties between two single D6s, even though it was correct (by math and simulation) for rolling 1D6 v 1D6.

I believe that I have figured out the difference between these two situations: rolling 1D6v1D6, as opposed to rolling 2D6v2D6 and knowing that the largest dice are tied. These two scenarios will only produce the same outcome when the tied dice in the 2D6v2D6 scenario are sixes, and this only happens in 1/6 of ties. The rest of the time the range of possible values for the second largest dice will be smaller which will force more ties. Since these extra ties result in the attacker losing, our expected chances of winning turn out to be a bit high. In fact without rounding, it's less than 1% too high.

Adjusting the tables above to account for these extra ties currently seems a bit overwhelming to me. It seems like you'd want different win/lose and tie tables that represent having different ranges of values available to consider. Then you'd want to take a weighted average of the values in those tables, with weights correspond to the chance that your previous high die comparison shrunk the available range of dice left for later comparisons. Although maybe there is an easier way to work this consideration in somewhere else.

None the less, very interesting problem to work through. Thanks again for sharing and discussing it guys!

X3M
X3M's picture
Offline
Joined: 10/28/2013
@SugarPillStudios

@SugarPillStudios.

Your numbers are still different then mine. What am I doing wrong?

Edit:
Did not think about having extra ties for the second and more dice.
I estimated 2 vs 2. I did not yet calculate it exactly in excel. Will commence shortly.

Edit 2:
Silly me, I already had this knowledge. Yet I forgot.
The chance on having a certain number with 2 dice:

Outcome first second
1 1 11
2 3 9
3 5 7
4 7 5
5 9 3
6 11 1

It is obvious that not only the second die has a higher chance on a tie. The first one as well. So the system with more dice tend to go to a tie much much faster than any one anticipated.

First die
win 505/1296=38,966%
Tie 286/1296=22,0679%, go to second die
Los 505/1296=38,966%

Second die
win 505/1296=38,966%
Los 791/1296=61,034%

The 2 combined
win1 505/1296=38,966%
win2 144430/1679616=8,599%
los1 505/1296=38,966%
los2 226226/1679616=13,469%

win 47,565%, which is not 48,611% as I said before.
Los 52,435%

Nor is it the 47% of Zag24.
Nor is it the 48,2% in your latest table.
Los 505/1296=38,966%

You guys, someone has to do this right. Or I loose my mind. :D

X3M
X3M's picture
Offline
Joined: 10/28/2013
Here is the table for using 3

Here is the table for using 3 Dice:
Outcome first second third
1 1 16 91
2 7 40 61
3 19 52 37
4 37 52 19
5 61 40 7
6 91 16 1

SugarPillStudios
SugarPillStudios's picture
Offline
Joined: 03/25/2013
X3M

X3M wrote:
@SugarPillStudios.
Your numbers are still different then mine. What am I doing wrong?

First die
win 505/1296=38,966%
Tie 286/1296=22,0679%, go to second die
Los 505/1296=38,966%

Second die
win 505/1296=38,966%
Los 791/1296=61,034%

The 2 combined
win1 505/1296=38,966%
win2 144430/1679616=8,599%
los1 505/1296=38,966%
los2 226226/1679616=13,469%

win 47,565%

I must admit that I was not able to follow your tables labeled: outcome, first, second, etc. or how you calculated those numbers. Having said that, it does look like your final calculations were very similar to mine... which produced close but still incorrect results. The difference between your results and mine appear to be the second die win percentage. You used 38.966% and I used 41.666%, but I now believe that both of these values are incorrect. One way to think about the incorrectness of these values is to think about the difference between having the two highest dice tied at a value of six versus tied at a value of one. Tied sixes give the attacker the best possible chance of winning, versus tied ones give the attacker no chance of winning. On top of this: when a tie occurs, you are much more likely to tie with sixes than with ones.

To account for this, we'll start with your first die win probability of 38.966%, but we'll break the term for a single tie (22.0179*38.966) into 6 different terms for the six different values of ties that might occur: each term will include a (Chance of Tie Occurring) * (Chance of Winning).

If you followed the logic in my original post above, I proposed a formula for calculating the odds of rolling a high value of X when rolling N dice: (X^N - (X-1)^N) / 6^N. We can square this formula to get the chances of both players rolling a high X with N = 2. This gives us the following chances to tie with each possible high value.

Chance of Tie for each High Die Value
6: 9.336%
5: 6.250%
4: 3.780%
3: 1.929%
2: 0.694%
1: 0.077%

Next we can work on our chance of winning with each of these high die values. As I did in my first post above, I'll work through this by first calculating the chances that our second die ends up rolling each possible value. Then I'll work out the chance that each of these rolls beats our opponents' possible rolls. Then we can aggregate these values into a single chance of winning for each possible high die value.

Be careful about re-using these calculations from before, as they will be slightly different here. For instance, if we know that our high die is tied at six, it is less likely that our second die is also a six (9.090%) than any other value (18.181%). Here's the table of our chances at rolling each second die value for every possible value of higher tied dice.

L\H 6-HIGH 5-HIGH 4-HIGH 3-HIGH 2-HIGH 1-HIGH
:1: 18.18% 22.22% 28.57% 40.00% 66.66% 100.0%
:2: 18.18% 22.22% 28.57% 40.00% 33.33%
:3: 18.18% 22.22% 28.57% 20.00%
:4: 18.18% 22.22% 14.28%
:5: 18.18% 11.11%
:6: 09.09%

Just like I did in my first post above, I'll use this table to create a new table that tells us the chances of our opponent rolling less than each of these values. For instance, the chance of rolling less than six is the sum of the chances of rolling a five + rolling a four + rolling a three ... from the previous table.

W\L 6-HIGH 5-HIGH 4-HIGH 3-HIGH 2-HIGH 1-HIGH
:1: ----0% ----0% ----0% ----0% ----0% ----0%
:2: 18.18% 22.22% 28.57% 40.00% 66.66%
:3: 36.36% 44.44% 57.14% 80.00%
:4: 54.54% 66.66% 85.71%
:5: 72.72% 88.88%
:6: 90.90%

Now we can finally calculate the chance of winning with each possible high tied value. We do this by multiplying the two tables above, and then adding up each column of products.

W\L 6-HIGH 5-HIGH 4-HIGH 3-HIGH 2-HIGH 1-HIGH
::: 41.32% 39.50% 36.73% 32.00% 22.22% ----0%

And these are the last numbers that we needed to fill in our formula from above: 38.966% + Σ(6->1) (Chance of Tie Occurring) * (Chance of Win). And here's that equation filled with the numbers from above:

38.966% + (9.33% * 41.32%) + (6.25% * 39.50%) + (3.78% * 36.73%) + (1.92% * 32%) + (0.69% * 22.22%) + (0.07% * 0) = 47.45%

This 47.45% appears to match what I've found in simulation and does not appear to conflict with zag24's simulation data, so I suspect that it is correct. It would certainly be nice to find an easier way of accounting for these different scenarios of ties. Although I suspect that our previous numbers (without considering ties) should be more than sufficient for working in the context of the game described. I know there's a lot here, but hope you find in helpful. Best, Gary.

X3M
X3M's picture
Offline
Joined: 10/28/2013
That was very helpful.

That was very helpful. Thank you.

I already suspected that the chance would revert for the second die. But I now see the mistake that I have made.
When rolling a 5 or lower, I still calculated the chance for a 6 for the second die. Which makes absolutely no sense at all.

I need to figure it out again with my method (will not even try). And the worst part of this is that there is not a simple revert. But an altered one. When using 3 dice, you will be getting more and more possibilities in the way you described.

While 2 vs 2 is this hard already. 3 vs 2 or more will "practically" impossible. Since with 3 dice, you have 36 tie probability for the second die. And each of them has 6 more for the third die. Thus 216 situations to calculate.

Practically speaking, you might as well write out each possibility. With 6^dice. 3 vs 3 means 46656 situations to consider. But also that many calculations to be made without simplifying the process at all.

Toa Lewa
Toa Lewa's picture
Offline
Joined: 10/31/2013
Another program

Well, it looks like I'm a little late to the party, but better late than never. I can verify the accuracy of Zag's percentages. I wrote a program similar to Zag's program, and I ended up getting the same percentages (+ 1 or - 1 percentage after rounding). I took a slightly different approach. I utilized recursion rather than iteration (I needed some practice in that area).

Thanks again for the help on this. I am glad that this topic generated some lively discussion. Now I am working on a graph to better visualize the data.

Malle
Offline
Joined: 07/15/2014
Toa Lewa wrote:Well, it looks

Toa Lewa wrote:
Well, it looks like I'm a little late to the party, but better late than never. I can verify the accuracy of Zag's percentages. I wrote a program similar to Zag's program, and I ended up getting the same percentages (+ 1 or - 1 percentage after rounding). I took a slightly different approach. I utilized recursion rather than iteration (I needed some practice in that area).

Thanks again for the help on this. I am glad that this topic generated some lively discussion. Now I am working on a graph to better visualize the data.


I'm even later than you, but as there's only been simulation results provided in this thread, I thought I could provide some exhaustive results instead.

I wrote a Matlab script to compute the win chance for the attacker, using all possible permutations of dice rolls with 1 to 7 dice (currently computing for 1-9 dice but it is not an efficient program so it should take somewhere under an hour, if my estimation are correct). The code can be found at pastebin (two supplementary functions, genalldice and winLewaRoll, can be uploaded if anyone wants them). The result is this (borrowing the formatting from SugarPillStudios, rounding result to 4 digits):

W\L 1D6-- 2D6-- 3D6-- 4D6-- 5D6-- 6D6-- 7D6-- 8D6-- 9D6--
1D6 .4167 .2546 .1736 .1259 .0948 .0733 .0576 .0459 .0370
2D6 .7454 .4745 .3405 .2550 .1967 .1548 .1237 .1000 .0815
3D6 .8264 .6595 .4893 .3803 .3008 .2415 .1962 .1608 .1327
4D6 .8741 .7450 .6197 .4946 .4025 .3300 .2726 .2266 .1894
5D6 .9052 .8033 .6992 .5975 .4968 .4167 .3503 .2954 .2500
6D6 .9267 .8452 .7585 .6700 .5833 .4980 .4265 .3652 .3130
7D6 .9424 .8763 .8038 .7274 .6497 .5735 .4986 .4337 .3767
8D6 .9541 .9000 .8392 .7734 .7046 .6348 .5663 .4990 .4393
9D6 .9630 .9185 .8673 .8106 .7500 .6870 .6233 .5607 .4993

The trick to making it viable to compute is to realize that all permutations of the outcome of rolling N d6 can be put into a non-strict ordering with respect to how good the rolls is. That is, if there are M possible permutations in the outcome, we can assign an index number from 1 to M to each permutation such that the roll with index i+1 will win against all rolls which the roll with index i won against, and potentially some more.

With this it is sufficient to go through the list of permutations of attacker roll outcomes and defender roll outcomes, instead of comparing every single pair of outcomes. (Start with the worst attacker roll. Compare it against the worst defender roll not yet compared to. If the attacker wins, go to the next defender roll. If the defender wins, note the number of rolls that the current attacker roll won against and go to the next attacker roll.)

EDIT: Apparently the code blocks do not conserve whitespace. Expanded using another dash in each column.

EDIT: And the computation for up to 9 dice is complete. Updated the table.

EDIT: Removed leading 0 as the table was too big for the width of the forum.

Syndicate content


forum | by Dr. Radut