Summing the result of each draw from the RND function, how many draws are expected to occur until the sum exceeds 1?
That is, on average, if I do
RND + RND + RND + RND + ...
when does that sum pass 1? Well, of course the average of RND is 0.5, so we should expect RND + RND alone to more-or-less do the job. Right?
So while this is still fresh in your head, how many randoms multiplied together does it take for the expected product to go below 1/n ?
RND * RND * RND.... <= 1/N
I wonder how much of that is a result of QB64’s RND not being a true random value, but a pseudorandom formula instead.No effect at all - RND is random enough for this.
You question is equivalent to asking when is N * RND * RND * RND * ... < 1. The answer is 1+log(N). I can write up a proof tomorrow, but for now be convinced by this code: