Dice rolling: When rolling n>3 die, probability for getting any combination from a fixed set of random 3-element-combinations.

combinationscombinatoricsdicepermutationsprobability

Good afternoon,

fyi: I am currently working to balance a dice-based combat system for tabletop rpg, which heavily relies on selecting certain combinations of die from a larger pool to outbid your opponent.

Using Excel, I've worked my way through determining the number of possible combinations for rolling n 6 sided die, as well as the probability of getting a certain combination from a larger dice pool. However, I am stuck now. Simply put, I want to know the probability for getting the (say) 6 highest ranking 3d6-combinations out of a nd6 dicepool.

In particular: Say I have a given set S of several (not all) 3-element-combinations (order doesn't matter) from rolling 3 6-sided-die like

S = {{1,1,6}, {6,6,6}, {1,1,5}, {5,5,5}, {1,1,4}, {4,4,4}, {1,1,3}, {3,3,3}}

Given S, I want to count all 4-element-permutations (now from rolling 4 6-sided-die) of wich at least one element of S is a subset. So basically, I want to know how likely I am to get a combination from S when rolling 4 die. Preferably, I would like to generalize the method for any number >1 of die.

Is there a "mathmatical" way to do this without using brute force (that would be counting done by Excel)?

Best Answer

There is a mathematical way to do it. First, you need to figure out the probability of hitting any single combination, like $\{1,1,6\}$. This can be done recursively; for each possible result of the first die, you add up the probability that the remaining $n-1$ die hit the combination with one instance of the first roll removed. There are ways to speed this up by avoiding recalculating repeated cases.

Then, given a set $S$ of combinations, you need to find the probability of hitting at least one. This is can be done with the principle of inclusion/exclusion. That is, add up the probabilities of hitting each combination in $S$, then subtract the probability of hitting the combinations in each pair of $S$, add in the triplets, etc.

I made a program that does this algorithm at the link below. It works for any number of dice, and any subset $S$ of combinations to hit at least one of, and you can check it against a simulated probability. The program will be too slow if $S$ has $20$ or more combinations.

https://repl.it/@mearnest/Tabletop-game-probability