The Uniform or Rectangular Distribution

STA 211 · Lecture 11

Introduction

A continuous uniform distribution assigns equal density to all points in a finite interval. It is appropriate when only the lower and upper bounds are known and no value within the interval is favoured.

Learning Objectives

You should be able to:

  • state the uniform PDF and CDF;
  • calculate interval probabilities;
  • derive the mean and variance; and
  • transform a uniform random variable linearly.

Density and Distribution Functions

If X∼U(a,b)X \sim U(a,b) with a<ba < b, then

fX(x)={1b−a,a≤x≤b,0,otherwise.f_{X}(x) = \left\{ \begin{matrix} \frac{1}{b - a}, & a \leq x \leq b, \\ 0, & \text{otherwise}. \end{matrix} \right.\

Uniform probability density function

Uniform probability density function

The CDF is

FX(x)={0,x<a,x−ab−a,a≤x≤b,1,x>b.F_{X}(x) = \left\{ \begin{matrix} 0, & x < a, \\ \frac{x - a}{b - a}, & a \leq x \leq b, \\ 1, & x > b. \end{matrix} \right.\

For a≤c<d≤ba \leq c < d \leq b,

P(c≤X≤d)=d−cb−a.P(c \leq X \leq d) = \frac{d - c}{b - a}.

Probability is proportional to interval length.

Mean and Variance

E(X)=a+b2,E(X) = \frac{a + b}{2},

Var(X)=(b−a)212.Var(X) = \frac{(b - a)^{2}}{12}.

The median and all central symmetry points equal (a+b)/2(a + b)/2.

The ppth quantile is

xp=a+p(b−a),0<p<1.x_{p} = a + p(b - a),\quad\quad 0 < p < 1.

The MGF, for t≠0t \neq 0, is

MX(t)=etb−etat(b−a),M_{X}(t) = \frac{e^{tb} - e^{ta}}{t(b - a)},

with MX(0)=1M_{X}(0) = 1 by continuity.

Example 11.1

A bus arrives uniformly between 10 and 20 minutes from now. Let X∼U(10,20)X \sim U(10,20). The probability that the wait is between 12 and 15 minutes is

15−1220−10=0.3.\frac{15 - 12}{20 - 10} = 0.3.

The expected wait is

E(X)=10+202=15 minutes.E(X) = \frac{10 + 20}{2} = 15\text{ minutes}.

Linear Transformation

If X∼U(a,b)X \sim U(a,b) and Y=c+dXY = c + dX with d>0d > 0, then

Y∼U(c+da,c+db).Y \sim U(c + da,c + db).

If d<0d < 0, the endpoints are reversed and should be reordered.

Example 11.2: Generating a uniform interval

If U∼U(0,1)U \sim U(0,1), then

X=a+(b−a)UX = a + (b - a)U

has distribution U(a,b)U(a,b). This transformation is fundamental in random-number generation.

Post-Test

  1. State the PDF and CDF of U(a,b)U(a,b).
  2. If X∼U(2,8)X \sim U(2,8), find P(3<X<5)P(3 < X < 5).
  3. For Question 2, find the mean and variance.
  4. Find the 90th percentile of U(10,30)U(10,30).
  5. If U∼U(0,1)U \sim U(0,1), state the distribution of Y=5+4UY = 5 + 4U.

Selected answers: 2. 1/31/3; 3. 55 and 33; 4. 2828; 5. U(5,9)U(5,9).