6.3 The Uniform Distribution
The uniform distribution is a continuous probability distribution and is concerned with events that are equally likely to occur within a specific range. Many computer algorithms generate pseudo-random numbers uniformly distributed between 0 and 1. This uniform distribution ensures that each value within the range has an equal probability of being generated. Because every value on an interval occurs with equal probability, the probability density function, [latex]f(x)[/latex] is constant. It is often referred as the rectangular distribution because the graph of the pdf has the form of a rectangle.
The probability P(a < X < b) may be found by computing the area under f(x), between a and b, as shown in Figure 1. Since the corresponding area is a rectangle, the area may be found simply by multiplying the width and the height. Because the area represents the total probability, the length of the rectangle multiplied by the height must be 1. Thus, [latex](b - a)f(x) = 1.[/latex] This shows that [latex]f(x) = \frac{1}{b - a}[/latex].
Facts about the Uniform Distribution
Once you have established that a continuous random variable X has a uniform distribution on the interval [latex][a,b][/latex], then we know the following:
- We use the notation [latex]X \sim U(a,b)[/latex]
- The PDF is [latex]f(x) = \displaystyle\frac{1}{b-a}[/latex]
- The mean of the uniform distribution is [latex]E(X) = \displaystyle\frac{a + b}{2}[/latex]
- The standard deviation of the uniform distribution is [latex]\sigma (X) = \displaystyle\sqrt{\frac{(b-a)^2}{12}}[/latex].
The mean and standard deviations can be derived using the integral definitions.
Example 1 – Random Number Generator
A random number generator generates numbers between (and including) 0 and 20, so each number has an equal chance of being selected. If X = a randomly generated number from 0 to 20, then [latex]X \sim U(0, 20)[/latex].
- Create the PDF.
- Calculate the probability of selecting a number between 0 and 2.
- Calculate the mean and standard deviation.
Solutions:
- The PDF is a constant function, [latex]f(x) = \frac{1}{20}[/latex] over the domain [latex]0 \leq X \leq 20[/latex] Note the total area is 1.
- [latex]\int_{0}^{2} f(x)dx=\int_{0}^{2} \frac{1}{20}dx=\bigg[\frac{x}{20}\bigg]_0^2=\frac{2}{20}-\frac{0}{20}=0.1[/latex].
Alternately, we can multiply [latex](2 - 0)\big(\frac{1}{20}\big) = \frac{2}{20} = 0.1[/latex] - [latex]\mu_X = \frac{a + b}{2} = \frac{0 + 20}{2} = 10[/latex]
[latex]\sigma_X=\sqrt{\frac{(b - a)^2}{12}}= \sqrt{\frac{(20 - 0)^2}{12}}=\sqrt{\frac{400}{12}} \approx 5.77.[/latex]
Example 2 – Bus Waiting Time
The amount of time, in minutes, that a person must wait for a bus is uniformly distributed between zero and 15 minutes, inclusive.
- What is the probability that a person waits fewer than 12.5 minutes?
- On the average, how long must a person wait? Find the mean, μ, and the standard deviation, σ.
- Ninety percent of the time, the time a person must wait falls below what value? This asks for the 90th percentile.
Solutions:
First, we establish the probability distribution of the random variable. In this case X measures the time that a person waits for a bus. In addition, we know that [latex]X \sim U(0, 15).[/latex] The PDF is [latex]f(x) = \frac{1}{15}.[/latex]
- To find [latex]P(X < 12.5)[/latex], we set up an integral or we use geometry to find the shaded region.[latex]P(X < 12.5) = \int_0^{12.5} \frac{1}{15} dx = \frac{12.5}{15} \approx 0.83[/latex]. Approximately 83% of the time a person will wait fewer than 12.5 minutes for the bus.
- [latex]\mu_X = \int_0^{15} \frac{x}{15} dx = 7.5.[/latex] Alternately, [latex]\mu_X = \frac{0 + 15}{2} = 7.5.[/latex][latex]\sigma_X=\sqrt{\frac{(15 - 0)^2}{12}}= \sqrt{\frac{225}{12}}=\sqrt{18.75} \approx 4.3.[/latex]On average, a person must wait 7.5 minutes with a standard deviation of 4.33 minutes.
- To find the 90th percentile, we'll use geometry! We must find the value of [latex]k[/latex] that marks the boundary between the lower 90% and upper 10% of the data.
Since the shaded area is the probability we're looking for, we know that [latex]P(x < k) = \dfrac{1}{15}(k - 0)[/latex]
Thus [latex]0.90 = \dfrac{1}{15}k[/latex] and [latex]k = 13.5[/latex].
So the 90th percentile is 13.5 minutes. Ninety percent of the time, a random person will wait at most 13.5 minutes for the bus.