Post Reply 
Good news for PPC Random-Number Generator
05-19-2021, 11:53 PM
Post: #22
RE: Good news for PPC Random-Number Generator
(05-19-2021 10:04 PM)Thomas Okken Wrote:  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.

Last 3 digits are hidden, but is easily deduced.
Example, I just tried Free42 RAN, and get 0.248998059347, 0.866775882678

>>> a, m = 2851130928467, 10**15
>>> x1, x2 = 248998059347, 866775882678
>>> t = x1 * 1000
>>> [t+b for b in range(1000) if (t+b)*a % m // 1000 == x2]
[248998059347131L]
>>> _[0] * a % m
866775882678177L
>>> _ * a % m
34252568964659L

It predicted next RAN is 0.0342525689646, which is indeed the case.

Quote: 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.

Period is 5E13, from Joe Horn's post
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 - Albert Chan - 05-19-2021 11:53 PM



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