PDA

View Full Version : Dice & statistics question



J-H
2020-12-26, 02:28 PM
I'm testing something for a new product, so I'm intentionally vague about a few details here.

I am checking 3 different methods of rolling 4d6, and want to determine which one is best for actual random rolling. There are a couple of physical parameters involved. The data point I chose to measure was "how many of the dice are face up with the original value they had before rolling?" Ie, if I set all four dice to have the 1 face up, and roll no 1s, then the value is "4." The idea is to catch times when the dice are not rolling properly away from their starting orientation.

Since the probability of rolling a given number is .16667, I believe the probability of any one dice out of four returning the starting value should be .66667 (.167 x 4). My average "Do the dice match their starting value" should thus be about 3.33, except that I know there will be a lot of "noise."

I have run 16 tests with each of 3 methods. Here are results.

Roll A B C
1 3 4 4
2 2 4 4
3 4 2 3
4 3 3 4
5 4 3 3
6 2 3 3
7 4 3 3
8 3 2 4
9 3 1 4
10 3 2 4
11 2 4 2
12 2 3 2
13 4 3 4
14 2 4 4
15 4 3 3
16 4 3 4


Average # not matching original face value 3.06 2.94 3.44
Median 3.00 3.00 4.00
Mode 4.00 3.00 4.00



I feel like column C just had a lucky/unlucky string, since I don't see how "almost never returns to starting value" would be possible aside from statistical anomalies.
Aside from doing a lot more sampling, I'm not sure how to verify that.

Do I have any incorrect statistics or math so far?

Satinavian
2020-12-26, 02:39 PM
I'm testing something for a new product, so I'm intentionally vague about a few details here.
Since the probability of rolling a given number is .16667, I believe the probability of any one dice out of four returning the starting value should be .66667 (.167 x 4). That would be the average number of dice returning the same. The chance for at least one to return is a bit lower because the possible duplicates increase the average.

The chance for at least one of the dice showing the same number is 1- (5/6)^4.

Telok
2020-12-26, 02:51 PM
Mostly you want more trials. Probably a minimum of 200-300 trials.

Depending on how much you care about individual dice being balanced and randomized within the 4d6 you could use four different colored dice and keep a per-color record.

You might also care about how your rolling method is affected by different sizes and materials of dice. Casino dice are larger and sharper edged, wooden dice will be lighter, some fancy dice have rounder edges. I had a set of round d6 once, hollow with a weight inside that set the sides.

J-H
2020-12-26, 04:04 PM
That would be the average number of dice returning the same. The chance for at least one to return is a bit lower because the possible duplicates increase the average.

The chance for at least one of the dice showing the same number is 1- (5/6)^4.

5/6^4 is .51, so by that, roughly half of my trials should retain one of the same numbers, making "3" the correct average.

Segev
2020-12-26, 05:42 PM
Rather than comparing to the previous side being up, you should be looking for overall distribution of values on individual dice.

DwarfFighter
2020-12-26, 06:26 PM
I'm testing something for a new product, so I'm intentionally vague about a few details here.

Everything about this screams "automated dice roller".

What do you mean by "different methods" of rolling dice? Are we talking about the physical gestures involved, like putting them in cup and shaking them before rolling out the cup, or setting them up in a tower stack and knocking it over? Or are we talking about rolling a certain number of dice "normally" and keeping the four lowest/median/highest results? This ABC stuff is quite obtuse.

This thing about "starting 1s -> 0 1s = 4" requires more explanation. I'm guessing it's 4 because all four dice in the hypothetical example got a result different from the initial value. I don't think that really describes anything in terms of randomness - if you started with 1s and always got 2s, how is that random?

Are you just rolling 4d6 and seeing if you get random results? Why not just roll 1d6 four million times or a four million d6's once?

Why start with a fixed starting point and checking if the roll is different or not? What you want to look at is to see if your results are evenly distributed. If you roll your dice and 5 out of 6 results are different from the starting value, that doesn't prove randomness. You'd have to verify even distribution, not just "different from original face-up value".

-DF

KineticDiplomat
2020-12-26, 07:28 PM
Since you’re probably running an automated system, write the macro to roll 20d6 and then record the output for each dice position (the first d6, second d6, etc). Execute 1,000 runs of rolling those 20d6 63 times.

