1.3.12 · D3Probability & Statistics

Worked examples — Uniform, Exponential, and Beta distributions

2,910 words13 min readBack to topic

This page is a drill. The parent note Uniform, Exponential, and Beta distributions gave you the three PDFs and their formulas. Here we throw every kind of question at them — normal cases, edge cases, degenerate inputs, limits, a word problem, and an exam trap — and solve each one from the ground up.


Two reminders before we start

Two objects will show up repeatedly, so let us pin them down now in plain words.


The scenario matrix

Every question about these three distributions falls into one of these cells. Read the table, then we knock them out one by one.

# Cell (scenario class) Distribution Where it bites
C1 Standard interval query — probability over a sub-range Uniform Just area of a rectangle
C2 Degenerate / zero-width input (, or interval length ) Uniform Density blows up, PDF undefined
C3 Negative & shifted support () Uniform Sign bookkeeping in mean/var
C4 Standard CDF query — "arrives within " Exponential Plug into
C5 Memoryless twist — conditional "already waited" Exponential The past must cancel
C6 Limiting behaviour and Exponential Mean or
C7 Prior = ignorance () collapses to Uniform Beta Sanity bridge between families
C8 Bayesian update — observe data, get posterior mean Beta Add counts to
C9 U-shaped / degenerate shape () Beta Density at ends
C10 Exam-style multi-step twist — mixes two distributions Exp + Uniform Chained reasoning

Let's fill them.


Uniform: cells C1, C2, C3

  1. Identify the distribution. "Equally likely at any point of an interval" is the exact phrase for with , . Why this step? We must name the model before touching numbers — the whole method depends on the density being constant.
  2. Write the density. for . Why this step? The constant is the only value that makes the total area equal (see parent derivation).
  3. Probability = area of a rectangle. For a flat PDF, is just height width: Why this step? Integrating a constant from to is base height — no calculus needed.

Figure s01 below draws the flat blue PDF at height across ; the yellow shaded slab from to is exactly the area we computed — width , height , so area .

Figure — Uniform, Exponential, and Beta distributions

Verify: The full window has area ✓. Our sub-window is exactly half the width, so probability matches the "half the box" picture. Units: minutes cancel, probability is dimensionless ✓.


  1. Look at the density formula. . As , the denominator , so . Why this step? We test the formula at its boundary to find where it stops making sense.
  2. Interpret. All the probability () gets squeezed onto a shrinking interval, so the height must explode to keep area . Why this step? Total area is pinned at ; if width shrinks, height must grow to compensate.
  3. Verdict for . The interval has width , so is undefined. A single point has probability for any continuous variable, so a continuous uniform on one point does not exist — it degenerates to the infinitely-thin spike (Dirac delta) defined in the reminders above: all the certainty piled onto one value. Why this step? Naming the degenerate case protects you from ever writing with .

Verify: Take . Then and area for every , but the limit gives ✓. Degenerate case confirmed.


  1. Set . Width , so . Why this step? The subtraction handles the negative automatically; a common slip is writing .
  2. . The positive part is , width : . Why this step? The window straddles symmetrically, so half the mass is positive — the rectangle area confirms it.
  3. Mean. . Why this step? Symmetry around forces the midpoint to be — exactly the "no directional bias" that initialization wants.
  4. Variance. . Why this step? Variance depends only on width, not position, so the negative sign never enters — the shift is irrelevant to spread.

Verify: ✓. Mean and are both consistent with a symmetric box centred at the origin ✓.


Exponential: cells C4, C5, C6

  1. Model. Time-until-next-event in a Poisson process is , . Why this step? The waiting time of a Poisson process is exactly exponential — that is the parent's derivation.
  2. (a) Use the CDF. The cumulative distribution function is , so Why this step? "Within s" = , which is precisely what the CDF returns.
  3. (b) Invert the CDF. Set : Why this step? A percentile is "the at which the CDF hits that fraction" — so we solve the CDF backwards.

Figure s02 below plots the blue CDF curve ; the yellow dashed line marks where it crosses at (part a), and the red dashed line marks the level whose crossing gives s (part b).

Figure — Uniform, Exponential, and Beta distributions

Verify: Plug back: ✓. And , meaning within one mean-wait ( s) plus more, most requests have arrived ✓. Units: is (per s)(s) = dimensionless ✓.


  1. Write the conditional. We want . Why this step? "Already waited , then more" is literally a conditional survival probability.
  2. Apply memorylessness. For the exponential (the only continuous distribution with this property): Why this step? The from the past cancels top and bottom — the process forgets the seconds you invested.
  3. Compute. Why this step? After cancellation, only the future s survives, so it is the plain survival probability.

