Maths Formulae Statistics Uniforn Distribution

Uniform Distribution – Equal Likelihood Events

Learn about the uniform distribution where all outcomes are equally likely. Includes continuous and discrete forms.
🔑

Definition

The Uniform Distribution is a probability distribution where all outcomes in an interval \([a, b]\) are equally likely. It is also called the rectangular distribution because its probability density function forms a rectangle.

It represents perfect randomness where all outcomes within a specified range are equally likely, serving as a cornerstone for random number generation and modeling fair processes.

\[ f(x) = \begin{cases} \frac{1}{b-a} & \text{if } a \leq x \leq b \\ 0 & \text{otherwise} \end{cases} \]
Probability Density Function (PDF)
SymbolDescription
\(X \sim U(a,b)\)A random variable X follows a uniform distribution on the interval [a, b].
\(a, b\)Parameters representing the lower and upper bounds of the distribution.
\(f(x)\)The Probability Density Function, which is constant over [a, b].
\(F(x)\)The Cumulative Distribution Function, representing \(P(X \leq x)\).
\(\mu\)The mean or expected value of the distribution.
\(\sigma^2\)The variance of the distribution.
📊

Key Formulas

\[ f(x) = \begin{cases} \frac{1}{b-a} & \text{if } a \leq x \leq b \\ 0 & \text{otherwise} \end{cases} \]
Continuous Probability Density Function (PDF)
\[ F(x) = P(X \leq x) = \begin{cases} 0 & \text{if } x < a \\ \frac{x-a}{b-a} & \text{if } a \leq x \leq b \\ 1 & \text{if } x > b \end{cases} \]
Continuous Cumulative Distribution Function (CDF)
\[ \text{Mean: } E[X] = \mu = \frac{a + b}{2} \]
Mean (Expected Value)
\[ \text{Variance: } \text{Var}(X) = \sigma^2 = \frac{(b - a)^2}{12} \]
Variance
\[ P(X = k) = \frac{1}{n} \text{ for } k = 1, 2, 3, \ldots, n \]
Discrete Probability Mass Function (PMF)
🖼️

Diagram

a b 1/(b−a) μ=(a+b)/2 f(x) = 1/(b−a) for a ≤ x ≤ b
Uniform Distribution: equal probability everywhere in [a,b] — the "flat" distribution with f(x) = 1/(b−a)

The diagram of a continuous uniform distribution's probability density function (PDF) is a simple rectangle. The base of the rectangle lies on the x-axis and extends from the lower bound, \(a\), to the upper bound, \(b\). The height of the rectangle is constant at \(1/(b-a)\). The area of this rectangle is its width (b-a) times its height (1/(b-a)), which equals 1, as required for any PDF.

⚖️

Properties

Constant Probability Density: The PDF is a constant value \(1/(b-a)\) for all outcomes within the interval \([a, b]\) and zero everywhere else. This gives it a characteristic rectangular shape.

Symmetry: The distribution is symmetric about its mean. The mean is the midpoint of the interval, \((a+b)/2\).

\[ \text{Skewness: } \gamma_1 = 0 \]
Perfectly Symmetric

Maximum Entropy: Among all continuous distributions defined on a finite interval \([a, b]\), the uniform distribution has the highest entropy, meaning it represents the greatest uncertainty or lack of bias.

\[ \int_{-\infty}^{\infty} f(x) \, dx = \int_{a}^{b} \frac{1}{b-a} \, dx = 1 \]
Total Probability is 1
🔬

Proof of the Mean

The mean (or expected value) \(E[X]\) of a continuous random variable is found by integrating the product of the variable \(x\) and its probability density function \(f(x)\) over its entire range.

\[ E[X] = \int_{-\infty}^{\infty} x f(x) \, dx \]
Definition of Expected Value

For the uniform distribution \(U(a,b)\), the PDF \(f(x)\) is \(1/(b-a)\) inside the interval \([a, b]\) and 0 outside. Therefore, the integral is only non-zero over this interval.

\[ E[X] = \int_{a}^{b} x \cdot \frac{1}{b-a} \, dx \]

We can pull the constant term \(1/(b-a)\) out of the integral and evaluate the integral of \(x\).

\[ E[X] = \frac{1}{b-a} \left[ \frac{x^2}{2} \right]_{a}^{b} \]

Now, substitute the bounds of the integral.

