Fiveable

๐Ÿ“ŠProbability and Statistics Unit 3 Review

QR code for Probability and Statistics practice questions

3.7 Uniform distribution

๐Ÿ“ŠProbability and Statistics
Unit 3 Review

3.7 Uniform distribution

Written by the Fiveable Content Team โ€ข Last updated September 2025
Written by the Fiveable Content Team โ€ข Last updated September 2025
๐Ÿ“ŠProbability and Statistics
Unit & Topic Study Guides

Uniform distribution is a fundamental concept in probability theory, where all outcomes within a range are equally likely. It's characterized by a constant probability density function and can be either continuous or discrete, making it versatile for modeling various scenarios.

This distribution plays a crucial role in probability and statistics. Its simplicity makes it ideal for generating random numbers and modeling equal likelihood events. Understanding uniform distribution is essential for grasping more complex distributions and their applications in real-world problems.

Definition of uniform distribution

  • Uniform distribution is a probability distribution where all outcomes in a given range are equally likely
  • The probability of any event within the range is proportional to the size of the range
  • Uniform distribution can be either continuous or discrete, depending on whether the random variable takes on a continuous range of values or a finite set of values

Probability density function (PDF)

Continuous case

  • For a continuous uniform distribution, the PDF is constant over the interval $[a, b]$ and zero elsewhere
  • The PDF is given by the formula: $f(x) = \frac{1}{b-a}$ for $a \leq x \leq b$, and $f(x) = 0$ otherwise
  • The area under the PDF curve between any two points within the interval $[a, b]$ represents the probability of the random variable taking a value in that range

Discrete case

  • In the discrete case, the PDF is a constant value for each possible outcome in the sample space
  • The PDF for a discrete uniform distribution is given by: $P(X = x) = \frac{1}{n}$ for $x \in {x_1, x_2, \ldots, x_n}$
  • Each possible outcome has an equal probability of occurring, and the sum of all probabilities is equal to 1

Cumulative distribution function (CDF)

Continuous case

  • The CDF for a continuous uniform distribution gives the probability that the random variable $X$ takes a value less than or equal to a given value $x$
  • The CDF is defined as: $F(x) = \int_{a}^{x} \frac{1}{b-a} dt = \frac{x-a}{b-a}$ for $a \leq x \leq b$
  • For values outside the interval $[a, b]$, the CDF is either 0 (for $x < a$) or 1 (for $x > b$)

Discrete case

  • In the discrete case, the CDF is a step function that increases by $\frac{1}{n}$ at each possible outcome
  • The CDF for a discrete uniform distribution is given by: $F(x) = \frac{k}{n}$ for $x_k \leq x < x_{k+1}$, where $k$ is the number of possible outcomes less than or equal to $x$
  • The CDF reaches a value of 1 at the largest possible outcome in the sample space

Mean and variance

Derivation of mean

  • The mean of a continuous uniform distribution can be derived using the formula: $E(X) = \int_{a}^{b} x \cdot \frac{1}{b-a} dx = \frac{a+b}{2}$
  • For a discrete uniform distribution, the mean is given by: $E(X) = \frac{1}{n} \sum_{i=1}^{n} x_i = \frac{x_1 + x_2 + \ldots + x_n}{n}$
  • The mean represents the average value of the random variable over the entire range or sample space

Derivation of variance

  • The variance of a continuous uniform distribution can be derived using the formula: $Var(X) = \int_{a}^{b} (x - \mu)^2 \cdot \frac{1}{b-a} dx = \frac{(b-a)^2}{12}$, where $\mu$ is the mean
  • For a discrete uniform distribution, the variance is given by: $Var(X) = \frac{1}{n} \sum_{i=1}^{n} (x_i - \mu)^2 = \frac{(n^2 - 1)}{12}$
  • The variance measures the average squared deviation of the random variable from its mean

Properties of uniform distribution

Memoryless property

  • The uniform distribution is memoryless, meaning that the probability of an event occurring in the future does not depend on the time that has already elapsed
  • For a continuous uniform distribution, $P(X > s + t | X > s) = P(X > t)$ for all $s, t \geq 0$
  • This property is unique to the exponential and geometric distributions, which are related to the uniform distribution

Maximum entropy property

  • Among all continuous distributions with a given range, the uniform distribution has the maximum entropy
  • Entropy is a measure of the uncertainty or randomness in a probability distribution
  • The maximum entropy property implies that the uniform distribution is the least informative or most uncertain distribution given only the range of possible values

Applications of uniform distribution

Random number generation

  • Uniform distribution is widely used in generating random numbers for various applications, such as simulations and Monte Carlo methods
  • Most programming languages have built-in functions that generate random numbers from a uniform distribution (e.g., rand() in C++, numpy.random.uniform() in Python)
  • These random number generators often serve as building blocks for generating random variables from other distributions

Modeling equal likelihood events

  • Uniform distribution is appropriate for modeling situations where all outcomes within a given range are equally likely
  • Examples include rolling a fair die (discrete uniform) or selecting a random point on a line segment (continuous uniform)
  • In these cases, the uniform distribution provides a simple and intuitive model for the underlying probability structure

