Multiple dice rolls (D&D Skill challenge) In Dungeons and Dragons there is something called a skill challenge, which involves rolling some dice (no surprise there).
An example of a skill challenge:
Skill challenge DC 25 thievery. Roll a d20* and add your thievery bonus (let's say 11) and check if the result matches or goes over 25 take note and roll again (next turn).
As soon as you have five rolls under 25 you fail. As soon as you have 2 rolls over or equal to 25 you succeed in the skill challenge.
How do I calculate the odds of being successful in a skill challenge?
With the numbers I provided I need at least a 14 to match the DC 25. That means that I have $7/20$ odds of matching (or going over) the DC (and $13/20$ for the opposite).
If I only had to match the DC once the math would be easy:
$(13/20)^5$ is the probability of failing, so $1-(13/20)^5$ is the probability of succeeding.
* d20 = 20 sided die, numbered 1-20.
 A: An equivalent way of phrasing this is that you roll 6d20 (because $6=5+2-1$ is the number of rolls after which you'll definitely have either succeeded or failed, and can't have done both), and succeed if at least two of those are higher than the threshold number. So your overall failure probability is
$$p^6 +6 p^5(1-p) \, ,$$
where $p=13/20$ is the probability of failing on any given roll (the first term counts the probability of failing 6 times, the second the probability of failing 5 times and succeeding once).
So, in your specific example, the probability of success is
$$1-(13/20)^6-6(13/20)^5(7/20) \approx 0.6809 \, .$$
A: Trying to generalize @Micah answer. 
If we define:  


*

*$m$ - maximum number of misses (originally $5$)

*$n$ - required number of successes (originally $2$)

*$p$ - probability of failing any given roll (originally $13/20$)

*$x = m + n - 1$ - number of rolls after which we'll have either succeeded or failed (originally $6$)


The overall failure probability can calculated using this:
$$
\sum_{i=0}^{n-1} \binom{x}{x-i} \times p^\left(x-i\right) \times \left(1-p\right)^i
$$

$s$ is the odds of success.
Example 1
Given $m = 5$, $n = 1$ and $p = 13/20$
we get
$$
x=5 \\
s = 1 - \left( 1 \times \left( 13/20 \right)^5 \times \left (1 - \left( 13/20 \right) \right)^0 \right)
$$
Example 2
Given $ m = 5$, $n = 2$ and $p = 13/20$
we get
$$
x=6 \\
s = 1 - \left( 1 \times \left( 13/20 \right)^6 \times \left (1 - \left( 13/20 \right) \right)^0 + 6 \times \left( 13/20 \right)^5 \times \left (1 - \left( 13/20 \right) \right)^1 \right)
$$
Example 3
Given $m = 5$, $n = 3$ and $p = 13/20$
we get
$$
x=7 \\
s = 1 - \\ \left( \\ 1 \times \left( 13/20 \right)^7 \times \left (1 - \left( 13/20 \right) \right)^0 + \\ 7 \times \left( 13/20 \right)^6 \times \left (1 - \left( 13/20 \right) \right)^1 + \\ 21 \times \left( 13/20 \right)^5 \times \left (1 - \left( 13/20 \right) \right)^2 \right)
$$