You can swap out the 63 with whatever you like, I just use it because the individual odds of one die never rolling a certain number in 63 rolls are in the 1/100k range, and it neatly works with internal sets of 7 rolls - where the odds of getting the same number every time are about 1/250k - so you can feel reasonably certain that you have an actual issue worth looking at if you start seeing outliers.

You now have a data set that you can chop and examine by position, over time, to see if the core RNG is working, if it has any positional preference (the 5th die likes to roll 6...), and if it skews after continued use.

J-H
2020-12-27, 12:47 AM
To clarify - these are physical dice in a holder/roller device. I'm trying to determine the correct minimum size to allow for normal rolling. Dice in a too-small container would not have room to move around and change orientation, and would thus generally retain their original value. That's why I'm comparing to the original value instead of just "did I get a good spread of numbers."

KineticDiplomat
2020-12-27, 08:18 AM
Even physically you’re still looking for proof that each individual die has a 1/6 chance to roll any given number, of which retaining the initial number is one of the possible failures. You might have many other lurking product issues. Better to look at it raw rather than start a run on a specific problem without knowing there are others out there.

For example, the odds of all 4 dice not returning to their original should be (5/6)^4 = 48.23%. You’re currently running 39.58% including a streaky third test. Could be variance - you ran a really small sample size for all this - could be a design issue.

My advice, for what little it is worth, is to create a raw data set to curate, and to up the test sizes by an order of magnitude to knock down variance.

OldTrees1
2020-12-27, 08:45 AM
The chance of returning to the starting number depends on 2 factors:
1) Are the dice marked so you can track them individually? Aka are we asking if the blue/red/green/purple dice returned to the blue/red/green/purple value? Or are the dice unmarked and thus we are asking if any dice gets the same value as any of the dice had originally?

2) The original numbers can be 4 of a kind, 3 of a kind, 2 pair, 1 pair, or all different. For marked dice these are equivalent. For unmarked dice these are not equivalent because the dice can change order. Chance to all return is:
4 of a kind: (1/6)^4 * 1
3 of a kind: (1/6)^4 * 4
2 pair: (1/6)^4 * 3*3
1 pair: (1/6)^4 * 3*4
all different: (1/6)^4 * 2*3*4

So the chance of going from small straight (1,2,3,4) to the same small straight is 24x as likely as going from 4 of a kind (1,1,1,1) to the same 4 of a kind.

J-H
2020-12-27, 09:45 AM
Yeah, that complexity is why I'm setting all 4 to the same face up before rolling. Less to try to track.

Segev
2020-12-27, 11:33 AM
Yeah, that complexity is why I'm setting all 4 to the same face up before rolling. Less to try to track.

Physical size-wise, that’s a simple geometry problem. You need them to have room in all three dimensions that is greater than the major diagonal across the cube. Ideally, if this is a planar device (that is, the dice are to be flat together when done), they’d have the chamber height be the major diagonal plus a little more high, and enough space in both planar directions for them to line up corner to corner along the major diagonal with just a little space to spare in the shortest direction. This gives maximum room to freely spin. You might increase the height to half again this length just to give more room for bouncing.

J-H
2020-12-27, 12:23 PM
I did a calculation similar to that, but I figured that it was a bit more complex than that, as rotational momentum needs to be imparted to the dice, so they might not start spinning right away.

Across the largest dimension (corner to corner usually):
D6 0.9 in
D8 0.915 in
D10 0.925 in
D20 0.92 in
I was surprised at how uniform the dice sizes really are.

Telok
2020-12-27, 03:17 PM
I was surprised at how uniform the dice sizes really are.

I checked my group's dice bucket. It started from an old 1/2 full coffee can 20+ years ago and has been randomly added to up until sometime middle of last year.

Most d6 were 15mm on a side, looks to match your dice for widest point. From the handful I pulled there were 16 of those. 4 at 16mm sides, 2 at 14mm, and one each 11mm & 13mm. I skipped the novelty (wood, metal), obviously oversized stuff like Vegas craps dice, and super small dice. Lots of variation in corner rounding though, from sharp to almost extra sides.

The d20s were more uniform, almost all 12mm on a side except one that was 15mm.