Post Reply 
Sum of roll of N dice
05-02-2018, 05:06 AM
Post: #1
Sum of roll of N dice
THE QUESTION: Is there a direct way to return the sum of a roll of N dice without generating N random numbers and adding them together?

BACKGROUND: In a recent Facebook discussion, it was suggested that you simply generate a random number uniformly between N (a roll of all 1's) and 6N (a roll of all 6's). But that assumes that every total is equally probable, which is not true.

For example, the sum of a roll of 4 dice can be anything between 4 and 24... but not every sum has equal probability of occurring. Since there are 4 dice, each of which can have 6 values, there are 6^4 (1296) possible ways to roll 4 dice. There is only 1 way to roll a total of 4:

{ 1 1 1 1 }

so rolling a total of 4 has a probability of 1/1296. But there are 4 ways to roll a total of 5:

{ 1 1 1 2 }
{ 1 1 2 1 }
{ 1 2 1 1 }
{ 2 1 1 1 }

so rolling a total of 5 has a probability of 4/1296. There are 10 ways to roll a total of 6:

{ 1 1 1 3 }
{ 1 1 3 1 }
{ 1 3 1 1 }
{ 3 1 1 1 }
{ 1 1 2 2 }
{ 1 2 1 2 }
{ 2 1 1 2 }
{ 1 2 2 1 }
{ 2 1 2 1 }
{ 2 2 1 1 }

so rolling a total of 6 has a probability of 10/1296. Different totals have different probabilities. How can this be taken into account when simulating throwing N dice directly, without summing N random integers between 1 and 6?

<0|ΙΈ|0>
-Joe-
Visit this user's website Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
Sum of roll of N dice - Joe Horn - 05-02-2018 05:06 AM
RE: Sum of roll of N dice - Gerald H - 05-02-2018, 05:48 AM
RE: Sum of roll of N dice - pier4r - 05-02-2018, 06:21 AM
RE: Sum of roll of N dice - Jim Horn - 05-02-2018, 07:01 AM
RE: Sum of roll of N dice - pier4r - 05-02-2018, 08:04 AM
RE: Sum of roll of N dice - John Keith - 05-02-2018, 02:07 PM
RE: Sum of roll of N dice - Jim Horn - 05-02-2018, 05:58 PM
RE: Sum of roll of N dice - John Keith - 05-02-2018, 07:18 PM
RE: Sum of roll of N dice - Gerald H - 05-02-2018, 08:01 AM
RE: Sum of roll of N dice - Werner - 05-03-2018, 12:39 PM
RE: Sum of roll of N dice - Gerald H - 05-03-2018, 04:49 PM
RE: Sum of roll of N dice - Werner - 05-03-2018, 05:14 PM
RE: Sum of roll of N dice - Gamo - 05-02-2018, 10:54 AM
RE: Sum of roll of N dice - Joe Horn - 05-02-2018, 12:03 PM
RE: Sum of roll of N dice - Joe Horn - 05-02-2018, 02:00 PM
RE: Sum of roll of N dice - John Keith - 05-02-2018, 07:15 PM
RE: Sum of roll of N dice - Dieter - 05-02-2018, 07:38 PM
RE: Sum of roll of N dice - pier4r - 05-02-2018, 07:44 PM
RE: Sum of roll of N dice - Jim Horn - 05-02-2018, 09:51 PM
RE: Sum of roll of N dice - Csaba Tizedes - 05-03-2018, 08:16 AM
RE: Sum of roll of N dice - SlideRule - 05-04-2018, 12:23 AM
RE: Sum of roll of N dice - Csaba Tizedes - 05-04-2018, 06:09 AM
RE: Sum of roll of N dice - Joe Horn - 05-04-2018, 07:32 AM
RE: Sum of roll of N dice - SlideRule - 05-03-2018, 01:55 PM
RE: Sum of roll of N dice - Gamo - 05-04-2018, 06:27 AM
RE: Sum of roll of N dice - Joe Horn - 05-04-2018, 07:12 AM
RE: Sum of roll of N dice - SlideRule - 05-04-2018, 11:30 AM
RE: Sum of roll of N dice - Michael Zinn - 05-04-2018, 06:35 PM
RE: Sum of roll of N dice - Dieter - 05-04-2018, 08:04 PM
RE: Sum of roll of N dice - Dieter - 05-05-2018, 06:38 PM
RE: Sum of roll of N dice - Dieter - 05-06-2018, 06:12 PM
RE: Sum of roll of N dice - zooropa1844 - 05-06-2018, 10:11 AM
RE: Sum of roll of N dice - zooropa1844 - 05-06-2018, 08:18 PM
RE: Sum of roll of N dice - Dieter - 05-06-2018, 09:02 PM
RE: Sum of roll of N dice - zooropa1844 - 05-06-2018, 09:31 PM
RE: Sum of roll of N dice - pier4r - 05-08-2018, 05:14 PM
RE: Sum of roll of N dice - Allen - 05-11-2018, 12:11 AM
RE: Sum of roll of N dice - Allen - 05-11-2018, 01:32 AM
RE: Sum of roll of N dice - zooropa1844 - 05-11-2018, 06:55 AM
RE: Sum of roll of N dice - brickviking - 05-11-2018, 09:52 AM
RE: Sum of roll of N dice - Allen - 05-11-2018, 12:19 PM
RE: Sum of roll of N dice - Thomas Klemm - 06-23-2018, 09:36 PM
RE: Sum of roll of N dice - rprosperi - 06-23-2018, 10:33 PM
RE: Sum of roll of N dice - ttw - 06-24-2018, 01:08 AM



User(s) browsing this thread: 1 Guest(s)