IGNORED

# Intentional bias in random numbers

## Recommended Posts

While looking at an old program listing (Chateau Gaillard by Tim Hartnell) I came upon this:

X=RND*6+RND*6+RND*6

This struck me as odd: why not just use X=RND*18?

It turns out that the first example heavily biases the random number toward the middle of the range. There are many more ways to get numbers around the middle than there are ways to get numbers at the low and high extremes. If it is INT(RND*6)+INT(RND*6)+INT(RND*6) there is only 1 way to get a 0 or 15; 3 ways to get a 1 or 14; 6 ways to get a 2 or 13; 10 ways to get a 3 or 12, and so on.

##### Share on other sites

If you are rolling dice, it would be 3d6 - 3. That notation is common in tabletop role playing games.

##### Share on other sites

It's not BIAS, it's simply a different distribution.

Putting aside for a moment if RANDOM itself is totally RANDOM or only PSEUDORANDOM, the 18*RANDOM literally only shows a uniform distribution, while the 6*RANDOM+6*RANDOM+6*RANDOM gives you a bell curve

It has nothing to do with BIAS it's simulating different phenomena, the first is a roll of a fair 18-sided dice (if there was such a thing) the second is the sum of 3 rolls of a fair 6 sided dice (or the sum of a roll of 3 fair 6 sided dice at once if you prefer), different distributions.

For more dice it gets flatter relatively speaking.

##### Share on other sites

I saw that Chateau Gallard is an adventure/RPG so most probably Tim Hartnell indeed is simulating dice throws, instead of aiming at a range of random numbers 1-18.

##### Share on other sites

Never thought of it that way although it makes perfect sense from a probabilities standpoint. Definitely will have to incorporate that into future programs.

##### Share on other sites

<SNIP>.... is a roll of a fair 18-sided dice (if there was such a thing) ,......<SNIP>

https://www.amazon.com/Set-Unusual-Dice-d14-Purple/dp/B00OBQ6CII

##### Share on other sites

The distribution issue is a big part of why the twenty-sided die was used in Dungeons & Dragons. The early game designers knew six-siders could never give them a greater range because adding more dice simply creates the bell curve of values, skewing results towards the middle values. (One game system that uses this to good effect is GURPS, where skills and checks are done on 3d6, and the average skill is 10.)

I read a story awhile back that they got twenty-siders because Dave Arneson had been to Great Britain with his parents and he had picked up several mini d20's at a hobby shop there as a curiosity. The big issue that TSR had in the early days was finding a supplier who could get them dice; they eventually found it in a toy company that made plastic dice in different shapes for kids. Which is where the other poly-sided dice came from, they figured, why not use all of them?

##### Share on other sites

I've sort of wondered about this before, it's neat to see it broken down and is certainly knowledge I'll use in the future as well!

##### Share on other sites

While looking at an old program listing (Chateau Gaillard by Tim Hartnell) I came upon this:

X=RND*6+RND*6+RND*6

This struck me as odd: why not just use X=RND*18?

It turns out that the first example heavily biases the random number toward the middle of the range. There are many more ways to get numbers around the middle than there are ways to get numbers at the low and high extremes. If it is INT(RND*6)+INT(RND*6)+INT(RND*6) there is only 1 way to get a 0 or 15; 3 ways to get a 1 or 14; 6 ways to get a 2 or 13; 10 ways to get a 3 or 12, and so on.

As others point out, D&D had many exotic dice that could have rolled linear random numbers, but when it came to character attributes, the idea was you didn't want many characters to be too exceptional or too weak. so you'd role a 6 sided die 3x to determine states along a bell curve. So rolling a 6 sided die 3x was the standard way to determine your characters Strength, Intelligence, Dexterity, etc.

## Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

×   Pasted as rich text.   Paste as plain text instead

Only 75 emoji are allowed.