πŸ“˜ Session 4.4 – Continuous Uniform Distribution

πŸ”§ Why uniform? Two quick, real-life connections

Engineering β€” tolerance window (drilled hole)

A CNC operation is set to drill a hole and auto-reject if it’s outside 12.50 Β± 0.10 mm. With process control keeping outcomes spread fairly evenly in the allowed window, a quick first model is X ~ Uniform(12.40, 12.60). Then any sub-interval’s probability is just its length divided by 0.20.

Student life β€” random quiz question number

Your instructor lets a script randomly pick the starting question number from 1 to 10 uniformly. The chance it starts between 3 and 6 is length 4 over total length 10 β†’ 4/10 = 0.4.

Definition: A continuous random variable X has a Uniform Distribution on the interval [a, b] if its probability density function (PDF) is:
f(x) = 1 / (b βˆ’ a), for a ≀ x ≀ b

πŸ“ Properties

πŸ“Š Example 4.7 – Uniform Current

Context: The current X in a wire is uniformly distributed between 4.9 and 5.1 milliamperes. The PDF is:
f(x) = 5 for 4.9 ≀ x ≀ 5.1
Question: What is the probability that X is between 4.95 and 5.0?
Solution:
P(4.95 < X < 5.0) = ∫4.955.0 5 dx = 5 Γ— (5.0 βˆ’ 4.95) = 0.25

πŸ§ͺ Try it yourself (theory vs simulation)

Theoretical:
Simulated:

Theory for Uniform is simply length of interval divided by total length: (U–L)/(b–a), clipped to [0,1].

πŸ“ˆ Cumulative Distribution Function (CDF)

The cumulative distribution function F(x) is:

πŸ“Š Excel: sample, estimate probability, and make a histogram

  1. Generate Uniform(a,b) samples

    Option A (constants, here a=4.9, b=5.1). Put in A2 and fill down:

    =4.9 + (5.1 - 4.9) * RAND()

    Option B (use cells for a and b, e.g. A1=a, B1=b):

    =$A$1 + ($B$1 - $A$1) * RAND()
    Tip: To β€œfreeze” values, copy the column and Paste Special β†’ Values.
  2. Estimate P(L ≀ X ≀ U)

    With samples in A2:A5001 and bounds in cells L and U:

    =COUNTIFS(A2:A5001, ">="&L, A2:A5001, "<="&U) / ROWS(A2:A5001)
    Use cell references for L and U (e.g., C1, D1).
  3. Mean and variance from data
    =AVERAGE(A2:A5001)
    =VAR.P(A2:A5001)
    For Uniform(a,b), the true variance is \((b-a)^2/12\) β€” your estimate should be close.
  4. Histogram

    Excel 365: Insert β†’ Chart β†’ Histogram.
    Or build bins and use COUNTIFS, then insert a column chart.

🧠 Summary