Articles of random

How to find a random number between $x$ and $y$

Given some random number function rand, and some numbers $x$ and $y$, how do you find a random number $r$ such that $r\geq x \wedge r \leq y$? Previously i’ve tried (and somewhat failed) with formulas like $$ r = \text{rand()}\bmod \frac{x}{y} $$ or $$ r = \text{rand()}\bmod x + 1 $$ or, given that […]

Is there a statistical measure of bitwise entropy?

(Somewhat inspired by this website, particularly Section III. Also, I might be using a different definition of entropy than usual; what I am using is closest to the physics definition (the one I encountered first) of the amount of disorder in a system.) Consider the following two “random” 256-bit strings: 1110001011010010101000001111001100001100011111000111011011101000000000000001111110010110010100011101010010111110000010010101001001101100111110011000000110111111000111101111000011010100001001100010010010011000000011101110000000110001101100000110111001100011 …created via RNG, and: […]

Is $a+r \cdot b$ an uniformly random value when $a,b$ are fixed and $r$ is random value?

Imagine we have two fixed values $a,b \in \mathbb{Z}_p$ and a uniformly random value $r\leftarrow \mathbb{Z}_p$, for large prime number $p$. Question: Is $v=a+b\cdot r$ an uniformly random value in $\mathbb{Z}_p$?

Pick the highest of two (or $n$) independent uniformly distributed random numbers – average value?

With “random number” I mean an independent uniformly distributed random number. One Picking one random number is easy: When I pick a random number from $x$ to $y$, the average value is $(x+y)/2$. Two I’m no maths expert, nevertheless I was able to work out a solution for whole numbers: When I pick the highest […]

gap test for random numbers

I’m in process of learning ‘gap test’ for random numbers in discrete event system simulation. I happened to have the fourth edition of this book by Jerry Banks. Unfortunately , this edition doesn’t have any info about this test. I’m trying to learn more of it from the net but details are very scarce. So, […]

Efficient generation of a von Mises-Fisher distribution

The von Mises-Fisher distribution is a probability distribution on the ($p-1$)-sphere. I’m interested in the efficient generation of this distribution for a relatively high dimension ($1000$ or greater) for application in a search step in a meta-heuristic. ¿Is there a numerical algorithm to efficiently generate such a distribution? I’ll be sampling a lot of vectors, […]

Non-integral-over-a-point proof that the probability of any point in a continuous distribution is zero

My Question For continuous random variables / continuous distributions, it is defined that the probability of any point has probability $0$. The most common proof for this is as follows: $$\Pr(X=a)=\Pr(a\leq X\leq a) = \int_a^af(x) \, dx=0$$ I am looking for a proof other than this. Below I included the definition of a continuous distribution […]

Number of samples to predict the next number in a pseudorandom number generator

Let: $$R_{n+1} = (mR_n + b) \bmod{a} $$ Assume we know the values of $R_1, R_2, \ldots, R_L $. What is the minimum value of $L$ (if it exists) such that we can determine $R_0, m, b$ and $a$?

Distances between randomly distributed points in a ball

Say I have a 3-ball with radius $R$. If I randomly pick 2 points from the inside of the ball, the probability that the euclidean distance between the points (labeled 1 and 2) takes on a particular value $r = r_{12} = r_{21}$ is given by the probability density function (PDF) \begin{equation} P_3 (r) = […]

Probability of ball ownership

$N+M$ people play a game of balls. Initially, N people hold N green balls (each person holds a ball), and M people hold no balls. Assume $M<N$. Then, M red balls are divided randomly – each ball is given to a person selected at random from among all M+N people. Whenever a person that accepts […]