# 🔔 Gaussian and Exponential Models

By Better Wise

The last lesson handled columns that count things: `items_count` fit a Poisson, a yes/no flag fit a Bernoulli. This lesson covers the other two column types you meet in almost every dataset question: a **measurement** (a price, a weight, a temperature) and a **waiting time** (minutes to delivery, seconds to the next click). The Gaussian answers percentile questions about measurements. The exponential answers "how long until" questions about gaps. Both connect back to the Poisson: if events arrive as Poisson counts at rate $\lambda$, the gaps between them are exponential with that same $\lambda$.

By the end of this lesson you should be able to:

- Fit and interpret a Gaussian from a mean and standard deviation
- Turn "what share is above X?" or "what value marks the top 10%?" into a z-score lookup
- Use the exponential CDF to answer waiting-time questions on a real column
- Spot when a Gaussian is the wrong model for a time column
- Explain memorylessness and why it matters for interpretation

We work with `quickcart_orders.csv`, which has `order_value_usd` (a measurement) and `delivery_minutes` (a waiting time).

## A measurement column: order_value_usd

The Gaussian $N(\mu, \sigma^2)$ is a symmetric bell curve described by two numbers: the center $\mu$ and the spread $\sigma$.

$$
f(x) = \frac{1}{\sigma\sqrt{2\pi}} \exp\left(-\frac{(x-\mu)^2}{2\sigma^2}\right)
$$

Almost every question you actually get asked is a percentile question, and all of them go through the same move: **standardize**, then read the table.

$$
z = \frac{x - \mu}{\sigma}
$$

The z-score says how many standard deviations the cutoff sits from the mean. You then look up the tail area. Useful anchors: $z = 0.6745$ is the 75th percentile, $1.2816$ is the 90th, $1.6449$ is the 95th. Inverting the formula gives the percentile back: $x = \mu + z\sigma$.

**Worked example 1.** Past orders give $\mu = 62$ and $\sigma = 14$ dollars. What share of orders is above \$80?

$$
z = \frac{80 - 62}{14} = 1.29
$$

The upper tail beyond $z = 1.29$ is about $0.099$, so roughly **10% of orders exceed \$80**.

**Worked example 2.** What order value marks the top 10%?

$$
x = 62 + 1.2816 \times 14 = 79.94
$$

So about **\$80**. The two answers agree, which is a good consistency check: the 90th percentile is the value with 10% above it.

**Worked example 3.** Share of orders between \$48 and \$76 is $z = -1$ to $z = +1$, which by the empirical rule is about **68%**. Saying "roughly two thirds of orders fall within one sigma" is a sentence a stakeholder understands instantly.

## A waiting-time column: delivery_minutes

Delivery time cannot be negative and it is right-skewed: many short deliveries, a long thin tail of slow ones. The exponential model fits this shape with a single parameter.

$$
f(t) = \lambda e^{-\lambda t}, \qquad F(t) = P(T \le t) = 1 - e^{-\lambda t}, \qquad t \ge 0
$$

Here $\lambda$ is a **rate per unit time**, not a time. The mean wait is $1/\lambda$. In `delivery_minutes` the mean is 28 minutes, so $\lambda = 1/28 \approx 0.0357$ per minute. This is the easiest place to make a mistake: if someone hands you a mean, invert it before touching the formula.

**Worked example 4.** Probability a delivery takes longer than 45 minutes:

$$
P(T > 45) = e^{-45/28} = e^{-1.607} \approx 0.20
$$

About **20%** of deliveries are slower than 45 minutes.

**Worked example 5.** Median delivery time: $\ln(2)/\lambda = 28 \times 0.693 \approx 19.4$ minutes. Note the median is well below the mean, which is the signature of a right-skewed column. If your mean and median are that far apart, do not fit a Gaussian.

**Worked example 6.** Suppose a colleague fits a Gaussian with mean 28 and standard deviation 16 instead. That model gives $P(T > 45) \approx 0.14$ (too low, it thins the tail) and puts about **4% of the probability below zero minutes**, which is impossible. That is the argument for choosing the model from the shape of the column, not from convenience.

### Memorylessness, and why it changes your interpretation

The exponential has a property no Gaussian has:

$$
P(T > s + t \mid T > s) = P(T > t)
$$

