Post Reply 
50g: an interesting RAND anomaly
03-17-2018, 05:43 PM
Post: #2
RE: 50g: an interesting RAND anomaly
The same happens using the HP-71B ancestor.
Using the Basic code:

0 ! --- RND test
20 DIM A(200)
30 FOR I=1 TO 200
40 A(I)=MOD(IP(RND*1.E+12),4)
50 X=RND @ X=RND
60 NEXT I
70 N=0 @ GOSUB 130
80 N=1 @ GOSUB 130
90 N=2 @ GOSUB 130
100 N=3 @ GOSUB 130
110 FOR I=1 TO 200 @ PRINT A(I); @ NEXT I
120 END
130 X=0
140 FOR I=1 TO 200
150 IF A(I)=N THEN X=X+1
160 NEXT I
170 PRINT X;"occurrences of";N
180 RETURN

and three successive runs:

50 occurrences of 0
50 occurrences of 1
50 occurrences of 2
50 occurrences of 3
3 3 1 2 2 2 1 2 2 1 3 0 1 1 1 1 0 2 0 2 2 0 2 2 1 2 2 1 1 1 1 0 3 1 2 1 3 2 1 2 0 0 3 2 3 2 3 1 0 2 2 3 2 2 3 1 2 3 2 1 3 0 0 1 2 3 0 0 3 2 3 3 1 2 0 0 1 3 0 1 2 1 1 1 1 3 2 0 2 2 0 2 0 3 1 0 3 3 1 1 1 1 3 0 0 0 3 0 0 3 1 2 3 3 3 3 2 0 2 0 0 2 0 0 3 0 0 3 3 3 3 2 1 3 0 3 1 0 3 0 2 2 1 0 1 0 1 3 2 0 0 1 0 0 1 3 0 1 0 3 1 2 2 3 0 1 2 2 1 0 1 1 3 0 2 2 3 1 2 3 0 3 3 3 3 1 0 2 0 0 2 0 2 1 3 2 1 1 3 3

50 occurrences of 0
50 occurrences of 1
50 occurrences of 2
50 occurrences of 3
3 3 1 2 2 2 1 2 2 1 3 0 1 1 1 1 0 2 0 2 2 0 2 2 1 2 2 1 1 1 1 0 3 1 2 1 3 2 1 2 0 0 3 2 3 2 3 1 0 2 2 3 2 2 3 1 2 3 2 1 3 0 0 1 2 3 0 0 3 2 3 3 1 2 0 0 1 3 0 1 2 1 1 1 1 3 2 0 2 2 0 2 0 3 1 0 3 3 1 1 1 1 3 0 0 0 3 0 0 3 1 2 3 3 3 3 2 0 2 0 0 2 0 0 3 0 0 3 3 3 3 2 1 3 0 3 1 0 3 0 2 2 1 0 1 0 1 3 2 0 0 1 0 0 1 3 0 1 0 3 1 2 2 3 0 1 2 2 1 0 1 1 3 0 2 2 3 1 2 3 0 3 3 3 3 1 0 2 0 0 2 0 2 1 3 2 1 1 3 3

50 occurrences of 0
50 occurrences of 1
50 occurrences of 2
50 occurrences of 3
3 3 1 2 2 2 1 2 2 1 3 0 1 1 1 1 0 2 0 2 2 0 2 2 1 2 2 1 1 1 1 0 3 1 2 1 3 2 1 2 0 0 3 2 3 2 3 1 0 2 2 3 2 2 3 1 2 3 2 1 3 0 0 1 2 3 0 0 3 2 3 3 1 2 0 0 1 3 0 1 2 1 1 1 1 3 2 0 2 2 0 2 0 3 1 0 3 3 1 1 1 1 3 0 0 0 3 0 0 3 1 2 3 3 3 3 2 0 2 0 0 2 0 0 3 0 0 3 3 3 3 2 1 3 0 3 1 0 3 0 2 2 1 0 1 0 1 3 2 0 0 1 0 0 1 3 0 1 0 3 1 2 2 3 0 1 2 2 1 0 1 1 3 0 2 2 3 1 2 3 0 3 3 3 3 1 0 2 0 0 2 0 2 1 3 2 1 1 3 3


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
50g: an interesting RAND anomaly - DavidM - 03-17-2018, 05:02 PM
RE: 50g: an interesting RAND anomaly - J-F Garnier - 03-17-2018 05:43 PM
RE: 50g: an interesting RAND anomaly - ttw - 03-18-2018, 02:03 AM
RE: 50g: an interesting RAND anomaly - ttw - 03-19-2018, 06:31 PM
RE: 50g: an interesting RAND anomaly - ttw - 03-19-2018, 07:35 PM



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