Relationship to other distributions

Exponential distribution

  • The exponential distribution is related to the continuous uniform distribution through the memoryless property
  • If $X$ follows an exponential distribution with rate parameter $\lambda$, then $Y = e^{-\lambda X}$ follows a uniform distribution on the interval $[0, 1]$
  • This relationship is exploited in the inverse transform method for generating random variables from an exponential distribution

Beta distribution

  • The beta distribution is a generalization of the continuous uniform distribution, with two shape parameters $\alpha$ and $\beta$
  • When $\alpha = \beta = 1$, the beta distribution reduces to a uniform distribution on the interval $[0, 1]$
  • The beta distribution is more flexible than the uniform distribution and can model a wide range of probability densities on the unit interval

Sampling from uniform distribution

Inverse transform method

  • The inverse transform method is a general technique for generating random variables from a given distribution using uniform random numbers
  • For a continuous uniform distribution on $[a, b]$, the inverse CDF is given by: $F^{-1}(u) = a + (b - a)u$, where $u$ is a uniform random number on $[0, 1]$
  • To generate a random variable $X$ from the uniform distribution, generate $u$ from $U(0, 1)$ and compute $x = F^{-1}(u)$

Rejection sampling method

  • Rejection sampling is another method for generating random variables from a given distribution using uniform random numbers
  • The idea is to generate a point $(x, y)$ uniformly in a region that encloses the graph of the PDF, and accept the point if it lies below the graph
  • For a continuous uniform distribution, rejection sampling is not necessary since the inverse transform method is more efficient

Parameter estimation for uniform distribution

Method of moments

  • The method of moments is a parameter estimation technique that equates sample moments with theoretical moments
  • For a continuous uniform distribution on $[a, b]$, the first two moments are: $E(X) = \frac{a+b}{2}$ and $E(X^2) = \frac{a^2 + ab + b^2}{3}$
  • Solving these equations using the sample mean and sample second moment yields the moment estimators for $a$ and $b$

Maximum likelihood estimation

  • Maximum likelihood estimation (MLE) is a parameter estimation method that finds the parameter values that maximize the likelihood function
  • For a continuous uniform distribution on $[a, b]$, the likelihood function is: $L(a, b) = \prod_{i=1}^{n} \frac{1}{b-a} = (b-a)^{-n}$ for $\min(x_i) \leq a < b \leq \max(x_i)$
  • The MLE for $a$ and $b$ are the minimum and maximum of the observed data, respectively

Hypothesis testing with uniform distribution

Kolmogorov-Smirnov test

  • The Kolmogorov-Smirnov (KS) test is a nonparametric goodness-of-fit test that compares the empirical CDF of the data with the hypothesized CDF
  • For testing if data comes from a uniform distribution on $[a, b]$, the KS test statistic is: $D = \sup_x |F_n(x) - F(x)|$, where $F_n(x)$ is the empirical CDF and $F(x)$ is the uniform CDF
  • The null hypothesis is rejected if the test statistic exceeds a critical value determined by the sample size and significance level

Chi-square goodness-of-fit test

  • The chi-square goodness-of-fit test is another nonparametric test that compares the observed frequencies of data in bins with the expected frequencies under the hypothesized distribution
  • For testing if data comes from a uniform distribution, the range is divided into $k$ bins of equal width, and the expected frequency for each bin is $n/k$, where $n$ is the sample size
  • The test statistic is: $\chi^2 = \sum_{i=1}^{k} \frac{(O_i - E_i)^2}{E_i}$, where $O_i$ and $E_i$ are the observed and expected frequencies for bin $i$
  • The null hypothesis is rejected if the test statistic exceeds a critical value from the chi-square distribution with $k-1$ degrees of freedom

Uniform distribution vs normal distribution

  • Uniform distribution and normal distribution are two fundamentally different probability distributions with distinct properties
  • Uniform distribution has a constant probability density over a finite range, while normal distribution has a bell-shaped density with a peak at the mean
  • Uniform distribution has a finite range and does not extend to infinity, while normal distribution has an infinite range and asymptotically approaches zero in the tails
  • Uniform distribution has a simple closed-form expression for its PDF and CDF, while normal distribution's PDF and CDF involve the error function and cannot be expressed in elementary functions
  • Uniform distribution is used to model situations with equally likely outcomes, while normal distribution arises naturally in many real-world applications due to the central limit theorem

Advantages and disadvantages of uniform distribution

  • Advantages of uniform distribution include its simplicity, ease of interpretation, and mathematical tractability
  • Uniform distribution is useful for modeling situations with equally likely outcomes and serves as a building block for other distributions
  • Disadvantages of uniform distribution include its limited flexibility and inability to model real-world phenomena with non-uniform probability densities
  • Uniform distribution may not be appropriate for modeling data with outliers, skewness, or other deviations from a constant density
  • In practice, other distributions such as normal, exponential, or beta may provide a better fit to the data depending on the underlying process and domain knowledge