Given a delivery has already taken 20 minutes, the chance it takes 25 more is the same as the chance a fresh order takes more than 25 minutes: $e^{-25/28} \approx 0.41$. Surviving the wait so far tells you nothing extra. This is a strong assumption, often false in the real world (traffic builds up), so state it explicitly when you use it.

```mermaid
flowchart TD
    Q["Which column is the question about?"]
    Q --> M["📏<br/>Measurement, roughly symmetric"]
    Q --> W["⏱️<br/>Waiting time or gap"]
    M --> G["Gaussian<br/>mu and sigma"]
    W --> E["Exponential<br/>rate lambda, mean 1 over lambda"]
    G --> Z["Standardize: z equals x minus mu over sigma"]
    E --> C["Tail: e to the minus lambda t"]
```

| Question on your desk | Model | Formula to reach for |
| --- | --- | --- |
| Share of orders above \$80 | Gaussian | upper tail beyond $z$ |
| Value that marks the top 10% | Gaussian | $x = \mu + 1.2816\sigma$ |
| Share of deliveries slower than 45 min | Exponential | $e^{-\lambda t}$ |
| Median or 90th percentile wait | Exponential | $\ln(2)/\lambda$, $\ln(10)/\lambda$ |

## Reading the tails correctly: traps that cost marks

- **Check the shape before fitting.** Plot a histogram. A Gaussian assumption on a skewed column gets the tail wrong, and the tail is where the interesting questions live.
- **Rate is not a time.** $\lambda = 1/28$ per minute, mean 28 minutes. Confusing the two gives answers off by a factor of 784.
- **The mean is not the median.** For any exponential, median $= 0.69 \times$ mean. Report both when the column is skewed.
- **"Above" means the upper tail.** For $P(X > x)$ with a Gaussian, subtract the table area from 1. This is the single most common arithmetic slip.
- **Standard deviations, not units.** Always convert to $z$ before comparing cutoffs from two different columns.
- **State the memorylessness assumption out loud** when you condition on elapsed wait, because it is a modeling claim, not an arithmetic step.

### Two exercises

1. A premium segment has $\mu = 45$, $\sigma = 12$ for `order_value_usd`. (a) What share is above \$60? (b) What value marks the 75th percentile?
2. `support_wait_minutes` is exponential with mean 12. (a) $P(T > 20)$? (b) The median? (c) $P(T > 32 \mid T > 20)$?

**Show the answers**

1. (a) $z = (60-45)/12 = 1.25$, upper tail $\approx 0.106$, about **10.6%**. (b) $45 + 0.6745 \times 12 = 53.09$, about **\$53**.
2. $\lambda = 1/12$. (a) $e^{-20/12} = e^{-1.667} \approx 0.189$, about **19%**. (b) $12 \times 0.693 \approx 8.3$ minutes. (c) By memorylessness, $e^{-12/12} = e^{-1} \approx 0.368$, about **37%**.

## What to carry forward

- A Gaussian question is a percentile question: standardize to $z$, read the tail, invert for the percentile value.
- An exponential question is a waiting-time question: get $\lambda$ as a rate, then use $e^{-\lambda t}$ for tails and $\ln(2)/\lambda$ for the median.
- Choose the model from the column's shape and support (non-negative, skewed, symmetric), not from convenience.
- Association is not the goal this time: the next lesson, *Bayes' Rule and Base Rates*, asks how to revise a belief about a single row (for example, is this late delivery actually late?) when base rates and a noisy test disagree.

Front: What does the Gaussian model N(mu, sigma^2) describe?
Back: A roughly symmetric measurement column, summarized by its mean mu and standard deviation sigma.

Front: How is a z-score computed?
Back: z = (x - mu) / sigma, the number of standard deviations x sits from the mean.

Front: Which z-value marks the 90th percentile?
Back: About 1.2816, so the 90th percentile is mu + 1.2816 sigma.

Front: How do you handle a 'greater than' Gaussian question?
Back: Standardize the cutoff, look up the area, then subtract it from 1 to get the upper tail.

Front: What share of a Gaussian lies within one and two standard deviations?
Back: About 68% within one sigma and about 95% within two.

Front: In the exponential model, what is lambda?
Back: A rate per unit time, not a duration; the mean waiting time is 1/lambda.

