QB / QB64 Discussion Forum      Other Subforums, Links and Downloads
 Return to Index  

In case you're still interested...

October 16 2011 at 11:14 AM
Dave  (no login)


Response to Probally will never say hello

Seems to me that RNDNUM = INT(RND * 20000) + 1 could be changed to RNDNUM = (any number) and it wouldn't change the run time.

Chances of WINNUM = RNDNUM is 1 in 20000,
since this has to happen 32000 times in a row for HELLO WORLD to be printed,
chances of Success are 1 in (20000)^32000

This works out to 1 in (7.8245 x 10^137632).

My computer runs 1,000,000 trials in 1 minute. In other words, 7.8245 x 10^137626 minutes to success.

so 1.489 x 10^[137,621] years until HELLO WORLD is printed.

 
 Respond to this message