Solved

Random Number Generation

Posted on 2002-06-14
9
296 Views
Last Modified: 2011-09-20
I'm looking for an easy to use random number generator library for use in a descrete event simulation and do not have any experience or knowledge of the arena. Any testimonial experience with a particular library or information on the different methods of generation would be greatly appreciated.

Have a good day,
jeff
0
Comment
Question by:jkelly061597
9 Comments
 
LVL 4

Accepted Solution

by:
jos010697 earned 50 total points
ID: 7080301
Well, we are talking C++ here, so why not use good ol' function rand()? It is part of the Standard C Library and it generates uniformly distributed pseudo random numbers in the interval 0 ... RAND_MAX.

kind regards
0
 
LVL 8

Expert Comment

by:fl0yd
ID: 7080622
The Standard C Library's rand() does return PSEUDO-random numbers, as correctly stated by jos. The only way of generating real random numbers is through the use of hardware. The only device capable of doing so that I know of is Intel's 82802 Firmware Hub, which can be accessed through Intel's 8XX chipsets. I don't know of any library that actually uses this feature though.
0
 
LVL 5

Expert Comment

by:proskig
ID: 7082226
Boost random number library was always considered to be pretty good

http://www.boost.org/libs/random/index.html
0
 
LVL 2

Expert Comment

by:jonnin
ID: 7083543
to test generators, check out a program called diehard.  Its on the web, and besides the program, the download has a good paper in it.

http://stat.fsu.edu/~geo/diehard.html

0
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
LVL 4

Expert Comment

by:havman56
ID: 7115896
very good info from all .. realy very good thread!!
0
 
LVL 4

Expert Comment

by:havman56
ID: 7115904
As far as i knew


if u go for some gausian random function u will get real good random numbers.
which is equivalent in getting noises in any comunication systems.

0
 
LVL 8

Expert Comment

by:fl0yd
ID: 7117211
jeff,
   one thing you should always look out for when choosing a library/api: Make sure that you have an easy way to reproduce the same sequence of 'random' numbers. So what you are looking for as a developer are certainly pseudo-random numbers. Just imagine how tough debugging will be when an error pops up every now and then without being able to reproduce it.
0
 
LVL 11

Expert Comment

by:griessh
ID: 7262326
Dear jkelly

I think you forgot this question. I will ask Community Support to close it unless you finalize it within 7 days. You can always request to keep this question open. But remember, experts can only help you if you provide feedback to their questions.
Unless there is objection or further activity,  I will suggest to accept

     "jos"

comment(s) as an answer.

PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER!
======
Werner
0
 

Author Comment

by:jkelly061597
ID: 7265573
Thank you to everyone, I forgot about this question but ended up just using rand().

0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In days of old, returning something by value from a function in C++ was necessarily avoided because it would, invariably, involve one or even two copies of the object being created and potentially costly calls to a copy-constructor and destructor. A…
Introduction This article is the first in a series of articles about the C/C++ Visual Studio Express debugger.  It provides a quick start guide in using the debugger. Part 2 focuses on additional topics in breakpoints.  Lastly, Part 3 focuses on th…
The viewer will learn how to user default arguments when defining functions. This method of defining functions will be contrasted with the non-default-argument of defining functions.
The viewer will learn additional member functions of the vector class. Specifically, the capacity and swap member functions will be introduced.

867 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now