[VA] SRC #011 - April 1st, 2022 Bizarro Special
|
04-12-2022, 09:46 PM
(This post was last modified: 04-12-2022 09:48 PM by Albert Chan.)
Post: #25
|
|||
|
|||
RE: [VA] SRC #011 - April 1st, 2022 Bizarro Special
(04-12-2022 06:37 PM)J-F Garnier Wrote: Valentin's generator suffers from a big flaw: the sequence [previous seed] ->DEG FRAC, with inputs between about 0.175 and 1 (so about 82.5% of the time) gives a pseudo-random number with only 8 decimal places. I think Valentin "losing" 2 digits (when integer part get removed) is more random, not less. Any patch of small seed will quickly get randomized. (it get multiply by 57.29..., not 3.14...) Also, gain of least significant random digits mean very little when we sum forces. Say, we sum 1000 point mass forces, and expected to get around 926. If we solve FNF(X,X,X) = 926, we get X ≈ 0.0144 Hitting even 1 case within this sphere, we already passed sum of 926. The singularity make Monte Carlo integration unsuitable. 10 DEF FNF(X,Y,Z)=X/(X*X+Y*Y+Z*Z)^1.5 20 INPUT "N ? ";N @ S=0 30 FOR I=1 TO N @ S=S+FNF(1+RND-RND,RND-RND,RND-RND) @ NEXT I 40 DISP S/N @ GOTO 20 >RUN N ? 1000 .924145126462 N ? 1000 .899430246256 N ? 1000 .919886932633 N ? 1000 1.11304106775 If I stopped at first 1000 samples, I get F = 0.924. But, that's just lucky. Result cannot be repeated. With RND giving 12 random digits, and 4000 samples, we can barely get 1 digit. |
|||
« Next Oldest | Next Newest »
|
User(s) browsing this thread: 1 Guest(s)