The 10-sided die roller seems to occasionally get stuck repeatedly rolling the number 9. We would expect 10% + or - but two of us have been rolling 30% 9’s and sometimes as many as three consecutive times. I realize this is possible, but my friend and I have been playing over a year now and it keeps happening (on Internet and via email). Is there someway to reset or refresh the die roller?

Sequences of random numbers are streaky by nature. They have to be or they are not random. The current result cannot have any predictive value for the next result in a random sequence.

We’ve never been presented with any statistically significant evidence that the die roller has a problem. Every statistical test I’ve ever run on the the roller’s output has had a result consistent with generation from a true random source.

If we were presented with such evidence, that would very likely mean there’s a problem with the PRNG used by Java, because there’s only a line or two of our own code involved. That would be a *huge* deal because it’s supposed to be cryptographically secure and is relied on by many large enterprises. As it is, it’s undergone extensive scrutiny over the years (such as being FIPS-140-2 certified) and no problems have turned up. It’s not impossible that something is wrong despite all that, but it won’t be a thing anyone can just eyeball or detect from small samples.

For reference:

“Stop it from rolling the same number over and over!”

“But then it wouldn’t be random anymore…”

This comes up from time to time. Often I have opponents who want to use a secondary die roller because they think it will help. I think that is a pain in the butt. Next time it comes up, I’ll send them the explanation (above). To be fair, I often see players complaining about the real dice.

I’ll keep on rollin’ with the Vassal “dice”.

Real dice, with the exception of casino dice, tend to be rather bad at generating a uniform distribution.

Some years ago, an engineering professor and some students did an analysis of the plastic dice you get with games:

The upshot was that you should probably throw them all away (or at least make sure that everybody playing uses the same dice—that won’t give you a uniform distribution, but it will give all players the *same* skewed distribution).

Aren’t you concerned about your opponent cheating by replaying his turn until he gets favorable results?

Hi,

I think the take-away from the above, in particular the post by @uckelman, is that you are better of with a *Pseudo-Random-Number* (PRN) generator, then a roll of a regular die (unless you go an buy some expensive casino dice)

For real-life games (i.e., with board and counters, as opposed to virtual VASSAL games), one can download one of a hundered different die roller apps for a smart-phone. That said, I do find it satisfying to roll dice, however biased they may be.

One thing about PRNs - they really depend on the *seed* of the generator. For those that do not know how a PRN generator work;

- When ever a new random number is requested, the algorithm will calculate the a number based on its current state. In other words, if you know the current state and the algorithm used, then the next drawn number is
*entirely*predictable. - The initial state of the PRN generator is set by the
*seed*. Thus, if you start from the same seed every time you will get the*exact*same sequence of numbers. This is actually an*attractive*feature of PRN generators exploited when modelling random processes. - It is therefore important that the seed is carefully chosen. The seed should in general be a large number, which is why many use the current number of seconds since Epoch (1st of January 1970, at 0:00 GMT). At the time of writing this, that number is
`1714583576`

(you can deduce when I wrote this entry from that number). However, since the time since Epoch increases, it can lead to some funny effects when initiallising a PRN generators close (in time) to each other. Many Computer Operating Systems (OSs) provide another means of getting a more “random” seed. On GNU/Linux, for example, one can read from`/dev/urandom`

.

Another important point to consider with PRNs is that they typically produce sequences of integers (whole, positive numbers). Suppose you now want to draw a random number from `{1,2,3,4,5,6}`

. It is then tempting to, given a random integer *r* in the range `0`

to `RAND_MAX`

, to calculate that number as

```
uni = double(r) / RAND_MAX
die = int(uni * 6) + 1
```

but that has a number of problems. Computers have finite precision when representing real numbers, which means the ratio `double(r) / RAND_MAX`

is not *precise*. It is only precise to about 14 digits. When we then multiply by `6`

and round-off by `int(...)`

, we may accidentally introduce a bias on our random number. A better option is to calculate the remainder after division by our range, e.g.,

```
die = (r % 6) + 1
```

This can be done *exact* because a computer handles integers exact (at least up to some maximum number). This is, I believe, what VASSAL does.

An interesting feature of VASSAL is that you can define your own dice via a `SymbolicDice`

. This allows you to create biased dice. For example, you may not want your die rolls to be uniformly distributed

```
X ~ U[1,6]
```

(i.e., all outcomes between 1 and 6 are equally probable), but rather that they are triangular distributed

```
X ~ T[1,6,3.5]
```

That is, outcomes 3 and 4 are more probable than 2 and 5, which again are more probable than 1 and 6. This can be quite useful for some games in certain settings - e.g., tournaments, where luck should play less of a role than in other settings. An example of a module that allows you to choose between a uniform or triangular distribution of die-rolls is Gettysburg (Smithsonian) - the 1.2-ch version (shameless self-plug ). When using the biased dice in that game, the more extreme combat outcomes become less probable, and players can more easily assess the outcomes.

Perhaps VASSAL core could contain a similar component? Or perhaps allow the current die-roller to operate in a biased mode?

Yours,

*Christian*

No. If someone needs to cheat to beat me, then I have won.

Wow! Thanks for all the info. But life is too short. I’ll use the Vassal die roller on Vassal and whatever dice I have on hand when playing live. I’ll let others agonize over “bad die rolls”.

I think @RobS misunderstood you @MarkN.

I think @RobS took this comment to mean that you will roll the dice until you get a perceived “random” die roll. Which is not what I think you meant, and maybe I misunderstood @RobS.

@MarkN perhaps you can **close** this issue? Just check the check-box next to the answer you think is best (I would say @uckelman’s).

Yours,

*Christian*

I think @RobS took this comment to mean that you will roll the dice until you get a perceived “random” die roll. Which is not what I think you meant, and maybe I misunderstood @RobS.

You misunderstood. My point has nothing to do with trying for a “random” roll, but everything to do with trying for favorable die rolls.

Granted, with some games it might be a PITA to replay a turn, perhaps more than once, in order to get a favorable result(s), but with other games it’s not that big a deal to do this.

Eventually, I would inevitably ask myself, “Did I really lose that battle?”

But, to each his own.