Questions tagged [prng]

PRNG - Pseudorandom number generator, A pseudorandom number generator (PRNG), also known as a deterministic random bit generator (DRBG),[1] is an algorithm for generating a sequence of numbers that approximates the properties of random numbers.

See more about PRNG on wikipedia.org

232 questions
3
votes
2 answers

Python numpy - Reproducibility of random numbers

We have a very simple program (single-threaded) where we we do a bunch of random sample generation. For this we are using several calls of the numpy random functions (like normal or random_sample). Sometimes the result of one random call determines…
fyaa
  • 646
  • 1
  • 7
  • 25
3
votes
3 answers

Windows-equivalent of POSIX srandom(...) and random() functions?

I'm trying to port some code over from UNIX to Windows, and I need an implementation of POSIX srandom(x) and random() functions that, for a given seed x, generate the same number sequence as the one that conforms to POSIX.1-2001. What are some of…
JosephH
  • 8,465
  • 4
  • 34
  • 62
3
votes
1 answer

CUDA - Use the CURAND Library for Dummies

I was reading the CURAND Library API and I am a newbie in CUDA and I wanted to see if someone could actually show me a simple code that uses the CURAND Library to generate random numbers. I am looking into generating a large amount of number to use…
Wilo Maldonado
  • 551
  • 2
  • 11
  • 22
3
votes
2 answers

Multiple random number generators in Objective C

In my current project I need multiple random number generators because I need to be able to repeat their sequences independently from each other. So far I did not find any way to achieve this with the standard objective-c random number generators,…
sietschie
  • 7,425
  • 3
  • 33
  • 54
3
votes
5 answers

Multiple random number generator states in c/Unix

I'm using srandom() and random() to generate random numbers in c on a Unix system. I would like to have multiple RNGs. Each one, given the same seed, should output the same sequence. I would also like to save and restore the state of each one. …
Eyal
  • 5,728
  • 7
  • 43
  • 70
3
votes
1 answer

Assembly Language Random Number Generator

I have recently started to learn assembly language. For a project I am working on I have to make a random number generator using linear congruence. I am suppose to take in three numbers. An upper bound, a lower bound and a number of how many random…
Whiplash
  • 69
  • 1
  • 2
  • 8
2
votes
2 answers

Seeding a secure random number in java

Will two java.security.SecureRandom instances which are seeded with the same value initially give the same sequence of random numbers? I am asking this because I want the same sequence of random numbers in both the client and the server. What if…
Ashwin
  • 12,691
  • 31
  • 118
  • 190
2
votes
5 answers

Inverse of A*X MOD (2^N)-1

Given a function y = f(A,X): unsigned long F(unsigned long A, unsigned long x) { return ((unsigned long long)A*X)%4294967295; } How would I find the inverse function x = g(A,y) such that x = g(A, f(A,x)) for all values of 'x'? If f() isn't…
caffiend
  • 2,034
  • 2
  • 13
  • 15
2
votes
0 answers

How would I get the Fortuna generator (the one from the gnu classpath) to work right?

For some reason, no matter what code I try, this code always outputs a Exception in thread "main" java.lang.IllegalStateException: generator not seeded error. I have included my test code at the bottom of the message. Also, I have been unable to…
natman3400
  • 27
  • 5
2
votes
4 answers

Does any software exist for building entropy pools from user input?

It'd be nice to be able, for some purposes, to bypass any sort of algorithmically generated random numbers in favor of natural input---say, dice rolls. Cryptographic key generation, for instance, strikes me as a situation where little enough random…
Steven Dee
  • 273
  • 2
  • 7
2
votes
3 answers

Extracting initial seed value of a PRNG?

I recently read that you can predict the outcomes of a PRNG if you: Know what algorithm is being used. Have consecutive data points. Is it possible to figure out the seed used for a PRNG from only data points?
Blender
  • 289,723
  • 53
  • 439
  • 496
2
votes
4 answers

Would randomising the seed create a more random number?

I have three questions about RNG. The first is what data is available to use as a seed. I have always used the time but there must be other easily available seeds. What easily available seeds are there in c++? If I reseeded the RNG at random…
Skeith
  • 2,512
  • 5
  • 35
  • 57
2
votes
8 answers

Is it possible to generate random numbers through physical process simulation?

Is it possible to generate random numbers through physical process simulation? If I simulate the physical roll of a dice (i.e. you picking it up, shaking it in your hand, releasing it onto the table and recording which side ends up "up"...) will…
user72491
  • 3,527
  • 5
  • 24
  • 18
2
votes
4 answers

Generating a repeatable pseudo-random number based coordinates

I need to generate repeatable pseudo random numbers based on a set of coordinates, so that with a given seed, I will always generate the same value for a specific coordinate. I figured I'd use something like this for the seed: /* 64bit seed…
Jo-Herman Haugholt
  • 462
  • 1
  • 5
  • 15
2
votes
3 answers

C++ versus Java performance

Say theoretically you just generate random numbers [using standard libraries] in as many threads as you can [bound by hardware]. How fast would C++ over Java? no disk i/o, memory or gc. Just pure Math.random() calls across threads.
user697111
  • 2,232
  • 8
  • 29
  • 40