Post Reply 
[VA] SRC #017 - April 1st, 2024 Spring Special
04-06-2024, 10:30 AM (This post was last modified: 04-06-2024 05:09 PM by J-F Garnier.)
Post: #9
RE: [VA] SRC #017 - April 1st, 2024 Spring Special
(04-01-2024 06:59 PM)Valentin Albillo Wrote:  how close can two consecutive RNDs actually be ?
Use RANDOMIZE 1 or the equivalent instruction to specify the value 1 as the seed and write code to output the list of ever closer consecutive RNDs and their index N in the sequence

OK, let's try the brute force on a super-fast HP-71B emulator:

10 RANDOMIZE 1 @ X=RND @ I=1 @ M=1
20 Y=RND @ I=I+1 @ IF ABS(X-Y)>=M THEN X=Y @ GOTO 20
30 M=ABS(X-Y) @ PRINT I,X,Y,M @ GOTO 20

2 .731362440213 .77207218067 .040709740457
13 5.64471991805E-2 6.30768172146E-2 6.6296180341E-3
125 .805774019056 .803607575861 .002166443195
316 .128424219936 .126476247276 .00194797266
378 .128629571043 .127765838222 .000863732821
1746 .657235932954 .658084547243 .000848614289
...
later, much later ...
38181163 .151576837566 .151576827517 1.0049E-8
... and even much later
157373808 .477539626899 .477539622968 3.931E-9
322950317 .325324468276 .325324470156 1.88E-9
... getting closer to the record:
431380423 .275319512003 .275319511289 7.14E-10
...[edit:]got it:
1838286534 .564079556829 .564079556839 1.E-11

[edit2:]
Sopped with index exceeding 5 x 109 with no better result.
No identical consecutive RNDs found, but only a small fraction of the RND period has been explored.

J-F
Visit this user's website Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
RE: [VA] SRC #017 - April 1st, 2024 Spring Special - J-F Garnier - 04-06-2024 10:30 AM



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