Create account / Log in

VASSAL Random Number Generator (Dice)

Issues with the Vassal engine.

Moderators: Tim M, uckelman

VASSAL Random Number Generator (Dice)

Postby cfar » February 8th, 2012, 5:14 pm

while paying None But Heroes I've noticed that over several hundred 2d6 rolls my average roll is just over 6.5. Probability theory indicates it should be 7.0 or very close to that number.

Is the random number generator associated with VASSAL contained within the VASSAL engine or does it use each computer in the game to generate a seed and the resultant series of numbers as a particular player 'rolls the dice'?
cfar
 
Posts: 3
Joined: July 23rd, 2010, 2:07 pm

Re: [messages] [Technical Support & Bugs] VASSAL Random Numb

Postby tar » February 8th, 2012, 5:48 pm

The pseudo random number generator is built in.
It is believed to be quite good.
See
http://www.vassalengine.org/wiki/Faq_ge ... _random.3F

Although you do seem to have collected data that may warrant further
investigation.

On Wed, Feb 8, 2012 at 9:14 AM, cfar wrote:

> while paying None But Heroes I've noticed that over several hundred 2d6
> rolls my average roll is just over 6.5. Probability theory indicates it
> should be 7.0 or very close to that number.
>
> Is the random number generator associated with VASSAL contained within
> the VASSAL engine or does it use each computer in the game to generate a
> seed and the resultant series of numbers as a particular player 'rolls
> the dice'?
>
> ______________________________**_________________
> Read this topic online here:
> http://www.vassalengine.org/**forum/vie ... 7#**p30727
> ______________________________**_________________
> messages mailing list
> messages@vassalengine.org
> http://www.vassalengine.org/**mailman/listinfo/messages
>
User avatar
tar
 
Posts: 772
Joined: January 2nd, 2008, 6:53 pm
Location: Los Angeles area

Re: VASSAL Random Number Generator (Dice)

Postby cfar » February 8th, 2012, 7:11 pm

What drove me to look was a difference in my and my opponents results. He typically is averaging about 7.2. However is the pseudo random number generator is built in it just means he's getting the top end numbers and I'm getting the bottom. Stuff happens.

I was concerned that if the random numbers were tied to the computer, I might as well give up on VASSAL.

Thanks for the quick reply.
cfar
 
Posts: 3
Joined: July 23rd, 2010, 2:07 pm

Re: [messages] [Technical Support & Bugs] Re: VASSAL Random

Postby uckelman » February 8th, 2012, 7:39 pm

Thus spake cfar:
>
> I was concerned that if the random numbers were tied to the computer, I
> might as well give up on VASSAL.

I think you have a misconception about how the random numbers are
generated. We're using java.security.SecureRandom as our PRNG. It's a
cryptographically-strong PRNG. It will be seeded the first time it's
asked for a random number. If you're running some Unix, the seed comes
from /dev/random or /dev/urandom; on Windows, it comes from the MS
Crypto API. (I checked this just now by looking at the JDK code.) It's
quite likely that your seed will not be the same as your opponent's,
but it's also irrelevant for the fairness of the dice rolls, because
the serial correllation coeficient for this generator will be very close
to 0. This means that consecutive rolls are effectively independent
events, which is what you expect to be the case for fair dice.

That is to say: There would be no detectable difference between having
your rolls come from one instance of this PRNG and your opponent's come
from another (as we do) and having them all come from the same one.

--
J.
User avatar
uckelman
Site Admin
 
Posts: 8113
Joined: December 10th, 2007, 9:48 am
Location: Durham, England

Re: [messages] [Technical Support & Bugs] VASSAL Random Numb

Postby uckelman » February 8th, 2012, 9:04 pm

Thus spake cfar:
> while paying None But Heroes I've noticed that over several hundred 2d6
> rolls my average roll is just over 6.5. Probability theory indicates it
> should be 7.0 or very close to that number.

For 250 2d6 rolls, the probability that you'll average exactly 6.5 with
fair dice is 0.00005, if I've done the math correctly. That is to say,
you'll have that result 1 in 20000 times. If you expand your window, to,
say 6.5 +/- 0.1, you'll get an average in that range with probability
0.00453, so that's something which you'd expect to happen about 1 in 250
times. That's not so improbable.

If you want to give our PRNG a proper test, take a few million rolls and
run a statistical suite on it, something like Ent or DieHarder. A few
hundred rolls is too small a sample.

--
J.
User avatar
uckelman
Site Admin
 
Posts: 8113
Joined: December 10th, 2007, 9:48 am
Location: Durham, England


Return to Technical Support & Bugs

Who is online

Users browsing this forum: Google [Bot] and 4 guests