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 |
|||
« Next Oldest | Next Newest »
|
User(s) browsing this thread: 8 Guest(s)