GeekGold Bonus for All Supporters at year's end: 1000!
9,971 Supporters
$15 min for supporter badge & GeekGold bonus
15 Days Left
Support:
Please select a support frequency
EXTRA AVOCADO! Sonderegger
United States Folsom CA
Shall I compare thee to a chevrolet?
...the headlamps of your eyes will make them dream.

I was wondering if you could help me out with a quandry. You seem mathy enough.
Suppose you roll 3 d6 dice. What are the odds of a particular sum of 2 dice showing up at least once?
I got as far as realizing that it is x out of 216 instances of a 3sumgroupings and yes 2 and 12 will be the rarest whilst 7 will appear much more frequently, and that the proper way to figure it out would be to count how many of the groupings have that number at least once.
for example, 2 shows up as a sum 16 out of 216 times, and 3 shows up 24 out of 216 times.
Help me out?
edit:Sorry about the garbled wording!


R J
United States Oswego Illinois

This is a D12 correct?




Your question is not completely clear. If I understand what you're asking correctly there are 30, not 24, ways to roll 3 sixsided dice so that the sum of any two of them is 3.
EDIT: The case of 2 and the case of 3 can be extrapolated to figure other sums rather easily. If the dice are unequal there are 30 ways, if they are equal, then 16. Take a sum of 6 for instance. There are 30 ways to roll 1,5 and 30 ways to roll 2,4 and 16 ways to roll 3,3 therefore 76 ways to roll a sum of 6 on two out of three dice.
With 4 dice it would be more complicated, because you could then roll the sum in more than one way on the same roll (e.g. when rolling for a sum of six you could roll 1,5,3,3) so you would have to subtract out the cases in common and it becomes rather messy.


Dan Cepeda
United States Anthem Arizona

I believe he's rolling 3d6.




