mersenne-twister Questions
4
Solved
I am playing around with PRNGs (like Mersenne Twister and rand() function of stdlib) and I would want a good test that would help me ascertain the quality of random data produced by the PRNGs.
I ha...
Argyll asked 20/3, 2012 at 1:28
3
Solved
I have read that "the computational complexity of the Mersenne twister is O(p2) where p is the degree of the polynomial".
What does this mean?
Which polynomial is this referring to?
Also, is co...
Stingaree asked 3/9, 2014 at 18:46
6
Solved
The following imports NumPy and sets the seed.
import numpy as np
np.random.seed(42)
However, I'm not interested in setting the seed but more in reading it. random.get_state() does not seem to c...
Paraglider asked 23/8, 2015 at 22:10
1
Solved
I am using mt19937 to generate a random string from a given seed like this:
std::string StringUtils::randstring(size_t length, uint64_t seed) {
static auto& chrs = "abcdefghijklmnopqrstuv...
Cheyennecheyne asked 23/6, 2020 at 16:0
1
Solved
I came across this question on Stack overflow:
How to randomly selection item from a list in Python
and they mentioned that it is not suitable for cryptographic/security purposes.
So, I found thi...
Vitavitaceous asked 13/2, 2019 at 14:29
4
Solved
I am a little unsure about the right forum for this question. It is between theoretical comp. sci./math and programming.
I use Mersenne-Twister to generate pseudo random numbers. Now, starting fr...
Dynamoelectric asked 15/11, 2010 at 12:50
2
Solved
I need to generate 16-bit pseudo-random integers and I am wondering what the best choice is.
The obvious way that comes in my mind is something as follows:
std::random_device rd;
auto seed_data =...
Intermit asked 9/1, 2019 at 13:45
3
Solved
I have the task of porting some python code to Scala for research purposes.
Now I use the Apache Math3 commons library and am having difficulty with the MersenneTwister.
In Python:
SEED = 123456...
Cathe asked 4/8, 2014 at 20:29
3
Solved
I need to run reproducible Monte Carlo runs. That means I use a known seed that I store with my results, and use that seed if I need to run the same problem instance using the same random numbers. ...
Aflame asked 28/11, 2018 at 16:10
3
Solved
I've read that many pseudo-random number generators require many samples in ordered to be "warmed up". Is that the case when using std::random_device to seed std::mt19937, or can we expect that it'...
Urine asked 19/3, 2013 at 19:59
8
Solved
Problem
I intend to write a C++11 application for Linux which does some numerical simulation (not cryptography) based on approximately one million pseudorandom 32bit numbers. To speed things up, I'...
Thereinto asked 17/2, 2013 at 17:31
3
We are facing a weird situation in our code when using R's runif and setting seed with set.seed with the kind = NULL option (which resolves, unless I am mistaken, to kind = "default"; the default b...
Liturgist asked 2/11, 2017 at 16:2
2
Solved
#include <random>
int f() {
std::random_device seeder;
std::mt19937 engine(seeder());
std::uniform_int_distribution<int> dist(1, 6);
return dist(engine);
}
Can multiple thread...
Grampus asked 17/11, 2016 at 13:10
0
Short version: common MT (and MT64) implementations have an extra tempering parameter 'd'. The papers I've looked at describing MT don't include it. Where is it from? When was it added?
Long versi...
Helianthus asked 29/9, 2016 at 1:9
3
Solved
I'm having trouble determining which variant of Mersenne Twister C++11 provides. Looking at Matsumoto and Nishimura ACM paper at Mersenne twister: A 623 Dimensionally Equidistributed Uniform Pseudo...
Bloxberg asked 8/10, 2015 at 16:40
1
As we know, the Mersenne Twister is not crytographically secure:
Mersenne Twister is not cryptographically secure. (MT is based on a
linear recursion. Any pseudorandom number sequence generated...
Susurration asked 1/9, 2015 at 10:27
2
I need to generate cryptographically secure random data in c++11 and I'm worried that using random_device for all the data would severely limit the performance (See slide 23 of Stephan T. Lavavej's...
Hertz asked 27/5, 2015 at 4:46
3
Solved
I'd like to generate identical random numbers in R and Julia. Both languages appear to use the Mersenne-Twister library by default, however in Julia 1.0.0:
julia> using Random
julia> Random....
Dramaturgy asked 7/4, 2015 at 1:48
2
Solved
Q: How do I generate (many) uniformly distributed integers from a-priory unknown ranges? What is the prefered way in terms of performance (milions of generated numbers)?
Context: In my app I have ...
Uplift asked 9/8, 2014 at 19:20
1
Using C++11's random module, I encountered an odd performance drop when using std::mt19937 (32 and 64bit versions) in combination with a uniform_real_distribution (float or double, doesn't matter)....
Invariant asked 23/4, 2014 at 9:43
6
Solved
I'm working on a program that runs Monte Carlo simulation; specifically, I'm using a Metropolis algorithm. The program needs to generate possibly billions of "random" numbers. I know that the Merse...
Neumeyer asked 20/6, 2014 at 19:2
2
Solved
I would like to do something like this:
boost::random_device rd;
boost::random::mt19937_64 gen(rd());
boost::random::uniform_int_distribution<unsigned long long> dis;
uint64_t value = dis(ge...
Jolin asked 29/4, 2014 at 18:14
3
Solved
I'm working on implementing R code into C++ so that it runs faster, but I am having difficulties implementing mersenne twister. I only wish to generate values between (0,1). Here is what I have tha...
Henbit asked 7/4, 2014 at 21:34
4
Solved
I have been trying to use the c++ 11 mersenne_twister_engine class( http://www.cplusplus.com/reference/random/mersenne_twister_engine/) to generate numbers in the interval [0,1] however I am contin...
Vara asked 11/12, 2013 at 18:23
1
Ruby implements PRNGs as "a modified Mersenne Twister with a period of 2**19937-1." 1
The way I understand MT is that it operates on 2^32 different seeds. What confuses me is that Random.new(seed)...
Corinthians asked 19/11, 2013 at 16:7
1 Next >
© 2022 - 2025 — McMap. All rights reserved.