# How do I find the odds in a dice pool contest?

I'm designing a system where overall success is determined using a dice pool where you count the number of max-value faces among dice rolled and compare this number to some difficulty number. In this system, you roll d6s for attributes, and d4s for skill level.

Anydice.com helpfully can find the chances of any given number of successes (number of max-value die shown) with:

output [count 6 in Xd6] + [count 4 in Yd4]


So far, so good.

How do I find the odds that one person will beat (equal or greater number of successes) another person in a contest between two of these rolls with different X and Y values for each person?

Is this doable on anydice.com?

• Welcome to RPG.SE! Take the tour if you haven't already, and check out the help center for more guidance.
– V2Blast
May 24 '19 at 21:56
• I've found the AnyDice moderators to be incredibly helpful in finding the crunchy points of the code. May 25 '19 at 1:50

Quite easily! You could use the following program:

output ([count 6 in Ad6] + [count 4 in Bd4]) >= ([count 6 in Xd6] + [count 4 in Yd4])


That tells you the odds that first roll meets or exceeds the successes of the second - the result of the >= "at least" comparison is 1 if the left side is at least the right side and 0 if it's not, so a result of 1 means the first side wins.

You might find it helpful to define a function to represent your rolling mechanic rather than typing out the full count syntax every time. For instance, you could use:

function: roll SIX:d FOUR:d {
result: [count 6 in SIX] + [count 4 in FOUR]
}


Then you could use a simpler output statement like this, for example:

output [roll 4d6 4d4] >= [roll 3d6 5d4]

• A couple of efficiency improvements: roll SIX:d FOUR:d is faster than roll SIX:s FOUR:s if you don't need to freeze the dice pools into sequences. Also, relabeling the dice as e.g. 4d{0:5,6} 6d{0:3,4} would make the counting itself faster. And probably the fastest solution would simply be 4d(d6 = 6) + 4d(d4 = 4). May 25 '19 at 6:31
• @IlmariKaronen good points. I've gotten so used to casting dice to sequences for inspection that I do it automatically now... May 25 '19 at 7:34