[VA] SRC #011 - April 1st, 2022 Bizarro Special
|
04-12-2022, 06:37 PM
(This post was last modified: 04-12-2022 06:48 PM by J-F Garnier.)
Post: #24
|
|||
|
|||
RE: [VA] SRC #011 - April 1st, 2022 Bizarro Special
I had to come back to Valentin's solution, because I was puzzled: how did Valentin succeed to get (almost) 3 correct figures whereas I was unable to get more than one?
Our solutions are so close, we even used the same sequence ENTER SQRT * to compute the power 3/2. Do 1312 samples make a so big difference with 999? Is Valentin's random generator so much better than mine? Then I understood. I made a big, stupid mistake. I set the initial seed of my random generator to PI. It was not good because a seed must be between 0 and 1 (both excluded). I wanted to keep PI as part of the seed because PI is a transcendental number (and what is more random than a transcendental number?) so I changed my sequence PI STO 00 ; rnd seed to PI 1/X STO 00 ; rnd seed And my program immediately worked much better, even better than Valentin's one. My program worked so much better that I was puzzled again. And again, the light came. 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. On the contrary, my sequence [previous seed] PI * FRAC always gives 9 decimal places. So my generator provides numbers that are 10 times more dense (in the mathematical sense of the word) 82.5% of the time and so is more efficient by a factor of 8.25. The consequence is that my (corrected) program needs much less samples. A more detailed analysis revealed that the amount of needed samples is reduced by a factor of 7.25 only, not 8.25 because numbers ending with one 0 at the last place don't count. So I was just needing 1312 (the number Valentin estimated for his generator) divided by 7.25, i.e. just 181 samples. What a difference! Running my very slightly modified program (1/X inserted at step 5) with 181 samples quickly provides me this answer, actually more accurate than Valentin's result: --> 0.92616 [19182] at less than 0.0002 from the exact value 0.92598 [12605] ! Of course, my program using my version of the random number generator can't fit in a 10C. And it's fortunate for Rd. Albizarro, otherwise he wouldn't had time to enjoy a good diner ! J-F P.S. If you are tempted to take all this too seriously, just experiment with either program version (mine or Valentin's one) on a fast 15C or 41C emulator for instance, and you will get it soon. |
|||
« Next Oldest | Next Newest »
|
User(s) browsing this thread: