101
votes
Is von Neumann's randomness in sin quote no longer applicable?
If you're using some hardware source of entropy/randomness, you're not "attempting to generate randomness by deterministic means" (my emphasis). If you're not using any hardware source of entropy/...
76
votes
Accepted
Is von Neumann's randomness in sin quote no longer applicable?
Just because you can't see a pattern doesn't mean that no pattern exists. Just because a compression algorithm can't find a pattern doesn't mean that no pattern exists. Compression algorithms are ...

D.W.♦
- 141k
49
votes
Can we generate random numbers using irrational numbers like π and e?
For any reasonable definition of perfect, the mechanism you describe is not a perfect random number generator.
Non-repeating isn't enough. The decimal number $0.101001000100001\dots$ is non-repeating ...
39
votes
Are all pseudo-random number generators ultimately periodic?
All pseudorandom generators that don't rely on outside randomness and use a bounded amount of memory are necessarily ultimately periodic since they have finite state. You can think of them as huge ...
33
votes
Accepted
How does an operating system create entropy for random seeds?
The title and the body of your question ask two different questions: how the OS creates entropy (this should really be obtains entropy), and how it generates pseudo-randomness from this entropy. I'll ...
29
votes
How to simulate a die given a fair coin
What you can do, is to employ a method called rejection sampling:
Flip the coin 3 times and interpret each flip as a bit (0 or 1).
Concatenate the 3 bits, giving a binary number in $[0,7]$.
If the ...
28
votes
Accepted
Simulating a probability of 1 of 2^N with less than N random bits
Wow, great question! Let me try to explain the resolution. It'll take three distinct steps.
The first thing to note is that the entropy is focused more on the average number of bits needed per draw,...

D.W.♦
- 141k
28
votes
Can we generate random numbers using irrational numbers like π and e?
It is cryptographically useless because an adversary can predict every single digit. It is also very time consuming.
21
votes
Why is the Mersenne Twister regarded as good?
The initial Mersenne-Twister (MT) was regarded as good for some years, until it was found out to be pretty bad with the more advanced TestU01 BigCrush tests and better PRNGs.
This page lists the ...
21
votes
Is von Neumann's randomness in sin quote no longer applicable?
I've always understood the quote to mean that a deterministic algorithm has a fixed amount of entropy, and although the output can appear "random" it can't contain more entropy than the inputs provide....
18
votes
Is von Neumann's randomness in sin quote no longer applicable?
Anyone who attempts to generate random numbers by deterministic means is, of course, living in a state of sin.
When you interpret "living in a state of sin" as "doing a nonsense", than it's perfectly ...
18
votes
Accepted
Can we generate random numbers using irrational numbers like π and e?
The most obvious disadvantage is the unnecessary complexity of PRNG algorithms based on irrational numbers. They require much more computations per generated digit than, say, an LCG; and this ...
17
votes
Why is the Mersenne Twister regarded as good?
I am the Editor who accepted the MT paper in ACM TOMS back in 1998 and I am also the designer of TestU01. I do not use MT, but mostly MRG32k3a, MRG31k3p, and LRSR113. To know more about these, about ...
17
votes
Accepted
Problem with the pseudo random number generator One-Time-Pad
You seem to have misunderstood what the key is.
In the context of symmetric encryption, the key is a shared secret: something that is known to both the sender and receiver. For OTP, the key is the ...
16
votes
Accepted
What's a uniform shuffle?
A uniform shuffle of a table $a = [a_0, ..., a_{n-1}]$ is a random permutation of its elements that makes every rearrangement equally probable. To put it in another way: there are $n!$ possible ...
15
votes
Is von Neumann's randomness in sin quote no longer applicable?
I thought I'd chime in on the meaning of "random". Most answers here are talking about the output of random processes, compared to the output of deterministic processes. That's a perfectly good ...
12
votes
Accepted
How to simulate a die given a fair coin
To have a slightly more efficient method than the one pointed out by @FrankW but using the same idea, you can flip your coin $n$ times to get a number below $2^n$. Then interpret this as a batch of $m$...
12
votes
Accepted
Is it possible to simulate a fair coin with a finite number of tossing of a biased one?
No, it's not possible. Suppose the bias of the coin is $1/3$, and suppose you could guarantee termination. Then there would be some $n$ such that this always terminates after $n$ coin flips. Let $S$...

D.W.♦
- 141k
11
votes
Problem with the pseudo random number generator One-Time-Pad
Now to make a more efficient One-Time-Pad you'd use a pseudo-random number generator
No, no and once again no. I'm concerned that this is what you're being taught. The absolutely fundamental ...
10
votes
Accepted
How best to statistically verify random numbers?
You can't. Randomness is a property of the source, not a property of the values you get from that source. In other words, randomness is a statement about the probability distribution, not about some ...

D.W.♦
- 141k
9
votes
Accepted
Returning a random subset with length k of N strings while only storing at most k of them
Use reservoir sampling. This is a good description in Wikipedia, or in Knuth.
Let's start with the simple case, where $k=1$. You always have one string in memory. When you read the first string, ...

D.W.♦
- 141k
9
votes
Uniform sampling from a simplex
This is to add to the existing answers.
Devroye is an excellent reference for questions of this sort. Chap.7 gives the algorithms needed to generate uniform order statistics, which the OP is after.
...
9
votes
Why do we care about random Boolean SAT formula?
If your solver is efficient for random 3-SAT, it by no means entails that it is efficient for an arbitrary 3-SAT instance. Randomly generated instances are very different from instances that arise in ...
9
votes
Accepted
Why is randomness a problem? (i.e. why do we care about derandomization?)
Complexity theory is a mathematical theory which aims at addressing one shortcoming of computability theory, namely, it takes into account the use of resources. While it is true that in its early days ...
9
votes
Accepted
What makes a pseudorandom generator, a high quality one?
There are several criteria for the quality of a PRNG:
How fast it is. This includes how fast it is to setup it, and how fast it is to produce a single bit (amortized).
How difficult it is to guess ...
8
votes
Accepted
Can someone explain LazySelect?
$\DeclareMathOperator{\rank}{rank}$Given a set $S$ of $n = 2k$ elements, the algorithm is aimed at finding the median of $S$ in linear time, with high probability. The idea is to find two elements $a,...
8
votes
Accepted
Why is the Mersenne Twister regarded as good?
A recent paper by Vigna starts with an explanation of the history of Mersenne-Twister (MT), and why it has prevailed so far.
The original paper about the Mersenne Twister was published by Makoto ...
8
votes
Accepted
Time complexity of this while loop
Worst case, if the second call to rand() returns 0 and the first call doesn't, you get a floating point division by zero, and if you are using standard IEEE 754 arithmetic, the result is +infinity. In ...
8
votes
Shuffling a list while keeping order relative to related elements
Your problem can be phrased as generating a random linear extension of a partial order. The partial order in your phrase is generated by your constraints. There is a classical algorithm of Matthews ...
7
votes
Are all pseudo-random number generators ultimately periodic?
PRNGs are state-machines. If they're based only in internal input (in contrast to Poker Stars RNG which is a combination of hardware and software, seeding itself continuously from... sound samples) ...
Only top scored, non community-wiki answers of a minimum length are eligible
Related Tags
randomness × 243algorithms × 72
randomized-algorithms × 43
pseudo-random-generators × 33
sampling × 32
random-number-generator × 23
complexity-theory × 22
probability-theory × 21
graphs × 16
cryptography × 14
entropy × 11
information-theory × 10
computability × 9
reference-request × 9
probabilistic-algorithms × 9
algorithm-analysis × 8
permutations × 8
complexity-classes × 7
statistics × 7
kolmogorov-complexity × 7
turing-machines × 6
data-compression × 6
terminology × 5
proof-techniques × 5
data-structures × 4