Post Reply 
What are good PRNG for calculators?
09-01-2014, 07:00 PM (This post was last modified: 09-01-2014 07:26 PM by John R. Graham.)
Post: #21
RE: What are good PRNG for calculators?
(08-22-2014 02:16 PM)Namir Wrote:  
(08-22-2014 01:45 PM)John R. Graham Wrote:  ...On the "less than short" side, just for fun I implemented the Mersenne Twister on my HP 50g.

Listing for the HP-50G implementation?

Namir
Attached. Sorry for the delay. Short operating instructions:
  • Run Start to create the state variable structure.
  • Run SeedN or SeedT one or more times to seed the PRNG. SeedN takes a numeric argument but SeedT fetches a little bit of real entropy from the TICKS variables and uses that as a seed. You can seed the PRNG up to 624 times, which completely fills out the state variable, but typically you would seed it once, or just a few times.
  • Run Init to fully initialize the state variable and prepare the PRNG for use.
  • Use MtRnB or MtRnR to retrieve pseudo-random numbers. MtRnR returns traditional HP pseudo-random numbers (0 < n < 1) with 32 bits of precision. MtRnB returns the native 32-bit binary numbers that Mersenne Twister produces.
This implementation has been tested against the Math::Random::MT Perl library available from CPAN and demonstrated to produce identical results through 5,000 iterations.

- John


Attached File(s)
.zip  Hp50gMersenneTwister-v1.0.zip (Size: 2.19 KB / Downloads: 13)
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
RE: What are good PRNG for calculators? - John R. Graham - 09-01-2014 07:00 PM



User(s) browsing this thread: 1 Guest(s)