Skip to content

S2 Chapter 5: The Uniform Distribution

The Purest Form of Randomness: A World of Equal Possibilities

Section titled “The Purest Form of Randomness: A World of Equal Possibilities”

We have seen that the exponential distribution describes the patient mathematics of “waiting,” what if we need to model something fundamentally different - complete ignorance?

The principle of maximum ignorance suggests: treat every equal-length interval as equally likely. This leads us naturally to the uniform distribution - the mathematics of “pure randomness.”

1.1 Definition and Probability Density Function - The Rectangle of Certainty

Section titled “1.1 Definition and Probability Density Function - The Rectangle of Certainty”

Definition (Continuous Uniform Distribution): A continuous random variable XX follows a uniform distribution on the interval [a,b][a, b] if it has constant probability density over that interval. We write:

XUniform(a,b)orXU(a,b)X \sim \text{Uniform}(a, b) \quad \text{or} \quad X \sim U(a, b)

The key insight is that “uniform” means constant density - imagine a perfectly flat rectangle where height never changes.

Deriving the PDF through logical necessity:

Since the distribution is “uniform,” the PDF must be some constant kk over [a,b][a, b]:

f(x)={kif axb0otherwisef(x) = \begin{cases} k & \text{if } a \leq x \leq b \\ 0 & \text{otherwise} \end{cases}

But what is this constant kk? We use the fundamental requirement: total probability equals 1.

f(x)dx=abkdx=k(ba)=1\int_{-\infty}^{\infty} f(x) \, dx = \int_a^b k \, dx = k(b - a) = 1

Therefore: k=1bak = \frac{1}{b - a}

Example 1:

Consider XUniform(1,5)X \sim \text{Uniform}(1, 5).

(a) Write down the PDF and sketch it

f(x)={151=14if 1x50otherwisef(x) = \begin{cases} \frac{1}{5-1} = \frac{1}{4} & \text{if } 1 \leq x \leq 5 \\ 0 & \text{otherwise} \end{cases}

This creates a rectangle from x=1x = 1 to x=5x = 5 with height 14\frac{1}{4}.

(b) Find P(2<X<3.5)P(2 < X < 3.5)

Using the “rectangular property”:

P(2<X<3.5)=interval lengthtotal length=3.5251=1.54=0.375P(2 < X < 3.5) = \frac{\text{interval length}}{\text{total length}} = \frac{3.5 - 2}{5 - 1} = \frac{1.5}{4} = 0.375

(c) Find P(X=3)P(X = 3)

For any continuous distribution: P(X=3)=0P(X = 3) = 0. Individual points have zero probability.

(d) Find P(X>4.5)P(X > 4.5)

P(X>4.5)=54.551=0.54=0.125P(X > 4.5) = \frac{5 - 4.5}{5 - 1} = \frac{0.5}{4} = 0.125

1.2 Cumulative Distribution Function - The Linear Climb

Section titled “1.2 Cumulative Distribution Function - The Linear Climb”

Building the CDF step by step:

For XUniform(a,b)X \sim \text{Uniform}(a, b), we calculate F(x)=P(Xx)F(x) = P(X \leq x):

Case 1: x<ax < a

F(x)=0 (No probability accumulated yet)F(x) = 0 \text{ (No probability accumulated yet)}

Case 2: axba \leq x \leq b

F(x)=ax1badt=xaba (Linear accumulation)F(x) = \int_a^x \frac{1}{b-a} dt = \frac{x-a}{b-a} \text{ (Linear accumulation)}

Case 3: x>bx > b

F(x)=1 (All probability accumulated)F(x) = 1 \text{ (All probability accumulated)}

Uniform distribution PDF and CDF

Example 2: CDF Applications

For XUniform(2,6)X \sim \text{Uniform}(-2, 6):

(a) Write down the CDF

F(x)={0if x<2x(2)6(2)=x+28if 2x61if x>6F(x) = \begin{cases} 0 & \text{if } x < -2 \\ \frac{x - (-2)}{6 - (-2)} = \frac{x + 2}{8} & \text{if } -2 \leq x \leq 6 \\ 1 & \text{if } x > 6 \end{cases}

(b) Find P(0<X4)P(0 < X \leq 4)

P(0<X4)=F(4)F(0)=4+280+28=6828=12P(0 < X \leq 4) = F(4) - F(0) = \frac{4 + 2}{8} - \frac{0 + 2}{8} = \frac{6}{8} - \frac{2}{8} = \frac{1}{2}

(c) Find the first quartile

Q1Q_1 satisfies F(Q1)=0.25F(Q_1) = 0.25:

Q1+28=0.25Q1+2=2Q1=0\frac{Q_1 + 2}{8} = 0.25 \Rightarrow Q_1 + 2 = 2 \Rightarrow Q_1 = 0

Example 3: Airport Waiting Times

The waiting times, in minutes, between flight take-offs at an airport are modelled by the continuous random variable XX with probability density function

f(x)={152x70otherwisef(x) = \begin{cases} \frac{1}{5} & 2 \leq x \leq 7 \\ 0 & \text{otherwise} \end{cases}

  1. Write down the name of this distribution.
  2. A randomly selected flight takes off at 9 am. Find the probability that the next flight takes off before 9:05 am.
  3. Find the probability that at least 1 of the next 5 flights has a waiting time of more than 6 minutes.
  4. Find the cumulative distribution function of XX, for all xx.
  5. Sketch the cumulative distribution function of XX for 2x72 \leq x \leq 7.

1.3 Numerical Characteristics - Mean, Variance, and Transformations

Section titled “1.3 Numerical Characteristics - Mean, Variance, and Transformations”

From Rectangle to Balance Point: The Natural Center

Section titled “From Rectangle to Balance Point: The Natural Center”

For continuous random variables, we learned that expected value is the “center of gravity.” For uniform distributions, where does this balance point lie?

For XUniform(a,b)X \sim \text{Uniform}(a, b):

E(X)=abx1badx=1baabxdx=1bax22ab=b2a22(ba)=(ba)(b+a)2(ba)=a+b2\begin{aligned} E(X) &= \int_a^b x \cdot \frac{1}{b - a} \, dx = \frac{1}{b - a} \int_a^b x \, dx = \frac{1}{b - a} \cdot \frac{x^2}{2}\Big|_a^b = \frac{b^2 - a^2}{2(b - a)} = \frac{(b - a)(b + a)}{2(b - a)} = \frac{a + b}{2} \end{aligned}

Beautiful symmetry: The expected value is exactly the midpoint of the interval!

Using Var(X)=E(X2)[E(X)]2\text{Var}(X) = E(X^2) - [E(X)]^2:

Step 1: Calculate E(X2)E(X^2)

E(X2)=abx21badx=1bax33ab=b3a33(ba)=a2+ab+b23E(X^2) = \int_a^b x^2 \cdot \frac{1}{b - a} \, dx = \frac{1}{b - a} \cdot \frac{x^3}{3}\Big|_a^b = \frac{b^3 - a^3}{3(b - a)} = \frac{a^2 + ab + b^2}{3}

Step 2: Apply the variance formula

Var(X)=a2+ab+b23(a+b2)2=(ba)212\text{Var}(X) = \frac{a^2 + ab + b^2}{3} - \left(\frac{a + b}{2}\right)^2 = \frac{(b - a)^2}{12}

Example 4: Parameter Relationships

The continuous random variable XX is uniformly distributed over the interval [a,β][a, \beta] where β>a\beta > a.

Given that E(X)=8E(X) = 8:

  1. Write down an equation involving aa and β\beta.

Given also that P(X13)=0.7P(X \leq 13) = 0.7:

  1. Find the value of aa and the value of β\beta.
  2. Find Var(X)\text{Var}(X).
  3. Find P(5X35)P(5 \leq X \leq 35).

Example 5: Kitchen Weighing Scales

Albert uses scales in his kitchen to weigh some fruit. The random variable DD represents, in grams, the weight of the fruit given by the scales minus the true weight of the fruit. The random variable DD is uniformly distributed over the interval [2.5,2.5][-2.5, 2.5].

  1. Specify the probability density function of DD.
  2. Find the standard deviation of DD.
  3. Albert weighs a banana on the scales. Write down the probability that the weight given by the scales equals the true weight of the banana.
  4. Find the probability that the weight given by the scales is within 1 gram of the banana’s true weight.
  5. Albert weighs 10 bananas on the scales, one at a time. Find the probability that the weight given by the scales is within 1 gram of the true weight for at least 6 of the bananas.

Exercise 1: WST02/01/June17/7

The continuous random variable XX is uniformly distributed over the interval [a,b][a, b]

  1. Find an expression, in terms of aa and bb, for E(32X)E(3 - 2X) (2)
  2. Find P(X>13b+23a)P(X > \frac{1}{3}b + \frac{2}{3}a) (2)

Given that E(X)=0E(X) = 0

  1. find an expression, in terms of bb only, for E(3X2)E(3X^2) (3)

Given also that the range of XX is 1818

  1. find Var(X)\text{Var}(X) (2)

Exercise 2: WST02/01/June15/3

A piece of spaghetti has length 2c2c, where cc is a positive constant. It is cut into two pieces at a random point. The continuous random variable XX represents the length of the longer piece and is uniformly distributed over the interval [c,2c][c, 2c].

  1. Sketch the graph of the probability density function of XX (2)
  2. Use integration to prove that Var(X)=c212\text{Var}(X) = \frac{c^2}{12} (6)
  3. Find the probability that the longer piece is more than twice the length of the shorter piece. (3)

Exercise 3: 6684/01/June15/4

The continuous random variable LL represents the error, in metres, made when a machine cuts poles to a target length. The distribution of LL is a continuous uniform distribution over the interval [0,0.5][0, 0.5]

  1. Find P(L<0.4)P(L < 0.4). (1)
  2. Write down E(L)E(L). (1)
  3. Calculate Var(L)\text{Var}(L). (2)

A random sample of 3030 poles cut by this machine is taken.

  1. Find the probability that fewer than 44 poles have an error of more than 0.40.4 metres from the target length. (3)

When a new machine cuts poles to a target length, the error, XX metres, is modelled by the cumulative distribution function F(x)F(x) where

F(x)={0x<04x4x20x0.51otherwiseF(x) = \begin{cases} 0 & x < 0 \\ 4x - 4x^2 & 0 \leq x \leq 0.5 \\ 1 & \text{otherwise} \end{cases}

  1. Using this model, find P(X>0.4)P(X > 0.4) (2)

A random sample of 100100 poles cut by this new machine is taken.

  1. Using a suitable approximation, find the probability that at least 88 of these poles have an error of more than 0.40.4 metres. (3)

The Ultimate Test of Uniform Distribution Theory

Section titled “The Ultimate Test of Uniform Distribution Theory”

Now we’ll tackle one of the most famous problems in probability theory - one that beautifully demonstrates how uniform distributions can unlock the secrets of π\pi itself.

In 1777, French mathematician Georges-Louis Leclerc, Comte de Buffon, posed this challenge: “What’s the probability that a randomly dropped needle will cross a line on lined paper?”

Buffon's needle problem

Hint 1: Consider the needle’s position relative to the lines.

Let XX be the perpendicular distance from the needle’s center to the nearest line.

Question 1a: The lines are spaced 1 unit apart. What is the range of possible values for XX (the distance from needle center to nearest line)?

Answer: XX can range from ____ to ____

Question 1b: If the needle is dropped “randomly,” what distribution should XX follow?

Hint: Since the needle is dropped randomly, it’s equally likely to land anywhere. This means XX should be ____ distributed over its range.

Question 1c: Now consider the needle’s orientation. Let Θ\Theta be the acute angle between the needle and the parallel lines. What is the range of possible values for Θ\Theta?

Answer: Θ\Theta can range from ____ to ____

Question 1d: What distribution should Θ\Theta follow?

Hint: Due to rotational symmetry, the needle is equally likely to point in any direction. So Θ\Theta should be ____ distributed over its range.

Question 1e: Are XX and Θ\Theta independent?

Think about it: Does the position where the needle lands affect its angle? Does the angle affect where it lands? Your answer: ____

Geometric Analysis: When does the needle cross a line?

Question 2: Look at the diagram. The needle extends 12\frac{1}{2} unit from its center in each direction. When does the needle cross the nearest line? Find the function f(Θ)f(\Theta) such that the needle crosses a line if and only if Xf(Θ)X \leq f(\Theta).

Step 3: Calculate the Probability Using “Averaging”

Section titled “Step 3: Calculate the Probability Using “Averaging””

Since we have two random aspects (position XX and angle Θ\Theta), we need a clever approach. Let’s think step by step:

The Key Insight: For each specific angle θ\theta, we can easily find the probability that the needle crosses a line. Then we “average” over all possible angles.

Question 3a: Suppose the needle is oriented at a specific angle θ\theta (where 0θπ20 \leq \theta \leq \frac{\pi}{2}).

  • From Step 2, the needle crosses a line when XX \leq ____
  • Since XX is uniformly distributed on [0,12][0, \frac{1}{2}], what is P(needle crossesangle=θ)P(\text{needle crosses} \mid \text{angle} = \theta)?

Let’s work through an example: If θ=30=π6\theta = 30^{\circ} = \frac{\pi}{6}, then:

  • The needle crosses when X12sin(π6)=12×12=14X \leq \frac{1}{2}\sin(\frac{\pi}{6}) = \frac{1}{2} \times \frac{1}{2} = \frac{1}{4}
  • Since XX is uniform on [0,12][0, \frac{1}{2}]: P(needle crossesθ=30)=1412=12P(\text{needle crosses} \mid \theta = 30^{\circ}) = \frac{\frac{1}{4}}{\frac{1}{2}} = \frac{1}{2}

General formula: P(needle crossesangle=θ)=P(\text{needle crosses} \mid \text{angle} = \theta) = ____

Question 3b: Now we need to find the overall probability. Since the angle Θ\Theta is also random and uniform on [0,π2][0, \frac{\pi}{2}], we need to “average” the conditional probabilities from Question 3a over all possible angles.

Mathematical Averaging: When we have a continuous range of values, “averaging” becomes integration:

P(needle crosses)=1π200π/2P(needle crossesangle=θ)dθP(\text{needle crosses}) = \frac{1}{\frac{\pi}{2} - 0} \int_0^{\pi/2} P(\text{needle crosses} \mid \text{angle} = \theta) \, d\theta

Substitute your answer from Question 3a into this formula and evaluate the integral.

Step-by-step guidance:

P(needle crosses)=1π20π/2___dθ=2π0π/2___dθ=___\begin{aligned} P(\text{needle crosses}) &= \frac{1}{\frac{\pi}{2}} \int_0^{\pi/2} \_\_\_ \, d\theta \\ &= \frac{2}{\pi} \int_0^{\pi/2} \_\_\_ \, d\theta \\ &= \_\_\_ \end{aligned}

Question 4a: Complete the calculation from Step 3. You should get:

P(needle crosses a line)=___P(\text{needle crosses a line}) = \_\_\_

Question 4b: Look at your answer! What famous mathematical constant appears? This is the amazing discovery that made Buffon’s needle experiment so famous.

Question 4c: Rearrange your probability formula to express π\pi in terms of the crossing probability:

π=___\pi = \_\_\_

Question 4d: How could you use this experiment to estimate π\pi? If you performed the experiment 1000 times and observed 637 crossings, what would be your estimate for π\pi?

Your calculation: ___.\text{Your calculation: } \_\_\_.

Extension Challenge:

  1. What happens if the needle length is not equal to the line spacing? Derive the general formula for probability when needle length is \ell and line spacing is dd.
  2. If >d\ell > d (needle longer than line spacing), how would you modify the analysis?
  3. Design a classroom experiment using readily available materials (toothpicks, paper, etc.) to estimate π\pi.