[Jprogramming] 32- & 64-bit PRNGs

Ewart Shaw ewartshaw at gmail.com
Fri Oct 14 19:08:55 HKT 2011


Dear forum,

I want to generate pseudorandom sequences that are the same for 32- & 64-bit J.
I need better statistical properties than the old linear congruential generator
as in 'roll' & 'deal' at   http://www.jsoftware.com/help/release/random.htm .

I could implement the 32-bit MT19937 'by hand' in J via the pseudocode at
   http://en.wikipedia.org/wiki/Mersenne_twister
but prefer if possible not to reinvent the wheel.

Is it possible (for example) to convert the output from  128!:4  in J64 to what
it would have been from the same seeds in J32, for any of the current PRNGs?

Many thanks for any suggestions -- Ewart Shaw

-- 
J.E.H.Shaw   [Ewart Shaw]      strgh at uk.ac.warwick    TEL: +44 2476 523069
 Department of Statistics,  University of Warwick,  Coventry CV4 7AL,  UK
 http://www.warwick.ac.uk/statsdept    http://www.facebook.com/ewart.shaw
3  ((4&({*.(=+/))++/=3:)@([:,/0&,^:(i.3)@|:"2^:2))&.>@]^:(i.@[)  <#:3 6 2


More information about the Programming mailing list