# How do I calculate the chance of hits?

(I do not know if I should post this in math.stackexchange.com, so I try to phrase it in a way that it makes sense for non-roleplayers. Just in case it gets moved)

In the latest two editions of Shadowrun, you roll several 6 sided dice, and every die showing a 5 or 6 is considered a hit.

How do I calculate the chance of rolling 3 dice giving more hits than rolling 4 dice?

• Your question is not entirely clear, could you provide some examples as to what you mean? a sample perhaps of the rolling itself, and what you are trying to use this for? As it will help in giving you an answer that is meaningful. "How do I calculate" is not what you want, you probably want a method, or a table for understanding the odds in your game. Either way - more description please. – Inbar Rose Feb 24 '14 at 10:07
• @InbarRose maybe it's not clearly worded but I think the aim is really clear. He wants to roll 3d6 and 4d6, in sequence, and get more successes on the first roll than on the second. What's the chance of that happening? Please Andràs tell us if I'm wrong. – Zachiel Feb 24 '14 at 10:18
• I deliberately did not use the DnD notation (3d6), because it is calculated entirely differently. 3d6 has an average of 10.5, rolling 3 dice in SR5 has an average of 1. – András Feb 24 '14 at 10:20
• I am open to suggestions how to phrase the question better, but I think writing 3d6 is will make it only worse, not better. – András Feb 24 '14 at 10:21
• I'd add a word about why you need to know that. I suppose Shadowrun has opposed checks and you want to know your winning chances when facing an opponent with an higher number of dice? – Zachiel Feb 24 '14 at 16:07

I'm sure it's possible and not too hard to treat your dice rolls as if they were 3d3 and 4d3 giving a success on a roll of 3 (for easier math), calculate the probabilities of getting 1, 2 or 3 successes on the first set and then the probability to get 1, 2, 3 or 4 successes on the second, then seeing which combination of those gives the intended result.

I'm fairly sure someone can write a mathematical formula for this, and I think I could if I spent some time on it, luckily there's Anydice that can do the math for us.

output [count {5, 6} in 3d6] - [count {5, 6} in 4d6]


As you can see, the probability to get at least one more success on 3d6 than on 4d6 are 25.24%

I got curious about this question myself, so I did some thinking and came up with an equation:

$$\sum_{i=t}^n \binom{n}{i} \left(\dfrac{1}{3}\right)^i \left(\dfrac{2}{3}\right)^{n-i}$$

Where $n$ is the number of dice being rolled and $t$ is the desired threshold for the test. The result will be the probability of getting at least $t$ hits with $n$ dice.

In case you are not familiar with the notation, the first part of the sum (after the sigma and before the fractions) is the "binomial coefficient". It is typically read "n choose i" and represents the number of times you can choose $i$ items from a set of $n$ items.

Since the question asks specifically how you would do such a calculation, let me give a little explanation of the logic behind this equation.

First thing to do is imagine what a "hit" would look like. Since a hit is achieved by rolling a 5 or 6 on a six-sided die, then there is a 1/3 chance of getting a hit on a single die. This also means that there is a 2/3 chance of getting a miss on a die. That's where the two fractions come from in the equation.

Secondly, we want to know the probability of getting a certain number of hits. The odds of getting $i$ number of hits is $(1/3)^i$. So, rolling 2 hits would have a probability of $(1/3)^2$. Rolling 3 hits would be $(1/3)^3$. However... that's not the whole picture. When you rolling $n$ dice, some of them are hits and some are misses. So if $i$ dice are nits out of $n$ dice, then you can say that there are $n-i$ misses. Now getting certain number of misses is $(2/3)^{n-1}$.

Thirdly, now that we understand the fractional parts of the equation... There are multiple ways to get any given set of results (usually). To illustrate... Image we have 3 dice and we want to get 2 hits. If we name the dice die A, die B, and die C, then we can see that we could have hits on (A,B) or (B,C) or (A,C). So in the situation of trying to find 2 hits on 3 dice, we would have to multiply the $(1/3)^i \times (2/3)^{n-i}$ by the 3 different ways it can occur. We can generalize that by saying that the fractional part of our probability equation must be multiplied by the number of ways to get $i$ hits out of $n$ dice. Hence the binomial coefficient part of the equation.

Up to now we have all that is needed calculate the probability of getting exactly $i$ number of hits on $n$ dice... However, if we'd like to calculate the chance of reaching a threshold then we need to look at the probability of not just getting $i$ hits, but also of getting $i+1$ hits or $i+2$ hits all the way to $n$ hits (i.e. getting hits on all the dice). This is why we sum from $t$ (the min number of hits needed) to $n$ (the max number, since it's all the dice you rolled).

You can see a table here of all the calculated probabilities from $n = 1..20$ and $t = 1..20$.

I will also include the equation I came up with to calculate the same probabilities when using the Rule of Six. This equation is included primarily for those who are curious, and so I won't include the long explanation.

$$P_e(n, t) = \sum_{i=t}^n \binom{n}{i} \left(\dfrac{1}{3}\right)^i \left(\dfrac{2}{3}\right)^{n-i} + \sum_{i=1}^{t-1} \sum_{j=0}^{i-1} \binom{n}{n-i} \left(\dfrac{1}{6}\right)^j \left(\dfrac{1}{6}\right)^{i-j} \left(\dfrac{2}{3}\right)^{n-i} P_e(i-j, t-i)$$

Here is the same table showing those probabilities with Rule of Six.

• Having an accepted answer does not mean a question is done and closed! This looks like good stuff, though I'm not versed enough in SR to say for sure. I suspect you're familiar with SE, though; but if not, the Tour is worth checking out (can be even if you know other sites), plus we have the Role-playing Games Chat if you've got 20 rep here or at any other SE. – KRyan Jul 22 '14 at 23:18