# Questions tagged [uniform]

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

594 questions
Filter by
Sorted by
Tagged with
59k views

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.,...
8k 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 ...
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 ...
46k 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 ...
8k 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 ...
12k 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 ...
4k 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 ...
6k 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 ...
27k 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 ...
1k views

### R: Problem with runif: generated number repeats (more often than expected) after less than 100 000 steps

After executing the code RNGkind(kind="Mersenne-Twister") # the default anyway set.seed(123) n = 10^5 x = runif(n) print(x == x) ...
7k 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 ...
22k 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 ...
27k 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 ...
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 ...
2k 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 ...
4k views

### Why is the mean of the natural log of a uniform distribution (between 0 and 1) different from the natural log of 0.5?

For a uniformly distributed variable between 0 and 1 generated using rand(1,10000) this returns 10,000 random numbers between 0 and 1. If you take the mean, it ...
5k views

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 $... 2answers 3k 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 ... 2answers 20k 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 ... 4answers 389 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 ... 4answers 1k views ### Continuous random variables - probability of a kid arriving on time for school A father leaves his home to take his son to school between 6:15 AM and 6:45 AM and it usually takes between 30 and 40 minutes to arrive there. Let$X$and$Y$be independent and random uniformly ... 2answers 479 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)=-\... 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 ... 2answers 9k 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 ... 3answers 16k 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 ... 1answer 33k 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 ... 1answer 680 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... 3answers 908 views ### Generating random points uniformly on a disk [duplicate] I have to randomly generate 1000 points over a unit disk such that are uniformly distributed on this disk. Now, for that, I select a radius r and angular orientation \alpha such that the radius r... 2answers 677 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, ... 3answers 830 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 +... 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)$... 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}... 3answers 3k 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. 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. ... 1answer 3k 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 ... 2answers 10k 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: ... 1answer 11k 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://... 3answers 2k 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 ... 2answers 15k views ### How to uniformly project a hash to a fixed number of buckets Hi Fellow Statisticians, I have a source generating hashes (e.g. computing a string with a timestamp and other information and hashing with md5) and I want to project it into a fixed number of ... 1answer 450 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 ... 3answers 2k 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 ... 1answer 1k 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 ... 2answers 310 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 ... 2answers 342 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. 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 ... 3answers 555 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 ... 4answers 567 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 ... 3answers 9k 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)}...
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 ...