Verify: Direct route: ✓. Identical to starting fresh — the sunk waiting time is worthless, which is the whole shock of memorylessness.


  1. Recall the mean. . Why this step? All limiting behaviour of "typical wait" is read straight off .
  2. (a) : events almost never happen, . The PDF flattens toward everywhere — an ever-lengthening, near-flat tail. Why this step? Rate means "no events ever", so waiting time diverges — the opposite of a fast-data fit found by maximum likelihood estimation (MLE).
  3. (b) : events pour in, . The PDF spikes hard near — almost all mass at instant arrival. Why this step? High rate crushes the wait toward zero, the exponential's version of a degenerate spike at .

Verify: At , mean (huge) ✓; at , mean (tiny) ✓. Confirms "more frequent events → shorter waits", killing the common mistake of reading as the wait.


Beta: cells C7, C8, C9

  1. Plug into the Beta PDF. with : Why this step? Setting the exponents to and kills both -terms, leaving a constant — the signature of a uniform.
  2. Evaluate . Using the reminder : . Why this step? and ; this normalizer fixes the height.
  3. Conclude. on — exactly . Mean . Why this step? A flat height over is the uniform density; this is the bridge between the two families and why "flat prior = total ignorance" (see Bayesian Inference and Conjugate Priors).

Figure s03 below shows the green flat line at height over — the curve — with the yellow dashed line marking its mean at ; it is visually identical to a uniform box.

Figure — Uniform, Exponential, and Beta distributions

Verify: Uniform mean equals Beta mean ✓, and both have constant density ✓.


  1. Prior. . Prior mean . Why this step? We record the starting belief before data — the anchor the update pulls away from.
  2. Conjugacy update. Beta is conjugate to Bernoulli, so posterior is : Why this step? Because the Beta prior and Binomial likelihood multiply into another Beta, updating is just adding counts — the elegance the parent flagged (see Bayesian Inference and Conjugate Priors).
  3. Posterior mean. Why this step? The posterior mean sits between the prior mean and the raw data proportion — data pulls the belief, prior tempers it.

Figure s04 below overlays the blue prior (mean ) and the greener, taller posterior (mean ); the red dotted line at is the raw data proportion, and you can see the posterior peak sitting between prior and data.

Figure — Uniform, Exponential, and Beta distributions

Verify: , and indeed ✓. With more data the mean would slide closer to ; the prior's "pseudo-counts" of and act like extra observations.


  1. Substitute exponents. , so Why this step? Negative exponents put in the denominator, the opposite of the peaked cases — this is what creates the U.
  2. Check the endpoints. As , ; as , . Density diverges at both ends yet the total area stays finite (). Why this step? Diverging density is allowed as long as the integral converges — a subtle but legal edge case.
  3. Find the normalizer. , so the true PDF is (the arcsine distribution). Why this step? Dividing by is what makes the spiky curve enclose area exactly , proving it is a genuine PDF.
  4. Interpret. Mass piles up near and , thin in the middle: this belief says "the coin is probably near-certainly biased one way or the other, just don't know which." Mean by symmetry. Why this step? It is the "certainty near extremes" belief — the opposite of the ignorance of C7.

Figure s05 below draws the red U-shaped curve, with yellow arrows pointing at both endpoints where the density shoots to infinity while the shaded area under it stays finite.

Figure — Uniform, Exponential, and Beta distributions

Verify: , so ✓ — finite area despite infinite spikes at the two ends. Mean by symmetry ✓.


The exam twist: cell C10

  1. Freeze the conditioning. We are given , so the uniform step is done — we now work purely with . Why this step? Conditioning on the realized turns a two-stage problem into a plain one-stage exponential; ignoring the "given" is the classic exam trap.
  2. CDF query. Why this step? Same cumulative-distribution-function machinery as C4, now with the specific .
  3. Expected wait. s. Why this step? Given the rate, the mean is ; no averaging over the prior is needed because we conditioned.
  4. Sanity on the uniform stage. is the midpoint of , whose mean is ✓ — so this draw is the most typical rate. Why this step? Confirms the given value is consistent with the first-stage distribution.

Verify: ✓; mean s means over half the mass lies below , consistent with ✓. Uniform mean matches the given ✓.


Recall Did every cell get filled?

Which cell did the memoryless example fill? ::: C5 — exponential conditional "already waited". Which example bridges Beta and Uniform? ::: C7 — . In C9, where does the density diverge? ::: At both endpoints and . In C10, why can we ignore the uniform stage? ::: Because we conditioned on the realized . What is the posterior in C8 after successes, failures on a prior? ::: .