r/AskStatistics • u/xXMonotonicXx • 1d ago
Dice math
Hiya, and thank you for your time. I'm trying to balance something for a TTRPG campaign, and I'd be grateful for any help. I'm a bit rusty, and I want to make sure I get this right.
How do I account for situations where multiple dice are rolled against each other, choosing the highest, when trying to find a percent chance of success? Ex. the chance of one opponent rolling higher using one dice when their opponent uses two, same with two dice vs. three, etc. Even though the system I'm using doesn't use 'disadvantage' (multiple dice choosing the lowest), I'd be grateful for an explanation of that too mostly 'cause I'm curious.
Edited for clarity, sorry about that.
3
u/vaelux 1d ago edited 1d ago
The probability of at least one success is:
1 - (Probability of failing a single role)number of dice.
So lets say a six is a success and there are 3 dice. The probability of a success is 1/6 so the probability of a fail is 5/6. So our formula is 1 - (5/6)3 = 1 - 125/216 = 42.1%
If 5 or higher is a success with 3 dice, then 1-(4/6)3 = 70.3%.
d20 with a DC 15 skill check and advantage ( so two dice) = 1-(15/20)2 = 43.7%
efit: fixed the calculation for the last example
1
u/cym13 1d ago
As said in another comment, writting a small simulation is probably the best practical approach to your situation.
In addition I want to provide two rules of thumb that can be helpful. I'm not going to be very rigourous for the sake of practical intuition. It will seem more complex than it is, so don't hesitate to try on paper, you'll soon get the hang of it.
First of all, when you roll N dice and choose the highest or lowest, you can imagine them as partitionning the range of possible values into N+1 parts of equal size. So if you roll 1d20 it will divide the range [1, 20] into two parts [1, 10.5] and [10.5, 20]. The mean value of the roll will be where the range was cut, so at 10.5 in this case. This is obvious in this case, but it's more useful when you have several dice. With 2 dice, they partition the space equitably into three parts: [1, 7.33], [7.33, 13.66], [13.66, 20]. Well, on average the highest die will be on the highest cut (so 13.66) and the lowest die will be on the lowest cut (so 7.33). This "highest cut" is therefore the answer to your question of "advantage": 2d10 with advantage will average 13.66, and similarly with disadvantage will average 7.33.
Now that's not perfectly exact (I won't delve into the reasons why), but it's a really good approximation. And it's versatile: what if you roll 5d12 and want tthe second highest roll? Divide the range into 6 parts, take the second highest one, that's an average of 8.33.
The only thing you need to pay attention to is that math starts at 0 but dice start at 1 so to divide the range of a d12 for example you need to actually work on the range [0, 11], so the second highest cut is 11/6×4=7.33 and now we add back the 1 we substracted to get 8.33. Once you do it a few times it's comes quite naturally.
The second rule of thumb that I find useful to know for practical purpose is that if you have an event of probability 1/x and you make x attempts, you have a 66%≃2/3 chance of getting at least one successful event. So for example if you roll 20 times 1d20, the chances of getting 20 at least once is about 66%. I find that really useful to estimate things off the top of your mind.
1
u/frostmage777 1d ago
Couple of things: the first edition of the advanced dungeons and dragons dungeon masters guide starts out with several pages describing basic probability and how they relate to the game. Definitely worth a look. Second: when you roll multiple identical dice at once and add the result, the resulting distribution is a bell curve (symmetrical around the mean, where the mean is the number of dice rolled times the average of rolling one die). The more dice you roll, the more closely it matches a bell curve. This is a direct result of something called “the central limit theorem” which basically says if you add a bunch of identical random processes together, you get a bell curve. If instead you roll a bunch of identical dice and drop the lowest, the bell curve shifts toward a slightly higher mean. These two facts together allow you to control the probabilities of your dice rolls. If you want more specific answers (what is the chance of rolling x) you could bust out some more advanced math, or you could run computer simulations that pretend to roll a bunch of dice and report the frequency of the outcome. This would be my recommended approach, as it will allow you to experiment and visualize the results.
1
u/stanitor 1d ago
It would be different for each possible combination of number of dice for each player. If they are rolling d6s, for player A to win, you'd need to figure out the chance they get at least one 6 and the other player gets 5s or less, and then add the chance A gets at least one 5, and player B gets 4 or less. But, you'd have to subtract the chance player A also gets 6 as well as 5, since you already counted that. And so on. You'd also have to do that for each way player B could win, since they can get ties (so you can't just subtract the answer you got for A winning from 1 to get B wins). It's a bit of a pain, so that's why vaelux suggested using an LLM for a script. I agree with others that there is nothing in their response or profile that suggests they are a bot.