Post Reply 
Good news for PPC Random-Number Generator
05-19-2021, 10:04 PM
Post: #21
RE: Good news for PPC Random-Number Generator
(05-19-2021 06:31 PM)Valentin Albillo Wrote:  
(05-19-2021 05:41 PM)rprosperi Wrote:  On these extended test runs to verify generated numbers are not repeated, where are all the generated numbers stored, while verifying subsequent numbers don't match, or are you trusting some algorithm's verification

For this particular algorithm and others like it, if the initial seed ever gets repeated then the whole sequence repeats again so a simple verification requires just to compare each generated number to the initial seed while keeping count of how many numbers are generated. Here, any seed you care to use gets repeated after exactly one millon generated numbers. No need to store anything but the initial seed.

To make sure there are no seeds which result in shorter periods, there are more ellaborated yet still simple algorithms that also don't need storing the whole sequence, see this link, "cycle detection".

With the HP-42S (and RPL, Free42, 71B) RNG, just looking for a repeated number is not sufficient, since they use a 15-digit seed internally, and then truncate it to 12 digits before returning it to the user code environment. The least significant of those 15 digits is always a 1, 3, 7, or 9, so the theoretical maximum cycle is 4e14 long, but I don't know if the actual cycles exhibited by that RNG are that long or whether there are multiple disjoint cycles.

All I know about that RNG comes from this thread: https://groups.google.com/g/comp.sys.hp4...tzMtZhlGoJ
Visit this user's website Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
RE: Good news for PPC Random-Number Generator - Thomas Okken - 05-19-2021 10:04 PM



User(s) browsing this thread: