EPrime - motion stim issues

David McFarlane mcfarla9 at msu.edu
Thu Aug 25 20:59:16 UTC 2011


Ah, I was not thinking about the underlying architecture of the 
Random() function, so you got me there!  Now the discussion must get 
more technical...

Of course, if Random() is based on, say, a 32-bit cyclic PRNG, then 
it will repeat its sequence after no more than 2^32 = 4,294,967,296 
samples (or perhaps more like 2^31 = 2,147,483,648 samples, because 
E-Basic/VBA does not use unsigned integers).  But that is not what I 
had in mind, because we rarely use Random() to pick numbers from that 
entire range.

Rather, I had in mind more common & prosaic uses such as 
Random(0,99).  The underlying architecture now parses the full 32-bit 
range into 100 segments, with no guarantee that it will not draw 
samples from the same segment until a sample has been drawn from each 
segment.  To the contrary, it is extremely likely in this case that 
it will draw duplicate numbers within the first 100 samples.  You can 
see this readily if you try a scaled-down example, say, Random(0,9) 
or even Random(0,2) -- I know, I just did this.

More to the point, I was thinking in terms of my understanding of the 
*intent* or *specification* of the Random() function, apart from its 
actual implementation.  As I understand it, Random() is *meant* to 
act as a die roll, not as a shuffled deck of cards.  IOW, Random(1,6) 
should return a random number from 1 to 6 each time, without regard 
to what came before (just like a six-sided die), rather than return a 
number and then remember that number and not return it again until 
all other numbers have been returned (like a shuffled six-card deck).

Did I get this right now?

Best,
-- David McFarlane, Professional Faultfinder


At 8/25/2011 03:25 PM Thursday, Paul Groot wrote:
>Absolutely; the cyclic chain of numbers will definitely pop-up the
>same numbers after a while... So they must have been but back ;-)
>
>my mistake!
>
>2011/8/25 David McFarlane <mcfarla9 at msu.edu>:
> > At 8/24/2011 03:20 PM Wednesday, Paul Groot wrote:
> >>
> >> Alternatively you could use a simple inline script at the start of the
> >> trial and use the E-Basic random() function to set durations. 
> (That would be
> >> uniform random w/o replacement.)
> >
> > Um, wouldn't the E-Basic random() function result in uniform random samples
> > *with* replacement?
> >
> > -- David McFarlane, Professional Faultfinder

-- 
You received this message because you are subscribed to the Google Groups "E-Prime" group.
To post to this group, send email to e-prime at googlegroups.com.
To unsubscribe from this group, send email to e-prime+unsubscribe at googlegroups.com.
For more options, visit this group at http://groups.google.com/group/e-prime?hl=en.



More information about the Eprime mailing list