\[ E[X] = \frac{1}{b-a} \left( \frac{b^2}{2} - \frac{a^2}{2} \right) = \frac{b^2 - a^2}{2(b-a)} \]

Using the difference of squares factorization, \(b^2 - a^2 = (b-a)(b+a)\), we can simplify the expression.

\[ E[X] = \frac{(b-a)(b+a)}{2(b-a)} = \frac{a+b}{2} \]
Final Result for the Mean
🧮

Worked Example

A continuous random variable \(X\) follows a uniform distribution on the interval [5, 20]. Find the probability density function \(f(x)\), the mean \(\mu\), the variance \(\sigma^2\), and the probability \(P(8 < X < 15)\).
  1. Identify the parameters: \(a = 5\) and \(b = 20\).
  2. Calculate the probability density function: \(f(x) = \frac{1}{b-a} = \frac{1}{20-5} = \frac{1}{15}\) for \(5 \le x \le 20\).
  3. Calculate the mean: \(\mu = \frac{a+b}{2} = \frac{5+20}{2} = \frac{25}{2} = 12.5\).
  4. Calculate the variance: \(\sigma^2 = \frac{(b-a)^2}{12} = \frac{(20-5)^2}{12} = \frac{15^2}{12} = \frac{225}{12} = 18.75\).
  5. Calculate the probability \(P(8 < X < 15)\) using the formula \(\frac{d-c}{b-a}\): \(P(8 < X < 15) = \frac{15-8}{20-5} = \frac{7}{15} \approx 0.467\).
The PDF is \(f(x) = 1/15\) for \(x \in [5, 20]\), the mean is 12.5, the variance is 18.75, and \(P(8 < X < 15) = 7/15\).
🧮

Try It

🚀

Applications

Computer Science & Simulations: The uniform distribution is the foundation for most random number generators. It is used in Monte Carlo simulations, randomized algorithms, cryptography, and for generating random variables from other, more complex distributions via the inverse transform method.

Quality Control: In manufacturing, if a machine produces components with a tolerance between a minimum and maximum value, and any value in that range is equally likely, the uniform distribution can model the variation.

Statistics and Machine Learning: It is often used as a non-informative prior in Bayesian statistics, representing a state of no prior knowledge about a parameter's value within a given range. It's also used in sampling techniques like bootstrap resampling.

Physics and Engineering: Used to model events where the exact timing or position is unknown but bounded, such as the position of a particle in a box in quantum mechanics or random arrival times in queuing theory.

🌍

Real-World Examples

A city bus is scheduled to arrive at a stop at 10:00 AM, but it can arrive any time uniformly between 9:58 AM and 10:04 AM. What is the probability that a passenger arriving at 9:59 AM will have to wait less than 2 minutes?
  1. Define the interval in minutes, with 9:58 AM as time 0. The interval is from 0 to 6 minutes. So, \(a=0, b=6\).
  2. The passenger arrives at time 1 (9:59 AM). Waiting less than 2 minutes means the bus must arrive between time 1 and time 3.
  3. Calculate the probability using the formula \(P(c \leq X \leq d) = \frac{d-c}{b-a}\).
  4. \(P(1 \leq X \leq 3) = \frac{3-1}{6-0} = \frac{2}{6} = \frac{1}{3}\).
The probability that the passenger will wait less than 2 minutes is 1/3, or approximately 33.3%.
A coffee machine dispenses a random amount of coffee uniformly between 150 ml and 200 ml. What is the probability that the machine dispenses more than 190 ml?
  1. Identify the interval bounds: \(a = 150\) ml and \(b = 200\) ml.
  2. We want to find the probability that the amount is between 190 ml and 200 ml, i.e., \(P(190 < X \leq 200)\).
  3. Calculate the probability: \(P(190 < X \leq 200) = \frac{200 - 190}{200 - 150} = \frac{10}{50} = \frac{1}{5}\).
The probability that the machine dispenses more than 190 ml is 1/5, or 20%.
🏙️

Real-World Scenarios

1 2 3 4 5 6 1/6 Fair Die Outcomes Each face: P = 1/6 = 16.7%
Dice & Board Games
A fair die is the classic discrete uniform distribution — each of the six outcomes is equally likely with probability 1/6, the foundation of game probability.
a b 1/(b−a) Continuous Uniform PDF Random number in [a,b]
Random Number Generation
Computers generate uniform random numbers in [0,1] as a building block for simulations. Every value in the interval is equally likely — the continuous uniform distribution.
0 30 min uniform wait BUS Bus Arrives Every 30 min E[wait] = 15 min
Bus Wait Times
If a bus runs every 30 minutes and you arrive at a random time, your wait is uniform on [0, 30] — expected wait = 15 minutes, the key result for transit planning.

