I got curious about this question myself, so I did some thinking and came up with an equation:
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
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
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 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 * (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.
Here is the same table showing those probabilities with Rule of Six.