If I'm following right, you're saying:
Pick a target number that could be rolled on 2d6 Roll 3d6 If any pair of dice could add up to your target number, success
Is that right?
If so, quick monte carlo (if I didn't screw it up) says:
>>> import random >>> def d6(): return random.randint(1,6) >>> def test(): (a,b,c) = (d6(), d6(), d6()) return set([a+b, b+c, a+c])
>>> results = dict( [ (x+1, 0) for x in range(1,12) ] ) >>> for x in range(10000): for v in test(): results[v] += 1
>>> for i in range(1,12): print i+1, (results[i+1] / 10000.0)
2 0.0746 3 0.1385 4 0.2104 5 0.2808 6 0.3451 7 0.4146 8 0.3532 9 0.2763 10 0.2196 11 0.1357 12 0.0759


EXTRA AVOCADO! Sonderegger
United States Folsom CA
Shall I compare thee to a chevrolet?
...the headlamps of your eyes will make them dream.

Yeah, it's a success for the total grouping of 3 sums. However, having done at least the first 2 numbers by hand, I get results of 16/216 and 24/216 for the sums of 2 and 3. these were easy, as I created a spreadsheet of all the possible dice combinations and searched instances.
Your numbers don't seem to add up to my visual inspection, however. They're a little bit off you would expect the 2 and 12 results to be equal.


EXTRA AVOCADO! Sonderegger
United States Folsom CA
Shall I compare thee to a chevrolet?
...the headlamps of your eyes will make them dream.

Kiraboshi wrote: Your question is not completely clear. If I understand what you're asking correctly there are 30, not 24, ways to roll 3 sixsided dice so that the sum of any two of them is 3.
EDIT: The case of 2 and the case of 3 can be extrapolated to figure other sums rather easily. If the dice are unequal there are 30 ways, if they are equal, then 16. Take a sum of 6 for instance. There are 30 ways to roll 1,5 and 30 ways to roll 2,4 and 16 ways to roll 3,3 therefore 76 ways to roll a sum of 6 on two out of three dice.
With 4 dice it would be more complicated, because you could then roll the sum in more than one way on the same roll (e.g. when rolling for a sum of six you could roll 1,5,3,3) so you would have to subtract out the cases in common and it becomes rather messy.
It's not number of ways, it's how many times a particular sum of 2d6 shows up at least once in every possible roll of 3d6.




That's because it's a Monte Carlo simulation  instead of enumerating all the actual outcomes to determine the true distribution, it's actually doing the experiment, rolling "real" dice and seeing what comes up, and repeating this many times to get an empirical approximate distribution. Hence, the values you expect to be equal (e.g. 2 and 12, 3 and 11) are close but not exactly equal, and should be pretty close to the true values as well (although you could probably scale the repetitions up a bit to improve things).




hanibalicious wrote: Kiraboshi wrote: Your question is not completely clear. If I understand what you're asking correctly there are 30, not 24, ways to roll 3 sixsided dice so that the sum of any two of them is 3.
EDIT: The case of 2 and the case of 3 can be extrapolated to figure other sums rather easily. If the dice are unequal there are 30 ways, if they are equal, then 16. Take a sum of 6 for instance. There are 30 ways to roll 1,5 and 30 ways to roll 2,4 and 16 ways to roll 3,3 therefore 76 ways to roll a sum of 6 on two out of three dice.
With 4 dice it would be more complicated, because you could then roll the sum in more than one way on the same roll (e.g. when rolling for a sum of six you could roll 1,5,3,3) so you would have to subtract out the cases in common and it becomes rather messy. It's not number of ways, it's how many times a particular sum of 2d6 shows up at least once in every possible roll of 3d6. So what you're saying is that a roll of {2, 2, 4} would count as one 4 and two 6s, is that right? It may help to know what you're doing this for, to make sure that everyone's looking at the problem the right way.


Chris Okasaki
United States White Plains New York

No reason to "throw dice" when we can just directly make all 216 combos. Modifying your code just a little bit:
results = dict( [ (x, 0) for x in range(2,13) ] ) for a in range(1,7): for b in range(1,7): for c in range(1,7): for v in set([a+b,b+c,a+c]): results[v] += 1 for i in range(2,13): print i, results[i]
which produces
2 16 3 30 4 46 5 60 6 76 7 90 8 76 9 60 10 46 11 30 12 16
These numbers are easy to figure out by considering a few different patterns.
To make 3, we need to roll 1,2,X (in some order): This can happen in 3 ways for X=1, 3 ways for X=2, and 6 ways each for X=3..6, for a total of 3+3+6+6+6+6 = 30 different ways. Then, to make 5, there are 30 different ways to roll 1,4,X and another 30 different ways to roll 2,3,X.
To make 2, we need to roll 1,1,X. This can happen in 1 way for X=1 and 3 ways each for X=2..6, for a total of 1+3+3+3+3+3 = 16 ways. Then to make 4, there are 30 different ways to roll 1,3,X and 16 different ways to roll 2,2,X.
The rest of the values can be derived similarly.


EXTRA AVOCADO! Sonderegger
United States Folsom CA
Shall I compare thee to a chevrolet?
...the headlamps of your eyes will make them dream.

conmanau wrote: hanibalicious wrote: Kiraboshi wrote: Your question is not completely clear. If I understand what you're asking correctly there are 30, not 24, ways to roll 3 sixsided dice so that the sum of any two of them is 3.
EDIT: The case of 2 and the case of 3 can be extrapolated to figure other sums rather easily. If the dice are unequal there are 30 ways, if they are equal, then 16. Take a sum of 6 for instance. There are 30 ways to roll 1,5 and 30 ways to roll 2,4 and 16 ways to roll 3,3 therefore 76 ways to roll a sum of 6 on two out of three dice.
With 4 dice it would be more complicated, because you could then roll the sum in more than one way on the same roll (e.g. when rolling for a sum of six you could roll 1,5,3,3) so you would have to subtract out the cases in common and it becomes rather messy. It's not number of ways, it's how many times a particular sum of 2d6 shows up at least once in every possible roll of 3d6. So what you're saying is that a roll of {2, 2, 4} would count as one 4 and two 6s, is that right? It may help to know what you're doing this for, to make sure that everyone's looking at the problem the right way.
No. A 2 2 4 counts as a success for 4 and a success for 6. The number of times you can make a sum within one instance does not matter, as long as it's at least once.


EXTRA AVOCADO! Sonderegger
United States Folsom CA
Shall I compare thee to a chevrolet?
...the headlamps of your eyes will make them dream.

cokasaki wrote: No reason to "throw dice" when we can just directly make all 216 combos. Modifying your code just a little bit:
results = dict( [ (x, 0) for x in range(2,13) ] ) for a in range(1,7): for b in range(1,7): for c in range(1,7): for v in set([a+b,b+c,a+c]): results[v] += 1 for i in range(2,13): print i, results[i]
which produces
2 16 3 30 4 46 5 60 6 76 7 90 8 76 9 60 10 46 11 30 12 16
These numbers are easy to figure out by considering a few different patterns.
To make 3, we need to roll 1,2,X (in some order): This can happen in 3 ways for X=1, 3 ways for X=2, and 6 ways each for X=3..6, for a total of 3+3+6+6+6+6 = 30 different ways. Then, to make 5, there are 30 different ways to roll 1,4,X and another 30 different ways to roll 2,3,X.
To make 2, we need to roll 1,1,X. This can happen in 1 way for X=1 and 3 ways each for X=2..6, for a total of 1+3+3+3+3+3 = 16 ways. Then to make 4, there are 30 different ways to roll 1,3,X and 16 different ways to roll 2,2,X.
The rest of the values can be derived similarly.
Brilliant. I love the way you approached it. Trying it for a sum of 3, I got the following. 12x has 6 combinations, 21x has 6 combinations, 1x2 has 6 combinations however one has already appeared in 12x (122), so 5, 2x1 has 5 similarly, x12 has 4, as does x21. 30 for 3.
Thank you sir!




Yep, I wrote some bad R code to do the same thing, got identical results, and dividing by 216 gives probabilities that are pretty close to the Monte Carlo ones so it all looks good.


Curt Carpenter
United States Kirkland Washington

What's the context here? Can't Stop?


Jason
United Kingdom Norwich Norfolk

Given my disastrous game of Claustrophobia yesterday, all I can say is if you need to roll a six, the probability is you won't. Ever. I have extraordinary luck rolling ones though...


EXTRA AVOCADO! Sonderegger
United States Folsom CA
Shall I compare thee to a chevrolet?
...the headlamps of your eyes will make them dream.

curtc wrote: What's the context here? Can't Stop?
Qwixx as reviewed here