Lottery Drawings: In a fair lottery where numbered balls are mixed in a machine, each ball has an equal chance of being selected. The selection of the first ball can be modeled by a discrete uniform distribution.

Digital Sampling: When an analog signal is digitized, the quantization error (the difference between the true analog value and the discrete digital value) is often modeled as having a uniform distribution over the range of one quantization step.

Waiting for a Train: If a train runs every 30 minutes and you arrive at the station at a random time without knowing the schedule, your waiting time is uniformly distributed between 0 and 30 minutes.

📂

Types and Classification

The uniform distribution is primarily classified into two types: continuous and discrete.

FeatureContinuous Uniform DistributionDiscrete Uniform Distribution
OutcomesAny real number in an interval \([a, b]\)A finite set of integers, e.g., \({1, 2, ..., n}\)
FunctionProbability Density Function (PDF)Probability Mass Function (PMF)
Formula\(f(x) = 1/(b-a)\)\(P(X=k) = 1/n\)
ExampleRandom number generator between 0 and 1Rolling a fair six-sided die

Special Case: The Standard Uniform Distribution is the continuous uniform distribution with parameters \(a=0\) and \(b=1\), denoted \(U(0,1)\). It is fundamental because random variates from any other continuous distribution can be generated using the inverse transform sampling method applied to a standard uniform random variable.

⚠️

Common Mistakes

⚠️ Forgetting the PDF is zero outside the interval. When calculating probabilities or expected values, always remember to use the bounds [a, b]. The probability of an event entirely outside this range is 0.
⚠️ Calculating a non-zero probability for a single point. For any continuous distribution, including the uniform, the probability of the variable taking on a specific single value is always zero, i.e., P(X = c) = 0. Probability is only defined over intervals.
⚠️ Confusing discrete and continuous variance formulas. The variance for a continuous uniform distribution is \((b-a)^2/12\), while for a discrete uniform distribution on integers from 1 to n, it is \((n^2-1)/12\). The formulas are similar but distinct.
🚀

Study Strategy

1 🧠 Grasp the Fundamentals
  • Internalize that every outcome in the interval [a, b] is equally likely, hence the name 'uniform'.
  • Study the rectangular shape of the Probability Density Function (PDF) diagram to visualize the constant probability.
  • Review the key properties, focusing on how the height of the PDF is the reciprocal of the interval length (1/(b-a)).
  • Distinguish between the continuous uniform distribution (over an interval) and the discrete uniform distribution (over a set of integers).
2 ✍️ Commit Formulas to Memory
  • Write out the Probability Density Function (PDF) formula, f(x) = 1/(b-a), ten times to build muscle memory.
  • Memorize the formulas for the Mean (μ = (a+b)/2) and the Variance (σ² = (b-a)²/12).
  • Practice calculating the probability for a sub-interval P(c ≤ X ≤ d) using the formula (d-c)/(b-a).
  • Use flashcards to drill the four key formulas: PDF, Mean, Variance, and Cumulative Distribution Function (CDF).
3 🏋️ Solve Guided Problems
  • Follow the provided 'Worked Example' step-by-step, ensuring you can replicate the calculations for P(X < c) and P(X > d).
  • Find practice problems that give you the mean and variance and require you to solve for the interval endpoints 'a' and 'b'.
  • Work through exercises that involve finding the probability of a value falling within a specific range inside the main interval.
  • Check your answers against the 'Common Mistakes' section, especially regarding boundary conditions and interval calculations.
4 🌍 Connect to Real-World Applications
  • For each 'Real-World Scenario' like bus arrival times, identify the values for 'a' and 'b' and formulate a probability question.
  • Model a simple real-world event, such as the random minute a computer program's background task will start (e.g., between 0 and 59).
  • Analyze the 'Applications' section and explain how a random number generator relies on the principles of uniform distribution.
  • Create your own problem based on a real-world interest, like the time it takes for a coffee machine to brew, and solve it.
By systematically building from concepts to calculations and finally to real-world applications, you will achieve a deep and practical mastery of the Uniform Distribution.

Frequently Asked Questions

×

×