bug-gnubg
[Top][All Lists]

## Re: [Bug-gnubg] Rotating rolls in rollout

 From: Jim Segrave Subject: Re: [Bug-gnubg] Rotating rolls in rollout Date: Fri, 4 Oct 2002 13:44:33 +0200 User-agent: Mutt/1.4i

```On Fri 04 Oct 2002 (13:23 +0200), Nis Jorgensen wrote:
>
>
> --On 04  Oct 2002  11:17 +0100 Ian Shaw <address@hidden> wrote:
>
> >>Sent: 04 October 2002 10:48
> >>
> >>My suggestion would be to scramble the sequence of first
> >>rolls, while still
> >>using each of them one time. This might also allow stratification of
> >>rollouts which are not a multiple of 36 or 1296, and might be easily
> >>extendable to
> >>
> >This might be a good solution. Are you suggesting a static but scrambled
> >order, or a random order each time but checking you haven't used that
> >permutation before. The latter seems more natural but is probably more
> >processor intensive. I suppose you could generate a random sequence
> >1-1296 at the start of the rollout and use it to index through the roll
> >permutations.
>
> This is exactly what I was thinking of. I am still trying to find out
> whether this can easily be extended to ensure:
>
> 1. Stratified distribution of first rolls in any sequence of 36 rolls.
> 2. Stratified distribution of n'th rolls when doing at least 36^n rollouts.
> (how many people actually do rollouts with 36^3 trials?)
>
> Perhaps something like this (pseudocode)
>
> RollUsed(TrialNumber,Rollnumber) =
>       Sum for k = 0 to (Rollnumber - 1)
>               of
>       ((Trialnumber div (36^k)) mod 36)
>               mod 36

What happens to the results if you do something simple minded like:

create an array of rolls with
1296 elements. Initialise with 1111 1112 1113 .. 6664 6665 6666

Use the seed to randomise the array - for example, generate two
random nos. i and j in the range  0..1295 and swap array[i] with
array[j]. Repeat at least 648 times.

Then use this array sequentially (and circularly, dropping initial
doubles when rolling out initial positions) to supply the first two
rolls. This gives you a pseudo-random but repeatable set of roll
pairs and the processor cost is not very high - filling the array and
randomising it is relatively cheap, after that, during the rollouts
you don't have to keep track of what you've used.

--