Questions tagged [uniform]

The uniform distribution describes a random variable that is equally likely to take any value in its sample space.

Filter by
Sorted by
Tagged with
114
votes
6answers
49k views

Why are p-values uniformly distributed under the null hypothesis?

Recently, I have found in a paper by Klammer, et al. a statement that p-values should be uniformly distributed. I believe the authors, but cannot understand why it is so. Klammer, A. A., Park, C. Y.,...
42
votes
5answers
4k views

Fake uniform random numbers: More evenly distributed than true uniform data

I'm looking for a way to generate random numbers that appear to be uniform distributed -- and every test will show them to be uniform -- except that they are more evenly distributed than true uniform ...
40
votes
3answers
6k views

Consider the sum of $n$ uniform distributions on $[0,1]$, or $Z_n$. Why does the cusp in the PDF of $Z_n$ disappear for $n \geq 3$?

I've been wondering about this one for a while; I find it a little weird how abruptly it happens. Basically, why do we need just three uniforms for $Z_n$ to smooth out like it does? And why does the ...
35
votes
11answers
7k views

Why is generating 8 random bits uniform on (0, 255)?

I am generating 8 random bits (either a 0 or a 1) and concatenating them together to form an 8-bit number. A simple Python simulation yields a uniform distribution on the discrete set [0, 255]. I am ...
30
votes
8answers
5k views

Is there a plateau-shaped distribution?

I am looking for a distribution where the probability density decreases quickly after some point away from the mean, or in my own words a "plateau-shaped distribution". Something in between the ...
30
votes
6answers
39k views

Why is Entropy maximised when the probability distribution is uniform?

I know that entropy is the measure of randomness of a process/variable and it can be defined as follows. for a random variable $X \in$ set $A$ :- $H(X)= \sum_{x_i \in A} -p(x_i) \log (p(x_i)) $. In ...
29
votes
6answers
6k views

How can I test the fairness of a d20?

How can I test the fairness of a twenty sided die (d20)? Obviously I would be comparing the distribution of values against a uniform distribution. I vaguely remember using a Chi-square test in ...
29
votes
4answers
19k views

How does one measure the non-uniformity of a distribution?

I'm trying to come up with a metric for measuring non-uniformity of a distribution for an experiment I'm running. I have a random variable that should be uniformly distributed in most cases, and I'd ...
28
votes
3answers
24k views

Are there default functions for discrete uniform distributions in R?

Most standard distributions in R have a family of commands - pdf/pmf, cdf/cmf, quantile, random deviates (for example- dnorm, pnorm, qnorm, rnorm). I know it's easy enough to make use of some ...
28
votes
5answers
8k views

Is there an explanation for why there are so many natural phenomena that follow normal distribution?

I think this is a fascinating topic and I do not fully understand it. What law of physics makes so that so many natural phenomena have normal distribution? It would seem more intuitive that they would ...
28
votes
3answers
3k views

Brain-teaser: What is the expected length of an iid sequence that is monotonically increasing when drawn from a uniform [0,1] distribution?

This is an interview question for a quantitative analyst position, reported here. Suppose we are drawing from a uniform $[0,1]$ distribution and the draws are iid, what is the expected length of a ...
22
votes
6answers
4k views

Are differences between uniformly distributed numbers uniformly distributed?

We roll a 6-sided die a large number of times. Calculating the difference (absolute value) between a roll and its preceding roll, are the differences expected to be uniformly distributed? To ...
20
votes
3answers
1k views

Distribution of the largest fragment of a broken stick (spacings)

Let a stick of length 1 be broken in $k+1$ fragments uniformly at random. What is the distribution of the length of the longest fragment? More formally, let $(U_1, \ldots U_k)$ be IID $U(0,1)$, and ...
19
votes
2answers
20k views

From uniform distribution to exponential distribution and vice-versa

This is probably a trivial question, but my search has been fruitless so far, including this wikipedia article, and the "Compendium of Distributions" document. If $X$ has a uniform distribution, does ...
19
votes
3answers
3k views

How is $\theta$, the polar coordinate, distributed when $(x,y) \sim U(-1,1) \times U(-1,1)$ and when $(x,y) \sim N(0,1)\times N(0,1)$?

Let the Cartesian $x,y$ coordinates of a random point be selected s.t. $(x,y) \sim U(-10,10) \times U(-10,10)$. Thus, the radius, $\rho = \sqrt{x^2 + y^2}$, isn't uniformly distributed as implied by $...
18
votes
2answers
2k views

Uniform random variable as sum of two random variables

Taken from Grimmet and Stirzaker: Show that it cannot be the case that $U=X+Y$ where $U$ is uniformly distributed on [0,1] and $X$ and $Y$ are independent and identically distributed. You should not ...
17
votes
2answers
431 views

What's the distribution of $(a-d)^2+4bc$, where $a,b,c,d$ are uniform distributions?

