Welcome Guest. Please Login or Register. Apr 1st, 2018, 05:02am
ATTENTION MEMBERS: Conforums will be closing it doors and discontinuing its service on April 15, 2018. We apologize Conforums does not have any export functions to migrate data. Ad-Free has been deactivated. Outstanding Ad-Free credits will be reimbursed to respective payment methods.
Thank you Conforums members.
Speed up Liberty BASIC programs by up to ten times!
Compile Liberty BASIC programs to compact, standalone executables!
Overcome many of Liberty BASIC's bugs and limitations!
True Random Numbers?
« Thread started on: Sep 10th, 2015, 09:29am »
My code simply uses Rnd(1) to select two entries from a list. Is there any advantage to using true random numbers as opposed to pseudo generated ones? Would the pseudo ones demonstrate a bias for certain digits?
Is there any way to use Intel's RdRand instruction?
Would the pseudo ones demonstrate a bias for certain digits?
LB 4.04's RND function is known to be weak, with a definite bias (and presumably LB 4.0.5 is the same). LBB's RND is far better: it uses a well-established algorithm (a Linear Feedback Shift Register) that is known to have good statistical properties. The sequence length is 2^33-1, i.e. after that number of values have been generated the sequence repeats.
Quote:
Is there any way to use Intel's RdRand instruction?
Definitely, if it's supported by your CPU. But another option is to call the Windows CryptGenRandom API function, which should be good enough for most purposes.