Probability of critical hit dice roll for multiple criteria In a recent game of Dungeons and Dragons one of my friend's character's would roll two D20 dice for an attack and would score a critical hit under any of the following conditions:


*

*one of the dice roll 19

*one of the dice roll 20

*both dice roll the same result


I tried calculating the correct probability, but could not properly figure it out without resorting to writing a simple script that just enumerated all the possibilities. Could someone please explain to me how to properly calculate the chance of a crit?
edit: I should add that my little enumeration script counted 94/400 (23.5%) possibilities that resulted in a crit.
 A: We can do this by a simple counting argument.
First, we compute the total number of outcomes: $20^2 = 400$. This is easy to see: if the first die is a 1, then there are 20 values of the second; if the first die is a 2, there are 20 values of the second; and so on. In other words, the dice rolls are independent.
There are four rolls where both die result in crit values: $(19, 19), (19,20), (20,19), (20,20)$.
There are 18 rolls where the first die is a 19, and the second die does not crit: $(19,1),(19,2),\ldots,(19,18)$. Likewise for when the first die is a 20, and likewise for when the second die is a 19 or 20.
So far, we have $4+18+18+18+18$ total ways to crit.
Finally, we see that there are exactly 18 doubles not already counted for. So the total number of ways is $4\cdot 19+18 = 94$. The resulting probability is then this number divided by the total number of rolls:
$$P(\text{crit}) = \frac{94}{400} = 23.5\%$$
A: There are $20^2=400$ possible rolls with two dice--call them die $A$ and die $B$, say. There are $20$ possible rolls where both dice say the same thing. There are $40$ rolls in which die $A$ has a $19$ or $20$, but in only $38$ of those rolls does die $B$ have a different number on it (we counted the other two already). There are also $40$ rolls in which die $B$ has a $19$ or $20$, but only $36$ of those rolls has $B$ as the only die with a $19$ or $20$ (we took care of the rest in the previous two categories). Thus, there are $20+38+36=94$ different ways to roll a critical hit, out of a possible $400$ total rolls. The probability of a critical hit is then $\frac{94}{400}=\frac{47}{200},$ or $23.5\%$