I have four independent uniformly distributed variables $a,b,c,d$, each in $[0,1]$. I want to calculate the distribution of $(a-d)^2+4bc$. I computed the distribution of $u_2=4bc$ to be $$f_2(u_2)=-\...
17
votes
4answers
299 views

Draw integers independently & uniformly at random from 1 to $N$ using fair d6?

I wish to draw integers from 1 to some specific $N$ by rolling some number of fair six-sided dice (d6). A good answer will explain why its method produces uniform and independent integers. As an ...
17
votes
2answers
16k views

Why is the CDF of a sample uniformly distributed

I read here that given a sample $ X_1,X_2,...,X_n $ from a continuous distribution with cdf $ F_X $, the sample corresponding to $ U_i = F_X(X_i) $ follows a standard uniform distribution. I have ...
16
votes
1answer
31k views

Generating random samples from a custom distribution

I am trying to generate random samples from a custom pdf using R. My pdf is: $$f_{X}(x) = \frac{3}{2} (1-x^2), 0 \le x \le 1$$ I generated uniform samples and then tried to transform it to my custom ...
16
votes
1answer
501 views

Maximum gap between samples drawn without replacement from a discrete uniform distribution

This problem is related to my lab's research in robotic coverage: Randomly draw $n$ numbers from the set $\{1,2,\ldots,m\}$ without replacement, and sort the numbers in ascending order. $1\le n\le m$...
15
votes
2answers
7k views

Simulating draws from a Uniform Distribution using draws from a Normal Distribution

I recently purchased a data science interview resource in which one of the probability questions was as follows: Given draws from a normal distribution with known parameters, how can you simulate ...
15
votes
1answer
1k views

Non-uniform distribution of p-values when simulating binomial tests under the null hypothesis

I heard that under the null hypothesis the p-value distribution should be uniform. However, simulations of binomial test in MATLAB return very different-from-uniform distributions with mean larger ...
15
votes
1answer
3k views

Advantages of Box-Muller over inverse CDF method for simulating Normal distribution?

In order to simulate a normal distribution from a set of uniform variables, there are several techniques: The Box-Muller algorithm, in which one samples two independent uniform variates on $(0,1)$ ...
15
votes
2answers
4k views

Generate three correlated uniformly-distributed random variables

Suppose we have $$X_1 \sim \textrm{unif}(n,0,1),$$ $$X_2 \sim \textrm{unif}(n,0,1),$$ where $\textrm{unif}(n,0,1)$ is uniform random sample of size n, and $$Y=X_1,$$ $$Z = 0.4 X_1 + \sqrt{1 - 0.4}...
14
votes
2answers
642 views

Why is the distribution of rand()^2 different than of rand()*rand()?

In Libre Office Calc, the rand() function is available, which chooses a random value between 0 and 1 from a uniform distribution. I'm a bit rusty on my probability, ...
14
votes
3answers
754 views

Why does the number of continuous uniform variables on (0,1) needed for their sum to exceed one have mean $e$?

Let us sum a stream of random variables, $X_i \overset{iid}\sim \mathcal{U}(0,1)$; let $Y$ be the number of terms we need for the total to exceed one, i.e. $Y$ is the smallest number such that $$X_1 +...
14
votes
3answers
14k views

Generate pairs of random numbers uniformly distributed and correlated

I would like to generate pairs of random numbers with certain correlation. However, the usual approach of using a linear combination of two normal variables is not valid here, because a linear ...
13
votes
3answers
2k views

How to test uniformity in several dimensions?

Testing for uniformity is something common, however I wonder what are the methods to do it for a multidimensional cloud of points.
13
votes
2answers
2k views

Discrete uniform random variable(?) taking all rational values in a closed interval

I just had an (intellectual) panic attack. A continuous random variable that follows a uniform in a closed interval $U(a,b)$: a comfortably familiar statistical concept. A continuous uniform r.v. ...
12
votes
1answer
2k views

Jointly Complete Sufficient Statistics: Uniform(a, b)

Let $\mathbf{X}= (x_1, x_2, \dots x_n)$ be a random sample from the uniform distribution on $(a,b)$, where $a < b$. Let $Y_1$ and $Y_n$ be the largest and smallest order statistics. Show that ...
12
votes
1answer
311 views

How to sample uniformly from the surface of a hyper-ellipsoid (constant Mahalanobis distance)?

In a real-valued multivariate case, is there a way to uniformly sample the points from the surface where the Mahalanobis distance from the mean of the is a constant? EDIT: This just boils down to ...
11
votes
2answers
8k views

Why doesn't runif generate the same result every time?

Why is it that random number generators like runif() in R don't generate the same result every time? For example: ...
11
votes
3answers
1k views

What is the ratio of uniform and normal distribution?

Let $X$ follow a uniform distribution and $Y$ follow a normal distribution. What can be said about $\frac X Y$? Is there a distribution for it? I found the ratio of two normals with mean zero is ...
11
votes
3answers
1k views

Conditional probability of continuous variable

