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].

The graph shows a rectangle with total area equal to 1. The rectangle extends from x = a to x = b on the x-axis and has a height of 1/(b-a).
Figure 1: Probability Density Function of the Uniform Random Variable

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].

  1. Create the PDF.
  2. Calculate the probability of selecting a number between 0 and 2.
  3. Calculate the mean and standard deviation.

Solutions:

  1. 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.This shows the graph of the function f(x) = 1/20. A horiztonal line ranges from the point (0, 1/20) to the point (20, 1/20). A vertical line extends from the x-axis to the end of the line at point (20, 1/20) creating a rectangle.
  2. [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]This shows the graph of the function f(x) = 1/20. A horiztonal line ranges from the point (0, 1/20) to the point (20, 1/20). A vertical line extends from the x-axis to the end of the line at point (20, 1/20) creating a rectangle. A region is shaded inside the rectangle from x = 0 to x = 2.
  3. [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.

  1. What is the probability that a person waits fewer than 12.5 minutes?
  2. On the average, how long must a person wait? Find the mean, μ, and the standard deviation, σ.
  3. 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]

  1. To find [latex]P(X < 12.5)[/latex], we set up an integral or we use geometry to find the shaded region.This shows the graph of the function f(x) = 1/15. A horiztonal line ranges from the point (0, 1/15) to the point (15, 1/15). A vertical line extends from the x-axis to the end of the line at point (15, 1/15) creating a rectangle. A region is shaded inside the rectangle from x = 0 to x = 12.5.[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.
  2. [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.
  3. 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.

f(X)=1/15 graph displaying a boxed region consisting of a horizontal line extending to the right from point 1/15 on the y-axis, a vertical upward line from an arbitrary point on the x-axis, and the x and y-axes. A shaded region from points 0-k occurs within this area. The area of this probability region is equal to 0.90.

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.

Videos

YouTube Uniform Continuous Probability Distribution

License

Icon for the Creative Commons Attribution 4.0 International License

Introduction to Statistics for Engineers Copyright © by Vikki Maurer & Jeff Crabill & Linn-Benton Community College is licensed under a Creative Commons Attribution 4.0 International License, except where otherwise noted.