Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Random Number Generation

Posted on 2002-06-14
9
Medium Priority
?
303 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 150 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
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 
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
 
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

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

When writing generic code, using template meta-programming techniques, it is sometimes useful to know if a type is convertible to another type. A good example of when this might be is if you are writing diagnostic instrumentation for code to generat…
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 goal of the video will be to teach the user the difference and consequence of passing data by value vs passing data by reference in C++. An example of passing data by value as well as an example of passing data by reference will be be given. Bot…
The viewer will learn additional member functions of the vector class. Specifically, the capacity and swap member functions will be introduced.

877 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