A classical iterative method for generating uniform pseudo-random number streams.

learn more… | top users | synonyms

0
votes
1answer
60 views

Pseudo random numbers

I am learning how to use pseudo random number generators but the instructor just told us how they work without explaining why they work. For example, can one prove that the numbers generated by LCG ...
1
vote
1answer
94 views

What PRNG function is this?

This is a 16-bit PRNG function, transcribed from assembly to C for easier reading: ...
9
votes
3answers
206 views

Parallel Mersenne Twister for Monte Carlo

Recently, I came across a comment claiming that almost all researchers doing Monte Carlo methods are doing it wrong. It went on to elaborate that merely choosing different seeds for different ...
2
votes
1answer
98 views

Difference between true & pseudo random numbers

I recently heard that in Linux, /dev/random and /dev/urandom are pseudo random number generators but not true random number ...
0
votes
0answers
43 views

Generating Random Numbers in Fortran for Metropolis method

I am having a really hard time getting any kind of reliable / consistent result from my Metropolis code. I have torn it apart and am now examining just the randomness in my random number generator. I ...
0
votes
0answers
86 views

Color Coding Gradient in Matlab

I am trying to visualize bond strength via a color gradient in matlab (such that a high energy would be in red, low in blue). The underlying data structure, bond locations, and bond energies are ...
1
vote
1answer
58 views

Sampling from the Generalized Beta of the Second Kind in Fortran

I need to sample from the generalized beta of the second kind (GB2) distribution (McDonald, 1984, Econometrica). Its PDF has the form $$ f_{a,b,p,q}(x) = ...
0
votes
2answers
57 views

Maths calculations for randomly generated numbers don't match computed averages

Ok, It was hard to explain my problem in the title. I hope it made enough sense to peak the curiosity of some of you. What I've been trying to do is find the relationship between the amount of random ...
1
vote
1answer
68 views

optimising changing the range of integers from random number generation

I'm looking to find the most efficient way to change integers from a random number generator to a different inclusive number range. I know of 2 ways so far: Change the number into a decimal in the ...
1
vote
1answer
505 views

Calculating periodicity of a pseudo random number generator (Middle-square method) [closed]

Below is a Python code that calculates the periodicity of the middle-square method for a given 4 digit-numbers: ...
1
vote
3answers
109 views

Quality of randomness in generated random number

I have generated a list of 3 random number where each summed to 1. I would like to assess the quality of randomness. What is the best mechanism to assess this randomness? E.g my random numbers are. ...
7
votes
1answer
164 views

WELL pseudo-random number generations

I've used MT19937 in a test harness to generate uniformly (unsigned) 32-bit [0, $2^{32}$- 1] values, based on the original Authors' mt19937.c implementation, to ...
2
votes
1answer
113 views

Multiple independent random number streams

Having multiple streams of pseudo-random numbers known to be independent and with a uniform distribution I want to do Monte Carlo simulations in parallel. In other words, one thread will have a ...
8
votes
3answers
1k views

random number generation from cython

I want to make my python program fast by using cython, but my inner loop is still making slow python calls to the random number generator! Several years ago this same issue was raised by someone on ...
5
votes
1answer
109 views

How to assure that a number only contains a certain range of digits?

Say I would like to generate a pseudo-random number, which only contains the digits 1, 4, 7 (this is arbitrary). My first guess would be to create and array "147" and create random numbers in the ...
7
votes
3answers
607 views

How to handle large numbers of output data sets from a simulation/sensitivity analysis?

Somewhat related, but I think the question is distinct enough to justify a separate question. As a bit of background, I come from a observational/statistical Epidemiology background, working with ...
4
votes
3answers
390 views

Quality Measures for Various Pseudo-Random Number Generators

According to this paper, Ideally, a pseudorandom number generator would produce a stream of numbers that: are uniformly distributed, are uncorrelated, never repeats itself, ...
7
votes
1answer
439 views

How can I determine the initial values of pseudo-random number generator if the sequence is given?

Suppose I knew that a random number sequence was generated by a linear congruential generator. That is, $x_{n+1}=(aX_n+c) \bmod m$ If I am given the entire period (or at least a large contiguous ...
5
votes
1answer
4k views

How can I determine the period of my pseudo-random number generator?

Suppose I'm using a linear congruential pseudo-random number generator (PRNG). Given a seed $x_0$, the multiplying factor (a), the shift factor (c) and the modulus factor (m), how can I determine the ...
7
votes
4answers
1k views

How can I seed a parallel linear congruential pseudo-random number generator for maximal period?

Normally when I seed a sequential random number generator in C, I use the call srand(time(NULL)) then use rand() mod N ...