Post Reply 
New PRNG for calculators
06-07-2024, 08:55 PM (This post was last modified: 06-07-2024 09:42 PM by Namir.)
Post: #9
RE: New PRNG for calculators
Here are more results for TEN MILLION random numbers and TEN THOUSAND lags. These results are more than enough for using random numbers in calculator simulations. I also rounded the random numbers to 12 decimals to give results similar to popular programmable calculators.

Random numbers rounded to 12 decimals
With random init seed
Number of points = 1.000000e+07
min(x) = 0.0000018142
max(x) = 0.9999992789
mean(x) = 0.5002791084
std(x) = 0.2878110140
Max lags = 10000
min(acf(2:end) = -9.59039166e-03
max(acf(2:end)) = 9.51402836e-03
mean(acf(2:end)) = 2.32021982e-05
std(acf(2:end)) = 2.60088239e-03

In the above results the mean is close to 0.5 and the standard deviation is close to 0.288. The minimum and maximum random numbers cover a good part of the range [0, 1].

The auto-correlation values are taken of 10,000 lags and show a weak correlation between the random numbers with values in the range [-0.0095, 0.0095].

These two sets of results give a preliminary assessment that the algorithm is good and needs no further modifications.

I rand two batches for the initial seeds of 0 and 1. The results are similar to the above. In practical use, one would provide an initial seed other than 0 or 1, and with many decimal places.

With init seed of 0
Number of points = 1.000000e+07
min(x) = 0.0000065295
max(x) = 0.9999998871
mean(x) = 0.4995039774
std(x) = 0.2882581865
Max lags = 10000
min(acf(2:end) = -4.78069967e-03
max(acf(2:end)) = 4.49636143e-03
mean(acf(2:end)) = 1.24859064e-05
std(acf(2:end)) = 1.17159700e-03

With init seed of 1
Number of points = 1.000000e+07
min(x) = 0.0000000721
max(x) = 0.9999992789
mean(x) = 0.5003003014
std(x) = 0.2878265888
Max lags = 10000
min(acf(2:end) = -9.23315691e-03
max(acf(2:end)) = 9.30401849e-03
mean(acf(2:end)) = 2.19537931e-05
std(acf(2:end)) = 2.53885074e-03
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
New PRNG for calculators - Namir - 06-06-2024, 08:17 PM
RE: New PRNG for calculators - KeithB - 06-06-2024, 08:30 PM
RE: New PRNG for calculators - Namir - 06-06-2024, 08:37 PM
RE: New PRNG for calculators - ttw - 06-07-2024, 01:35 AM
RE: New PRNG for calculators - Namir - 06-07-2024, 02:05 AM
RE: New PRNG for calculators - Namir - 06-07-2024, 02:14 AM
RE: New PRNG for calculators - ttw - 06-07-2024, 03:32 AM
RE: New PRNG for calculators - Namir - 06-07-2024 08:55 PM
RE: New PRNG for calculators - Albert Chan - 06-07-2024, 09:45 PM
RE: New PRNG for calculators - ttw - 06-08-2024, 02:51 AM
RE: New PRNG for calculators - Albert Chan - 06-08-2024, 01:46 PM
RE: New PRNG for calculators - ttw - 06-08-2024, 03:44 PM
RE: New PRNG for calculators - Albert Chan - 06-08-2024, 06:19 PM
RE: New PRNG for calculators - SlideRule - 08-08-2024, 05:48 PM
RE: New PRNG for calculators - Namir - 08-09-2024, 08:16 PM
RE: New PRNG for calculators - KeithB - 08-08-2024, 06:57 PM
RE: New PRNG for calculators - Namir - 08-09-2024, 12:39 PM
RE: New PRNG for calculators - EdS2 - 08-09-2024, 05:41 AM
RE: New PRNG for calculators - KeithB - 08-09-2024, 01:26 PM
RE: New PRNG for calculators - Namir - 08-11-2024, 02:20 PM



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