bug-gnubg
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Bug-gnubg] rollout settings


From: Joern Thyssen
Subject: Re: [Bug-gnubg] rollout settings
Date: Tue, 29 Oct 2002 09:40:30 +0000
User-agent: Mutt/1.4i

On Tue, Oct 29, 2002 at 09:01:05AM -0000, Ian Shaw wrote
> > From: max-d [mailto:address@hidden
> 
> > Can anyone give a short explanation (or links) for the 
> > rollout parameters :
> > 
> > Full cubeless rollout without var.redn., with rotate rolls ????
> > 
> > I have vague idea what  variance reduction is but never heard about
> > rotate rolls.
> >
> Rotate Rolls. The first 1296 rolls are preset to give a combination of all 
> possible sequences of rolls for player X and O on the upcoming two rolls. In 
> fact, looking at the change log I see:
> 
> Fri Oct  4 18:02:56 2002  Jørn Thyssen  <address@hidden>
> 
>       * rollout.c (QuasiRandomDice): rotate rolls at turn 2 and 3. 
>       This should ensure dice rotating for up to 1 679 616 trials.
>  
> 1 679 616 is 36^4, so it looks like rotation is in place for the first two 
> rolls for each player.
> 
> There has been some discussion about what happens if you do a rollout
> of < 1296 trials with rotation enabled. If the rolls are not random,
> you might skew the results if you do less than 1296 trials because,
> for example, you miss all sequences where X rolls 66.

They are, in fact, random (unless you choose a number of trials n*36).

The problem is that if you interrupt a rollout before it's finished,
you'll have missed some dice sequences.

> 
> There was some discussion about randomising the rolls within the 1296
> sequence, but this has not been implemented yet as far as I know.

No, not implemented yet. This should solve the problem with the
distribution of dice when a rollout is interrupted.

> 
> Until I understand what's happening, I don't trust rollouts using
> rotation unless there are at least 1296 trials.

There has always (well, at least since 2000) rotation of rolls in gnubg.
The new features are that you can turn it off and rotation beyond 2
rolls.

> 
> Can anyone verify the current state of play:
> 
> What happens if trials < 1296?

This is the actual code:

    /* normal rollout: doubles allow on first roll */

    if( fRotate && !iTurn && !( cGames % 36 ) ) {
      anDice[ 0 ] = ( iGame % 6 ) + 1;
      anDice[ 1 ] = ( ( iGame / 6 ) % 6 ) + 1;
      return 0;
    } else if( fRotate && iTurn == 1 && !( cGames % 1296 ) ) {
      anDice[ 0 ] = ( ( iGame / 36 ) % 6 ) + 1;
      anDice[ 1 ] = ( ( iGame / 216 ) % 6 ) + 1;
      return 0;
    } else if( fRotate && iTurn == 2 && !( cGames % 46656 ) ) {
      anDice[ 0 ] = ( ( iGame / 1296 ) % 6 ) + 1;
      anDice[ 1 ] = ( ( iGame / 7776 ) % 6 ) + 1;
      return 0;
    } else if( fRotate && iTurn == 3 && !( cGames % 1679616 ) ) {
      anDice[ 0 ] = ( ( iGame / 46656 ) % 6 ) + 1;
      anDice[ 1 ] = ( ( iGame / 279936 ) % 6 ) + 1;
      return 0;
    } else
      return RollDice( anDice, rngx );



> What happens if trails = 36n where 1 <= n <= 36?

Hopefully this should be clear from the code above.


> 
> Are trials after 1296 random or does the rotation restart? 

If you select 1297 trial all rolls will be random. If you select 1332
trials gnubg will do 37 full rotations of the first roll only, whereas
if you select 2592 gnubg will do two full rotations of the first two
rolls.

Jørn

-- 
Joern Thyssen, PhD
Vendsysselgade 3, 3., DK-9000 Aalborg, Denmark
+45 9813 2791 (private) / +45 2818 0183 (mobile) / +45 9633 7036 (work)
Note: new mobile number!




reply via email to

[Prev in Thread] Current Thread [Next in Thread]