PDA

View Full Version : Dice roll question.



Scryangi
2017-01-16, 02:50 PM
How frequently on 3 D20 dice would two people rolling the three dice each get the same number as their opponents on one, or two of the dice of theirs?

A friend is making a table top game and needs to know this for a game mechanic.

Lord Torath
2017-01-16, 03:35 PM
So you roll 3d20, and get three results, A, B, and C. Your opponent rolls 3d20, and gets three results, and you want to know how likely it is that their rolls match yours?

Matching all three rolls is the easiest to calculate. There's a 1in20 chance of any one roll matching any other roll. On three dice, there are 203 possible rolls (8000), and 6 of those will match your rolls, assuming order doesn't matter:
A,B,C
A,C,B
B,A,C
B,C,A
C,A,B
C,B,A
So there is a 6-in-8000 chance of matching all three dice: 0.075%

Next easiest to calculate is matching one roll. 1d20 has a 3-in-20 chance of matching one of your rolls, or a 17-in-20 chance of not matching any. Cube that for three dice, and you get a 173/203 chance of no matches: 61.4%. Subtract that from 100% to get the chance of a single match.

Chance of matching one die: 38.6% Now technically this also includes all the cases of two or three matches, as well, as we've only subtracted the cases where there are NO matches. More accurately, this is the chance of matching at least one die.

Two dice of three matching is trickier. I'm still working through the math on that one...

Scryangi
2017-01-16, 03:53 PM
THANK. YOU! This is exactly what we needed. Thank you so much.

o(〃^▽^〃)o

Coventry
2017-01-16, 04:26 PM
Next easiest to calculate is matching one roll. 1d20 has a 3-in-20 chance of matching one of your rolls, or a 17-in-20 chance of not matching any.

I think you overlooked something - the 3d20 roll will not always give you three distinct numbers to match against.

In the case where the 3 original dice rolls are (A,A,A), the opposing roll will only match 1 time in 20. This happens (20*1*1) times = 20 in every 8000 rolls.
In the case that matches (A,A,B) or (A,B,A) or (B,A,A), the opposing roll matches 2 times in 20. This happens (20*19*1)*2 times = 1140 times in every 8000 rolls.
In the case where the three dices roll different numbers, only then does the opposing roll match 3. This happens (20*19*18) times = 6840 times in every 8000.

To double check that all combinations are accounted for, (20+1140+6840) had better add up to 8000.

So the odds of a single die matching one of the three is actually: 20/8000 * 1/20 + 1140/8000 * 2/20 + 6840/8000 * 3/20 = 14.250625%.

Which means the chance of not matching is actually around 85%.

Lord Torath
2017-01-17, 11:23 AM
I think you overlooked something - the 3d20 roll will not always give you three distinct numbers to match against.

In the case where the 3 original dice rolls are (A,A,A), the opposing roll will only match 1 time in 20. This happens (20*1*1) times = 20 in every 8000 rolls.
In the case that matches (A,A,B) or (A,B,A) or (B,A,A), the opposing roll matches 2 times in 20. This happens (20*19*1)*2 times = 1140 times in every 8000 rolls.
In the case where the three dices roll different numbers, only then does the opposing roll match 3. This happens (20*19*18) times = 6840 times in every 8000.

To double check that all combinations are accounted for, (20+1140+6840) had better add up to 8000.

So the odds of a single die matching one of the three is actually: 20/8000 * 1/20 + 1140/8000 * 2/20 + 6840/8000 * 3/20 = 14.250625%.

Which means the chance of not matching is actually around 85%.I knew I was overlooking that situation, but I thought the chances would be lower than that. I was focused on rolling three 1s, which is only 1 in 8000. I forgot about rolling three of anything else. Thanks for the fix!

Coventry
2017-01-17, 10:32 PM
Gah! I had a typo in my post. 1140 is correct, but that came from "(20*19*1)*3", not from "(20*19*1)*2".

Oh, well.

Let's move on to the chance that both sides roll three dice, and that they get an actual/exact match

We'll stick with 8,000 possible rolls on the left, and tack on another 8,000 combinations on the right, totaling 64,000,000 possible combinations (20^6).

The weird cases are all the same:

Rolling a triplet (A,A,A) happens 20 times in 8,000, but the other side's dice would all have to match as well, so (20*1*1) * (1*1*1) = 20 times in 64M

Rolling a pair could look like any of these three: (A,A,B) (A,B,A) (B,A,A), which is the 1,140 case (20*19*1) x 3. The right side has the same possible set of patterns {(A,A,B) (A,B,A) (B,A,A)}, but since A and B must be the same number on both sides, the right side is restricted to only three possibilities. (20*19*1)x3 * (1*1*1)x3 = 3,420 times in 64M

Rolling no pair at all on the left would be (A,B,C). The opposition must match (A,B,C), but in any order. The left side looks like (20*19*18), but the right side is (3*2*1), or 41,040 times in 64M.

Everything else (64,000,000 - 41,040 - 3,420 - 20 = 63,955,520) is not an exact match between the two sides (99.9305%).

So the chance of three d20 rolls exactly matching another three d20 rolls is pretty slim.


The "two dice match" case breaks down like this:
(A,A,A)-(A,A,B), or (20*1*1) * (1*1*19)x3 = 1,140 in 64M

(A,A,B)-(A,A,C) adds to (A,A,B)-(A,B,C), or (20*1*19)x3 * (1*1*18)x3 + (20*1*19)x3 * (1*1*18)x6 = 61,560 + 123,120 = 184,680 in 64M

(A,B,C)-(A,B,D) , or (20*19*18)*(1*1*17)x3 = 348,840 in 64M

Two matches occur 1,140 + 184,680 + 348,840 = 534,660 in 64,000,000 combinations = 8.3540625% of the time.