Questions tagged [random-number-generator]
The random-number-generator tag has no summary.
69 questions
0 votes
0 answers
60 views
Pseudo Random Number Generation per Middle Square?
I read the wikipedia article about this and have questions on numbers that can be used as pseudo random values. Questions are presented than a recursive algorithm used to discuss. Question: On $...
0 votes
2 answers
95 views
is it possible to save the state of a cryptographically strong random number generator?
Background: Suppose, I want to use a Cryptographically strong random number generator for simulating random moves of a particle simulation using mote carlo method. I want to run the simulation for, ...
3 votes
4 answers
371 views
Are float pseudo-random number generators always implemented using integer generators underneath
In C it's well known to use simple routine for turning integer rng into float rng. Something like that ...
2 votes
1 answer
407 views
Iterate over a range randomly without any duplicate or storing the full range in memory
I'm trying to create (or find) an algorithm to iterate over a range (e.g.: 1-100, etc) but randomly, without any duplicate values (similar result to random sort, etc) but without actually storing the ...
0 votes
1 answer
60 views
Why are seeds connected in Linear Congruential Generators?
I looked through Java's Random class and saw that the initial seed is created using: ...
1 vote
1 answer
83 views
Are there applications in which random number generation quality is the bottleneck?
Random number generators commonly found in default libraries are actually pseudo-random number generators. Nevertheless, more sophisticated options exist to gather entropy from "truly"-...
1 vote
1 answer
109 views
Generate uniform random vectors
Problem : Consider a random vector $v$ which is uniformly distributed over the sample space $S = \{v \in \mathbb{Z}^{n} : 1^Tv = a , v \ge 0\}$ . How to efficiently generate such random vector ? note :...
1 vote
1 answer
945 views
Why Lavarand (as opposed to other methods of generating random seeds)?
Cloudflare famously uses a wall of lava lamps (https://en.wikipedia.org/wiki/Lavarand) to seed random number generators. But if you're going into the real world to seed your rng, why lava lamps? Why ...
0 votes
1 answer
51 views
Can we simply consider a pseudo random number generator to be a function $f: \Bbb{Z}_n \to \Bbb{Z}_n$ for ever-increasing $n$?
On modern architectures, random number generators get seeded by the current system time as a source of randomness, which is nice because it is kind of unpredictable when a process will switch to the ...
-1 votes
1 answer
94 views
How random is Python's Random Module
Recently i wrote a programme using random module of python. Then i realised that the same output was being repeated quite a number of times though it was supposed to be completely random.
4 votes
0 answers
198 views
Uniformly random decimal numbers
Due to finite precision of number representations, we face situations like: In: 0.1+0.1+0.1==0.3 Out: False (on my ...
1 vote
1 answer
188 views
can a machine generate truly random numbers?
I know that for most programs pseudo-random numbers are sufficient, but there are ways that machines can generate truly random numbers! There are devices that generate unpredictable processes. However,...
0 votes
1 answer
554 views
Making an algorithm that picks a unique random number in fixed set more efficient
I have been working on a project that simulates an online bank. At this point, I'm implementing the code used to create user accounts. Each account will have a sortcode and account number, I have ...
4 votes
2 answers
166 views
If I can efficiently uniformly sample both $A$ and $B\subset A$, can I efficiently uniformly sample $A-B$?
As posed in the question; the statement naively seems like it should be self-evident but there are no algorithms that come immediately to mind. Suppose I have some domain $A$ (in my case a subset of $\...
0 votes
0 answers
85 views
Creating a top-hat distributed random number generator
I have this Fortran code which generates a flat distribution as it produces a single random number centered on 0. The function GRNDM (Geant 4 random number generator) produces equally distributed ...