Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- DIM T(20000) AS INTEGER
- h = 9543
- U = 1462
- N = 10000
- DO
- FOR i = 0 TO N: T(i) = 0: NEXT: UM = 0
- FOR i = 1 TO h
- m = INT(RND * N)
- IF T(m) = 0 THEN UM = UM + 1
- T(m) = 1
- NEXT
- PRINT UM; " unique out of "; h; " haikus : N estimate = "; CINT(N)
- IF ABS(UM - U) > 200 THEN a = 100 ELSE a = 10
- IF ABS(UM - U) < 20 THEN a = 1
- IF ABS(UM - U) < 5 THEN a = .1
- IF UM > U THEN N = N - a ELSE N = N + a
- SLEEP
- LOOP
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement