Questions relating to (pseudo)randomness, random oracles, and stochastic processes.
Questions tagged [random]
1890 questions
194
votes
25 answers
Can a coin with an unknown bias be treated as fair?
This morning, I wanted to flip a coin to make a decision but only had an SD card: Given that I don't know the bias of this SD card, would flipping it be considered a "fair toss"? I thought if I'm just as likely to assign an outcome to one side as to…
Andrew Cheong
- 2,525
107
votes
16 answers
What's the difference between stochastic and random?
What's the difference between stochastic and random?
Red Banana
- 25,024
- 22
- 104
- 211
81
votes
3 answers
Mathematicians shocked(?) to find pattern in prime numbers
There is an interesting recent article " Mathematicians shocked to find pattern in "random" prime numbers " in New Scientist . (Don't you love math titles in the popular press? Compare to the source paper's Unexpected Biases in the Distribution of…
Tito Piezas III
- 61,356
66
votes
5 answers
Picking random points in the volume of sphere with uniform probability
I have a sphere of radius $R_{s}$, and I would like to pick random points in its volume with uniform probability. How can I do so while preventing any sort of clustering around poles or the center of the sphere? Since I'm unable to answer my own…
MHK
- 663
56
votes
5 answers
How to find a random axis or unit vector in 3D?
I would like to generate a random axis or unit vector in 3D . In 2D it would be easy, I could just pick an angle between 0 and 2*Pi and use the unit vector pointing in that direction. But in 3D I don't know how can I pick a random point on a surface…
hyperknot
- 935
40
votes
3 answers
Making 400k random choices from 400k samples seems to always end up with 63% distinct choices, why?
I have a very simple simulation program, the sequence is: Create an array of 400k elements Use a PRNG to pick an index, and mark the element (repeat 400k times) Count number of marked elements. An element may be picked more than once, but counted as…
Howard
- 503
40
votes
3 answers
Why does this not seem to be random?
I was running a procedure to be like one of those games were people try to guess a number between 1 and 100 where there are 100 people guessing.I then averaged how many different guesses there are. from random import randint def averager(times):…
David Greydanus
- 658
- 6
- 19
38
votes
10 answers
How to mentally flip a coin?
If you've ever played rock-paper-scissors, and you are reading this on math.stackexchange, you probably know that always playing $1$ of the $3$ choices at random (more precisely: uniformly at random and independently of previous choices) guarantees…
Anonymous
- 5,897
38
votes
7 answers
Method of generating random numbers that sum to 100 - is this truly random?
I am writing a computer program that involves generating 4 random numbers, a, b, c, and d, the sum of which should equal 100. Here is the method I first came up with to achieve that goal, in pseudocode: Generate a random number out of 100. (Let's…
ajq88
- 483
37
votes
8 answers
Generate a random direction within a cone
I have a normalized $3D$ vector giving a direction and an angle that forms a cone around it, something like this: I'd like to generate a random, uniformly distributed normalized vector for a direction within that cone. I would also like to support…
Trillian
- 631
37
votes
7 answers
Are primes randomly distributed?
There is a famous citation that says "It is evident that the primes are randomly distributed but, unfortunately, we don't know what 'random' means." R. C. Vaughan (February 1990) I have this very clear but rather broad question that might be…
al-Hwarizmi
- 4,420
- 2
- 21
- 36
37
votes
4 answers
uniform random point in triangle in 3D
Suppose you have an arbitrary triangle with vertices $A$, $B$, and $C$. This paper (section 4.2) says that you can generate a random point, $P$, uniformly from within triangle $ABC$ by the following convex combination of the vertices: $P = (1 -…
dsg
- 1,491
33
votes
15 answers
Why is the roll of a die considered random?
I've been reading articles on pseudo-randomness in computing when generating a random value. They all state that the generated numbers are pseudo-random because we know all the factors that influence the outcome, and that the roll of a die is…
Max Koretskyi
- 761
33
votes
2 answers
Difference between logarithm of an expectation value and expectation value of a logarithm
Assuming I have a always positive random variable $X$, $X \in \mathbb{R}$, $X > 0$. Then I am now interested in the difference between the following two expectation values: $E \left[ \ln X \right]$ $\ln E \left[ X \right]$ Is one maybe always a…
Matthias
- 613
32
votes
8 answers
Is there a *simple* example showing that uncorrelated random variables need not be independent?
Is there a simple example showing that given $X,Y$ uncorrelated (covariance is zero), $X,Y$ are not independent? I have looked up two references, however, I am dissatisfied with both. In Reference $1$, $X,Y$ are assumed to be independent uniform RVs…
Olórin
- 5,753