Table of Contents
Last modified on December 24th, 2024
The uniform distribution, also called the rectangular distribution, is a type of probability model in which all outcomes within a given interval are equally likely. The variation of a uniform distribution measures how the values are spread out across the interval.
Mathematically, a uniform distribution is defined by two parameters, a and b
Here,
These bounds can either be positive or negative. Based on the nature of the possible outcomes of the random variable, uniform distributions are divided into continuous and discrete.
It represents a continuous random variable X that takes any value within a specified range [a, b] with equal probability. The probability density function (PDF) of this distribution is expressed as:
${f\left( x\right) =\begin{cases}\dfrac{1}{b-a},ifa\leq x\leq b\\ 0,otherwise\end{cases}}$
Let us consider a scenario in which a digital timer is used to start a game. The timer is set to begin at a random time within a 30-minute interval. If the timer’s start time is equally likely to occur at any moment within this interval, the start time X is uniformly distributed between a = 0 and b = 30 minutes. This is an example of positive lower and upper bounds.
The variance of a continuous uniform distribution is obtained using the formula:
Var(X) = ${\dfrac{\left( b-a\right) ^{2}}{12}}$
If X is a random variable, the variance of X (Var(X)) is defined as:
Var(X) = E[X2] – (E[X])2 …..(i)
Here,
E[X] is the expected value (mean) of X
E[X2] is the expected value of X2
Calculating E[X] and E[X2] in the closed interval [a, b], we get
E[X] = ${\int ^{b}_{a}xf\left( x\right) dx}$
= ${\int ^{b}_{a}\dfrac{x}{b-a}dx}$
= ${\left[ \dfrac{x^{2}}{2\left( b-a\right) }\right] _{a}^{b}}$
= ${\dfrac{b^{2}}{2\left( b-a\right) }-\dfrac{a^{2}}{2\left( b-a\right) }}$
= ${\dfrac{b+a}{2}}$ …..(ii)
E[X2]
= ${\int ^{b}_{a}\dfrac{x^{2}}{b-a}dx}$
= ${\left[ \dfrac{x^{3}}{3\left( b-a\right) }\right] _{a}^{b}}$
= ${\dfrac{b^{3}}{3\left( b-a\right) }-\dfrac{a^{3}}{3\left( b-a\right) }}$
= ${\dfrac{b^{2}+ab+a^{2}}{3}}$ …..(iii)
Now, substituting the values of (ii) and (iii) in equation (i), we get
Var(X) = ${\dfrac{b^{2}+ab+a^{2}}{3}-\left( \dfrac{b+a}{2}\right) ^{2}}$
= ${\dfrac{b^{2}+ab+a^{2}}{3}-\dfrac{b^{2}+2ab+a^{2}}{4}}$
= ${\dfrac{b^{2}-2ab+a^{2}}{12}}$
= ${\dfrac{\left( b-a\right) ^{2}}{12}}$
Thus, Var(X) = ${\dfrac{\left( b-a\right) ^{2}}{12}}$
Let us consider a speed camera that monitors vehicles on a stretch of highway where the speed limit is strictly enforced between 5 m/s and 15 m/s. To determine the variance of this uniform distribution, we can follow these steps:
Identifying the Interval
Here, a = 5 (lower bound) and b = 15 (upper bound).
By Using the Formula
Var(X) = ${\dfrac{\left( b-a\right) ^{2}}{12}}$
= ${\dfrac{\left( 15-5\right) ^{2}}{12}}$
= ${\dfrac{\left( 10\right) ^{2}}{12}}$
= ${\dfrac{100}{12}}$
≈ 8.33
Thus, the variance is approximately 8.33
It represents a finite number of outcomes where each outcome within the closed interval [a, b] has a probability equal to:
${f\left( x\right) =\dfrac{1}{n}}$
Here, n = b – a + 1
For example, if a die is rolled, the outcome X can be {1, 2, 3, 4, 5, 6}, each with a probability of ${\dfrac{1}{n}}$ (probability mass function or PMF), which follows a discrete uniform distribution with positive lower and upper bounds.
The variance of a discrete uniform distribution can be obtained using the formula:
Var(X) = ${\dfrac{n^{2}-1}{12}}$
Here, n = b – a + 1
Similar to the continuous uniform distribution, the variance formula for the discrete uniform distribution can also be derived by integrating xf(x) within the interval [a, b]
If X is a random variable, the variance of X (Var(X)) is defined as:
Var(X) = E[X2] – (E[X])2 …..(i)
Here,
E[X] is the expected value (mean) of X
E[X2] is the expected value of X2
Calculating E[X] and E[X2] in the closed interval [a, b], we get
E[X] = ${\sum ^{n}_{i=1}xf\left( x\right)}$
= ${\sum ^{n}_{i=1}\dfrac{x}{n}}$
= ${\dfrac{1}{n}\sum ^{n}_{i=1}x}$
= ${\dfrac{1}{n}\times \dfrac{n\left( n+1\right) }{2}}$
= ${\dfrac{\left( n+1\right) }{2}}$ …..(ii)
E[X2]
= ${\sum ^{n}_{i=1}\dfrac{x^{2}}{n}}$
= ${\dfrac{1}{n}\times \dfrac{n\left( n+1\right) \left( 2n+1\right) }{6}}$
= ${\dfrac{\left( n+1\right) \left( 2n+1\right) }{6}}$ …..(iii)
Now, substituting the values of (ii) and (iii) in equation (i), we get
Var(X) = ${\dfrac{\left( n+1\right) \left( 2n+1\right) }{6}-\left( \dfrac{n+1}{2}\right) ^{2}}$
= ${\dfrac{\left( n+1\right) \left( 2n+1\right) }{6}-\dfrac{\left( n+1\right) ^{2}}{4}}$
= ${\dfrac{2n^{2}+3n+1}{6}-\dfrac{n^{2}+2n+1}{4}}$
= ${\dfrac{2\left( 2n^{2}+3n+1\right) -3\left( n^{2}+2n+1\right) }{12}}$
= ${\dfrac{n^{2}-1}{12}}$
Thus, Var(X) = ${\dfrac{n^{2}-1}{12}}$
Note: When a = 0 and b = 1, the uniform distribution is known as standard uniform distribution. It is used for random number generation with the expected value of ${\dfrac{1}{2}}$ and the variance of ${\dfrac{1}{12}}$
Let us imagine a fair die is rolled, producing outcomes between 1 and 6. Now, we will calculate the variance of this discrete uniform distribution as follows:
Identifying the Interval and Number of Outcomes
Here,
a = 1
b = 6
n = b – a + 1 = 6 – 1 + 1 = 6
By Using the Formula
Var(X) = ${\dfrac{n^{2}-1}{12}}$
= ${\dfrac{6^{2}-1}{12}}$
= ${\dfrac{36-1}{12}}$
= ${\dfrac{35}{12}}$
≈ 2.92
Thus, the variance is approximately 2.92
A weather forecasting model predicts that daily temperatures in a specific region will uniformly range between 20°C and 30°C during summer. Calculate the variance of the predicted temperatures.
As we know, Var(X) = ${\dfrac{\left( b-a\right) ^{2}}{12}}$
Here, a = 20 and b = 30
Var(X)
= ${\dfrac{\left( 30-20\right) ^{2}}{12}}$
= ${\dfrac{100}{12}}$ ≈ 8.33
Thus, the variance of the predicted temperatures is approximately 8.33
A school assigns locker numbers from 1 to 50 to students. Each locker number is equally likely to be assigned. What is the variance of the locker assignment?
As we know, Var(X) = ${\dfrac{n^{2}-1}{12}}$
Here, a = 1 and b = 50
n = b – a + 1 = 50 – 1 + 1 = 50
Var(X)
= ${\dfrac{50^{2}-1}{12}}$
= ${\dfrac{2499}{12}}$ ≈ 208.25
Thus, the variance of the locker assignment is approximately 208.25
Problem: Finding the variance of uniform distribution with NEGATIVE LOWER and UPPER BOUNDS
A manufacturing process generates random errors uniformly distributed between -8 and -2 millimeters. Calculate the variance of this uniform distribution.
As we know,
Var(X) = ${\dfrac{\left( b-a\right) ^{2}}{12}}$
Here, a = -8 and b = -2
Var(X)
= ${\dfrac{\left[ \left( -2\right) -\left( -8\right) \right] ^{2}}{12}}$
= ${\dfrac{\left( -2+8\right) ^{2}}{12}}$
= ${\dfrac{36}{12}}$ = 3
Thus, the variance is 3
Last modified on December 24th, 2024