Post Reply 
Information on calculator Random Number Generators from PPC Journal articles
11-16-2016, 06:20 PM (This post was last modified: 11-16-2016 06:40 PM by Dieter.)
Post: #47
RE: Information on calculator Random Number Generators from PPC Journal articles
(11-16-2016 01:53 PM)Dieter Wrote:  Any idea what would cause strange results like these?

I did another test. This time starting with x0 = 0,45642414. The implementation mentioned above generates the following sequence:

0,350905
0,42875
0,62931
0,93117
0,02565
0,42874
0,643333
...

A sample of 1000 consecutive random numbers showed a period length of 77. The 78th number is 0,350905 again, and the above sequence starts over. In fact the 78th x-value is 0,45642414 again, the original seed. Thus in 1000 numbers every value occured 13 times. OK, except one since 13x77=1001. This exeption is the seed itself, i.e. Rn=0, 42414. And in fact there is not one single Rn in [0,7; 0,8[. In the sorted list of these 1000 random numbers 0,69777 is directly followed by 0,84506.

I have also checked this with an HP41 implementation:

Code:
RCL 00
ST+ X
1
+
e^x
FRC
STO 00
1E3
*
FRC

Starting with 0,45642414 in R00 the program yielded exactly the same results, and after 77 numbers the sequence restarted, with 0,45642414 in R00 again.

For the record, here is the complete list of the first 80 Rn:

Code:
 1.  0,350905
 2.  0,42875
 3.  0,62931
 4.  0,93117
 5.  0,02565
 6.  0,42874
 7.  0,643333
 8.  0,85718
 9.  0,10318
10.  0,65815
11.  0,557927
12.  0,47512
13.  0,092
14.  0,95182
15.  0,41278
16.  0,07307
17.  0,505942
18.  0,303103
19.  0,382599
20.  0,094476
21.  0,436495
22.  0,03523
23.  0,02344
24.  0,285095
25.  0,85653
26.  0,675471
27.  0,37482
28.  0,54911
29.  0,95747
30.  0,57554
31.  0,214103
32.  0,849191
33.  0,309908
34.  0,46272
35.  0,4397
36.  0,12143
37.  0,428283
38.  0,038915
39.  0,116376
40.  0,383202
41.  0,29357
42.  0,25395
43.  0,516251
44.  0,94027
45.  0,63507
46.  0,687494
47.  0,342444
48.  0,06445
49.  0,875943
50.  0,521511
51.  0,24125
52.  0,17458
53.  0,424301
54.  0,141801
55.  0,332297
56.  0,213162
57.  0,144471
58.  0,10338
59.  0,070719
60.  0,872262
61.  0,370813
62.  0,99494
63.  0,482137
64.  0,69777
65.  0,11986
66.  0,960758
67.  0,3351
68.  0,43555
69.  0,69399
70.  0,43742
71.  0,391572
72.  0,84506
73.  0,596742
74.  0,41389
75.  0,913563
76.  0,60827
77.  0,42414
78.  0,350905   ...and back to start
79.  0,42875
80.  0,62931
     ...

Hm, hmm, hmmm...

Dieter
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
RE: Information on calculator Random Number Generators from PPC Journal articles - Dieter - 11-16-2016 06:20 PM



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