random-number-generator

vba more realistic random number generator

I know I can use a quasi-random number generation function/variable called Rnd. However, I've noticed that whenever I used Rnd in my userform, this sequence of numbers always show up: first iteration: 0.705547511577606 second iteration: 0.533424019813538 ... As a result, b/c the sequence of numbers showing up are the same every time wh...

Intel Math Kernel on windows, calling from c# for random number generation

Has anyone used the Intel Math Kernel library http://software.intel.com/en-us/intel-mkl/ I am thinking of using this for Random Number generation from a C# application as we need extreme performance (1.6 trillion random numbers per day). Also any advice on minimising the overhead of consuming functions from this c++ code in my c# Monte...

Problem with rand() in C

Possible Duplicate: why do i always get the same sequence of random numbers with rand() ? This is my file so far: #include <stdio.h> int main(void) { int y; y = generateRandomNumber(); printf("\nThe number is: %d\n", y); return 0; } int generateRandomNumber(void) { int x; x = rand(); return x; } ...

I need to generate random numbers in C

Possible Duplicates: How to generate a random number in C? implementation of rand() Generating random terrain in Blender3D I need high quality random numbers in C, but I have no idea what to really do. I need to be able to get numbers from 1-100. Any help or maybe point me to where I can find help. ...

Simple hardware RNG

I made a tongue-in-cheek comment to this question about making a hardware RNG. Does anyone know of any simple plans or can anyone descibe a simple hardware based RNG and the software to drive it? Go to Radio Shack. Buy a diode, an NTR resistor, a capacitor and serial cable. Cut off the end of the serial cable that does not fit ...

Unique random number sequence using qrand() and qsrand()

I want to generate unique random number sequence in QT, Using QDateTime::currentDateTime().toTime_t() as seed value, will qrand() generate unique random numbers? ...

Fast generation of random set, Monte Carlo Simulation

I have a set of numbers ~100, I wish to perform MC simulation on this set, the basic idea is I fully randomize the set, do some comparison/checks on the first ~20 values, store the result and repeat. Now the actual comparison/check algorithm is extremely fast it actually completes in about 50 CPU cycles. With this in mind, and in order...

Why use the C# class System.Random at all instead of System.Security.Cryptography.RandomNumberGenerator?

Why would anybody use the "standard" random number generator from System.Random at all instead of always using the cryptographically secure random number generator from System.Security.Cryptography.RandomNumberGenerator (or its subclasses because RandomNumberGenerator is abstract)? Nate Lawson tells us in his Google Tech Talk presentati...

What is a good, fast PRNG (non-cryptographically secure)

I'm looking for a fast PRNG so that I can quickly create (semi)unique IDs for objects. The uniqueness is more of a management problem and ID duplication is only a problem in extremely rare circumstances. It must be as fast as possible, as performance is critical, and non-sequential (if the IDs are sequential, it makes it more likely tha...

How to generate a random named text file in C#?

I have to make a loop to generate a 5 randomly-picked-letter string, and then create a text file under that name, lets say in C:// , how will I do that? Both the generating name and creating a file in the directory. I think I have to pick 5 random numbers from the ascii codes add them to an array and then convert them to the character eq...

PHP - Is rand(1,1000) = 1000 as probable as rand(1,1000) = rand(1,1000) ?

Is this how PHP implemented random number generating? Say I want to calculate a yes or a no. Everytime I have a certain probability percentage (say: 0,05% for this example). I do: $possibilities = 100 / $probabilityPercentage; //$possibilities = 2000 $yes = rand(1,$possibilities); $yesCheck = $possiblities; //OPTION 1 $yes...

replace rand() with openssl_random_pseudo_bytes()

I need a replacement for PHP's rand() function that uses a cryptographically strong random number generator. The openssl_random_pseudo_bytes() function gets you access to the strong random number generator, but it outputs its data as a byte string. Instead, I need an integer between 0 and X. I imagine the key is to get the output of o...

Find out what a random number generator was seeded with in C++

I've got an unmanaged c++ console application in which I'm using srand() and rand(). I don't need this to solve a particular problem, but was curious: is the original seed passed to srand() stored somewhere in memory that I can query? Is there any way to figure out what the seed was? ...

Generate a string of 5 random characters in Javascript

I want a 5 character string composed of characters picked randomly from the set [a-zA-Z0-9]. What's the best way to do this with Javascript? ...

random.choice not random

I'm using Python 2.5 on Linux, in multiple parallel FCGI processes. I use chars = string.ascii_letters + string.digits cookie = ''.join([random.choice(chars) for x in range(32)]) to generate distinct cookies. Assuming that the RNG is seeded from /dev/urandom, and that the sequence of random numbers comes from the Mersenne twis...

Random integers c++

I'm trying to produce random integers (uniformly distributed). I found this snippet on an other forum but it works in a very weird way.. srand(time(NULL)); AB=rand() % 10+1; Using this method I get values in a cycle so the value increases with every call until it goes down again. I guess this has something to do with using the ti...

JavaCard random number generation speed

Hi, I'm implementing an authentication protocol using ECDSA on javacard. The funniest thing I noticed was the "secure random number genrator" takes 700ms for execution. This can be considered as percfectly number. But after I load the applet to the card for the first time this time is 150ms. ECDSA signature therefore takes 228ms for i...

How do you seed a PRNG with two seeds?

For a game that I'm making, where solar systems have an x and y coordinates, I'd like to use the coordinates to randomly generate the features for that solar system. The easiest way to do this seems to seed a random number generator with two seeds, the x and y coordinates. Is there anyway to get one reliable seed from the two seeds, or i...

Non-repeating pseudo random number stream with 'clumping'

I'm looking for a method to generate a pseudorandom stream with a somewhat odd property - I want clumps of nearby numbers. The tricky part is, I can only keep a limited amount of state no matter how large the range is. There are algorithms that give a sequence of results with minimal state (linear congruence?) Clumping means that ...

random number generation inside a vector

Hello Under scheme I want to generate a vector of random numbers, I have tried this like this: (make-vector 10 (random 100)) and the output for this is such: #(44 44 44 44 44 44 44 44 44 44) so it seems like it uses the same seed for the generated items, how can I overcome this problem of generating n amount of randomly generated n...