Front: What is the exponential CDF?
Back: P(T <= t) = 1 minus e to the power minus lambda t, so P(T > t) = e to the minus lambda t.

Front: How does the exponential median relate to its mean?
Back: Median = ln(2)/lambda, about 0.69 times the mean.

Front: What does memorylessness of the exponential say?
Back: P(T > s + t | T > s) = P(T > t), so surviving a wait does not change the remaining wait distribution.

Front: How are Poisson counts and exponential gaps related?
Back: If events arrive as Poisson counts at rate lambda, the gaps between events are exponential with that same lambda.

Front: Why is a Gaussian a poor model for delivery_minutes?
Back: Times are non-negative and right-skewed, so a Gaussian puts mass below zero and understates the long tail.

Front: What is the closed form for the 90th percentile of an exponential?
Back: ln(10)/lambda, roughly 2.303 divided by the rate.

Front: Which summary should you report for a skewed waiting-time column?
Back: The median (and the mean alongside it), since the mean is pulled up by the long tail.

Three facts worth locking in with cloze practice: a cutoff becomes comparable across columns once you convert it to a _____, which counts standard deviations from the mean. In the exponential model, $\lambda$ is a _____, so the mean wait equals _____. The exponential is _____, meaning the remaining wait has the same distribution no matter how long you have already waited.

---

## Contents

Part of [🎲 Mathematics for Machine Learning 3: Probability and Statistics for Data-Driven Models](https://everwise.study/courses/mathematics-for-machine-learning-3-probability-and-statistics-for-data.md)

- **🎲 Probability Foundations for Data**
  - [🧩 Axioms, Conditional Probability and Independence](https://everwise.study/courses/mathematics-for-machine-learning-3-probability-and-statistics-for-data/probability-axioms-conditional-independence.md)
  - [📊 Expectation and Variance on a Real Dataset](https://everwise.study/courses/mathematics-for-machine-learning-3-probability-and-statistics-for-data/expectation-variance-worked-dataset.md) (sign-in required)
  - [🔗 Covariance, Correlation and Dependence](https://everwise.study/courses/mathematics-for-machine-learning-3-probability-and-statistics-for-data/covariance-correlation-dependence.md)
  - [✅ Checkpoint: Probability Foundations](https://everwise.study/courses/mathematics-for-machine-learning-3-probability-and-statistics-for-data/checkpoint-probability-foundations.md)
- **📈 Distributions and Bayes' Rule**
  - [🔢 Bernoulli, Binomial and Poisson Counts](https://everwise.study/courses/mathematics-for-machine-learning-3-probability-and-statistics-for-data/bernoulli-binomial-poisson-count-data.md)
  - [🔔 Gaussian and Exponential Models](https://everwise.study/courses/mathematics-for-machine-learning-3-probability-and-statistics-for-data/gaussian-exponential-continuous-data.md) — this lesson
  - [🧠 Bayes' Rule and Base Rates](https://everwise.study/courses/mathematics-for-machine-learning-3-probability-and-statistics-for-data/bayes-rule-base-rates.md)
  - [🧪 Checkpoint: Distributions and Bayes](https://everwise.study/courses/mathematics-for-machine-learning-3-probability-and-statistics-for-data/checkpoint-distributions-and-bayes.md)
- **🎯 Estimation and Inference**
  - [⚙️ Maximum Likelihood and MAP Estimation](https://everwise.study/courses/mathematics-for-machine-learning-3-probability-and-statistics-for-data/maximum-likelihood-map-estimation.md)
  - [⚖️ Bias-Variance Tradeoff in Practice](https://everwise.study/courses/mathematics-for-machine-learning-3-probability-and-statistics-for-data/bias-variance-tradeoff-practice.md)
  - [📐 Sampling, Confidence Intervals and Hypothesis Tests](https://everwise.study/courses/mathematics-for-machine-learning-3-probability-and-statistics-for-data/sampling-confidence-intervals-hypothesis-tests.md) (premium content)
  - [🏁 Checkpoint: Estimation and Inference](https://everwise.study/courses/mathematics-for-machine-learning-3-probability-and-statistics-for-data/checkpoint-estimation-and-inference.md) (premium content)
- [Course cheatsheet](https://everwise.study/courses/mathematics-for-machine-learning-3-probability-and-statistics-for-data/cheatsheet.md) (premium content)