Suppose that random variable $U$ follows a continuous Uniform distribution with parameters 0 and 10 (i.e. $U \sim \rm{U}(0,10)$ ) Now let's denote A the event that $U$ = 5 and B the event that $...
11
votes
2answers
262 views

Tail bounds on Euclidean norm for uniform distribution on $\{-n,-(n-1),…,n-1,n\}^d$

What are known upper bounds on how often the Euclidean norm of a uniformly chosen element of $\:\{-n,~-(n-1),~...,~n-1,~n\}^d\:$ will be larger than a given threshold? I'm mainly interested in bounds ...
10
votes
2answers
308 views

Distribution of continuous uniform RV with upper limit being another continuous uniform RV

If $X \sim U(a, b)$ and $Y \sim U(a, X)$, then can I say that $Y \sim U(a, b)?$ I am talking about continuous uniform distributions with limits $[a, b]$. A proof (or disproof!) will be appreciated.
10
votes
1answer
885 views

Measure the uniformity of a distribution over weekdays

I have a similar problem to the question asked here: How does one measure the non-uniformity of a distribution? I have a set of probability distributions over the days of the week. I want to measure ...
10
votes
4answers
519 views

Given n uniformly distributed r.v's, what is the PDF for one r.v. divided by the sum of all n r.v's?

I'm interested in the following type of case: there are 'n' continuous random variables which must sum to 1. What then would be the PDF for any one individual such variable? So, if $n=3$, then I am ...
9
votes
5answers
3k views

Why is the sum of probabilities in a continuous uniform distribution not infinity?

The probability density function of a uniform distribution (continuous) is shown above. The area under the curve is 1 - which makes sense since the sum of all the probabilities in a probability ...
9
votes
1answer
8k views

What does log-uniformly distribution mean?

When someone say a data is sampled from a log-uniformly distribution between 128 and 4000, what does that mean? How that different to sampling from a uniformly distribution? See this paper: http://...
9
votes
2answers
5k views

How to find the expected distance between two uniformly distributed points?

If I were to define the coordinates $(X_{1},Y_{1})$ and $(X_{2},Y_{2})$ where $$X_{1},X_{2} \sim \text{Unif}(0,30)\text{ and }Y_{1},Y_{2} \sim \text{Unif}(0,40).$$ How would I find the expected ...
9
votes
1answer
3k views

What is the benefit of using permutation tests?

When testing some null versus alternative hypotheses by a test statistic $U(X)$, where $X = \{ x_i, ..., x_n\}$, apply the permutation test with the set $G$ of permutations on $X$ and we have a new ...
9
votes
2answers
3k views

Expectation of square root of sum of independent squared uniform random variables

Let $X_1,\dots,X_n \sim U(0,1)$ be independent and identicallly distributed standard uniform random variables. $$\text{Let }\quad Y_n=\sum_i^nX_i^2 \quad \quad \text{I seek: } \quad \mathbb{E}\big[\...
9
votes
3answers
440 views

Distribution of $\sqrt{X^2+Y^2}$ when $X,Y$ are independent $U(0,1)$ variables

As a routine exercise, I am trying to find the distribution of $\sqrt{X^2+Y^2}$ where $X$ and $Y$ are independent $ U(0,1)$ random variables. The joint density of $(X,Y)$ is $$f_{X,Y}(x,y)=\mathbf ...
9
votes
1answer
242 views

How to compute $\mathbb P( 3 X_{(1)} \geq X_{(2)}+X_{(3)})$ for order statistics of a uniform distribution?

I am trying to solve a problem for my thesis and I don't see how to do it. I have 4 observations randomly taken from a uniform $(0,1)$ distribution. I want to compute the probability that $3 X_{(1)}\...
9
votes
1answer
705 views

Generate random numbers from “sloped uniform distribution” from mathematical theory

For some purpose, I need to generate random numbers (data) from "sloped uniform" distribution. The "slope" of this distribution may vary in some reasonable interval, and then my distribution should ...
9
votes
1answer
389 views

Estimated distribution of eigenvalues for i.i.d. (uniform or normal) data

Assuming I have a data set with $d$ dimensions (e.g. $d=20$) so that each dimension is i.i.d. $X_i \sim U[0;1]$ (alternatively, each dimension $X_i \sim \mathcal N[0;1]$) and independent of each other....
9
votes
1answer
143 views

Easier way to find $\mathbb{E}\left[X_{(2)}| X_{(1)}, X_{(3)}\right]$?

Consider 3 iid samples drawn from the uniform distribution $u(\theta, 2\theta)$, where $\theta$ is parameter. I want to find $$ \mathbb{E}\left[X_{(2)}| X_{(1)}, X_{(3)}\right] $$ where $X_{(i)}$ ...
9
votes
3answers
7k views

Estimating the parameter of a uniform distribution: improper prior?

We have N samples, $X_i$, from a uniform distribution $[0,\theta]$ where $\theta$ is unknown. Estimate $\theta$ from the data. So, Bayes' rule... $f(\theta | {X_i}) = \frac{f({X_i}|\theta)f(\theta)}...