LB Booster
« True Random Numbers? »

Welcome Guest. Please Login or Register.
Apr 1st, 2018, 04:20am



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!
LB Booster Resources
LB Booster documentation
LB Booster Home Page
LB Booster technical Wiki
Just BASIC forum
BBC BASIC Home Page
Liberty BASIC forum (the original)

« Previous Topic | Next Topic »
Pages: 1  Notify Send Topic Print
 thread  Author  Topic: True Random Numbers?  (Read 293 times)
Monkfish
Full Member
ImageImageImage


member is offline

Avatar




PM

Gender: Male
Posts: 104
xx 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?

Thank you smiley
User IP Logged

Richard Russell
Administrator
ImageImageImageImageImage


member is offline

Avatar




Homepage PM


Posts: 1348
xx Re: True Random Numbers?
« Reply #1 on: Sep 10th, 2015, 9:27pm »

on Sep 10th, 2015, 09:29am, Monkfish wrote:
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.

Richard.
User IP Logged

Pages: 1  Notify Send Topic Print
« Previous Topic | Next Topic »

| |

This forum powered for FREE by Conforums ©
Terms of Service | Privacy Policy | Conforums Support | Parental Controls