AI Wiki中文/EN

Exponential and Poisson distributions

指数与泊松分布

Connect event counts and waiting times through a homogeneous Poisson process, with units, memorylessness, numerical calculations, and failure cases.

On this pageIntuitionMathematics & methodImplementationLimitationsExercisesResearch connections

How many arrivals, and how long until the next?

Suppose a teaching model produces arrivals at a constant average rate of two per minute. “How many arrive in the next half-minute?” asks for an integer count. “How long until the next arrival?” asks for a nonnegative duration. They have different units and different distributions.

The rate alone does not determine either answer. Two arrivals scheduled exactly every minute and arrivals occurring in irregular bursts can have the same long-run average. We will explicitly assume a homogeneous Poisson process when connecting the two questions. Under that model, half a minute has expected count one, the chance of no arrivals is e−1≈0.3679e^{-1}\approx0.3679, and the chance of waiting at most half a minute is 1−e−1≈0.63211-e^{-1}\approx0.6321.

The last two probabilities complement each other because “still waiting” means “no arrivals yet.” That event identity is the bridge between counts and waiting times; it is not a rule that any count dataset must satisfy with Poisson and exponential formulas.

Keep the rate separate from the interval mean

A Poisson random variable CC has dimensionless parameter μ≥0\mu\ge0 and nonnegative integer support. For μ>0\mu>0 its probability mass function is:

P(C=k)=e−μμkk!,k=0,1,2,…,E[C]=Var⁡(C)=μ.P(C=k)=e^{-\mu}\frac{\mu^k}{k!},\qquad k=0,1,2,\ldots,\qquad \mathbb E[C]=\operatorname{Var}(C)=\mu.

Normalization follows from the exponential series. Multiplying the series term by kk and shifting the index gives E[C]=μ\mathbb E[C]=\mu; multiplying by k(k−1)k(k-1) gives E[C(C−1)]=μ2\mathbb E[C(C-1)]=\mu^2. Hence E[C2]=μ2+μ\mathbb E[C^2]=\mu^2+\mu and the variance is μ\mu. At μ=0\mu=0, all mass is at zero. SciPy, Poisson definition and zero-parameter convention

Let N(t)N(t) count arrivals up to time tt. One definition of a homogeneous Poisson process requires N(0)=0N(0)=0, independent increments in disjoint time intervals, and a Poisson count with mean λ(b−a)\lambda(b-a) in every interval (a,b](a,b], where 0≤a<b0\le a<b. Its rate λ>0\lambda>0 is measured in arrivals per unit time. The increment distribution depends on the interval length rather than its position: this is stationarity of increments, not stationarity of N(t)N(t) itself. Pishro-Nik, Section 11.1.2, definition

N(t)∼Poisson⁡(λt),μ=λt,P(T>t)=P(N(t)=0)=e−λt(t≥0).N(t)\sim\operatorname{Poisson}(\lambda t),\qquad \mu=\lambda t,\qquad P(T>t)=P(N(t)=0)=e^{-\lambda t}\quad(t\ge0).

Here TT is the first waiting time. Differentiating its CDF gives an exponential density. The same process has independent, identically distributed exponential interarrival times; independence is part of this process result, not something guaranteed by knowing one waiting-time distribution. Gallager, Section 2.2, Definition 2.2.2

FT(t)=1−e−λt,fT(t)=λe−λt(t≥0),E[T]=λ−1,Var⁡(T)=λ−2.F_T(t)=1-e^{-\lambda t},\qquad f_T(t)=\lambda e^{-\lambda t}\quad(t\ge0),\qquad \mathbb E[T]=\lambda^{-1},\quad\operatorname{Var}(T)=\lambda^{-2}.

For negative tt, the CDF and density are zero. The density value assigned at the single boundary point zero has no effect on probabilities. Integration by parts gives E[T]=1/λ\mathbb E[T]=1/\lambda and E[T2]=2/λ2\mathbb E[T^2]=2/\lambda^2, yielding the stated variance. Pishro-Nik, Section 4.2.2, density and moments

A density is not a probability mass. For a rate of five per second, the density at zero is five per second, yet P(T=0)=0P(T=0)=0. The probability of an interval is the integral of the density. Changing seconds to minutes multiplies the numerical rate by 60 and divides the numerical duration by 60, leaving λt\lambda t and the event probability unchanged.

For finite s,t≥0s,t\ge0, divide the survival probability at s+ts+t by that at ss:

P(T>s+t∣T>s)=e−λ(s+t)e−λs=e−λt=P(T>t).P(T>s+t\mid T>s)=\frac{e^{-\lambda(s+t)}}{e^{-\lambda s}}=e^{-\lambda t}=P(T>t).

This is the memoryless property: conditional on still waiting, the remaining wait has the original distribution. It says nothing about negative durations or conditioning on a different event. It also does not say that the arrival is now overdue. Scheduled arrivals and aging equipment need not follow it. Gallager, Section 2.2.1, equations 2.4–2.5

Compute probabilities without large factorials

The program evaluates Poisson log mass with lgamma(k+1), which equals log⁡(k!)\log(k!) for nonnegative integers, and exponential probabilities with expm1 and log1p. The latter avoid subtracting nearly equal floating-point numbers when probabilities are small. The quantile solves q=1−e−λtq=1-e^{-\lambda t} for tt; passing a uniform probability into it also suggests an inverse-transform sampler. Python, mathematical functions

import math

def rate_value(rate):
    if not math.isfinite(rate) or rate <= 0:
        raise ValueError("rate must be finite and positive")
    return rate

def poisson_logpmf(k, mu):
    if type(k) is not int:
        raise ValueError("k must be an integer")
    if not math.isfinite(mu) or not 0 <= mu <= 1_000_000:
        raise ValueError("teaching implementation requires 0 <= mu <= 1e6")
    if k < 0:
        return -math.inf
    if k > 1_000_000:
        raise ValueError("teaching implementation requires k <= 1e6")
    if mu == 0:
        return 0.0 if k == 0 else -math.inf
    return -mu + k * math.log(mu) - math.lgamma(k + 1)

def exponential_cdf(x, rate):
    rate = rate_value(rate)
    if math.isnan(x):
        raise ValueError("x must not be NaN")
    if x <= 0:
        return 0.0
    return -math.expm1(-rate * x)

def exponential_quantile(q, rate):
    rate = rate_value(rate)
    if not math.isfinite(q) or not 0 <= q <= 1:
        raise ValueError("q must be in [0,1]")
    if q == 1:
        return math.inf
    return -math.log1p(-q) / rate

rate, duration = 2.0, 0.5  # arrivals/minute, minutes
mu = rate * duration
assert math.isclose(math.exp(poisson_logpmf(2, mu)), math.exp(-1)/2)
assert math.isclose(exponential_cdf(duration, rate), 1-math.exp(-1))
assert poisson_logpmf(0, 0) == 0
assert poisson_logpmf(1, 0) == -math.inf
assert exponential_cdf(-1, rate) == 0
assert exponential_cdf(math.inf, rate) == 1
assert exponential_quantile(0, rate) == 0
assert exponential_quantile(1, rate) == math.inf
for q in (1e-12, 0.25, 0.5, 0.9):
    assert math.isclose(exponential_cdf(exponential_quantile(q, rate), rate),
                        q, rel_tol=1e-12, abs_tol=1e-16)
print("two arrivals:", math.exp(poisson_logpmf(2, mu)))
print("median wait:", exponential_quantile(0.5, rate), "minutes")

Each function makes a fixed number of library calls and uses O(1)O(1) auxiliary storage for scalar machine inputs. The Poisson teaching function explicitly restricts kk and μ\mu to at most one million; this is an implementation range, not a restriction of the distribution. Log-gamma evaluation avoids factorial overflow but can still lose precision through subtraction for large parameters. Exponentiating an extremely negative log mass can underflow to zero. Keep log probabilities for such comparisons and use a tested scientific library for demanding tails.

The exponential CDF accepts infinite endpoints but rejects NaN. The quantile returns infinity at q=1q=1 and zero at q=0q=0; an infinite theoretical quantile is not a finite sampled duration. The exponential rate must be positive. A rate-zero counting process has no arrivals and infinite waiting time; it is not an ordinary exponential distribution on finite durations.

Matching the mean is not enough

Here is a concrete failure case. Draw one random integer M∼Poisson⁡(2)M\sim\operatorname{Poisson}(2) at the start. At each minute boundary, emit exactly MM arrivals. Every one-minute bin has a Poisson(2) count, but all bins share the same random count. They are dependent and contain batches, so the process is not homogeneous Poisson. A histogram of individual bins misses this defect.

Variable rates also change the variance. Suppose a one-minute window independently selects mean 1 or mean 3 with equal probability, then draws a Poisson count with that mean. The unconditional mean is 2, whereas the variance is E[μ]+Var⁡(μ)=2+1=3\mathbb E[\mu]+\operatorname{Var}(\mu)=2+1=3. This original mixture example shows how heterogeneity can produce overdispersion, variance exceeding the mean. A large sample variance alone does not identify its cause or prove a model false; sampling variation, differing exposure durations, trends, and dependence require separate checks.

A nonhomogeneous Poisson process can retain independent increments while allowing time-varying intensity. Its window mean is the integrated intensity, and its waiting survival need not be a constant-rate exponential. For burst dependence or intervals with recovery periods, other point-process or renewal models may be needed. Gallager, Chapter 2, Section 2.4

Predict, then check the units

  1. With rate two per minute, what is the probability of exactly two arrivals in half a minute? Answer: the mean is μ=1\mu=1, giving e−1/2≈0.1839e^{-1}/2\approx0.1839. Substituting rate 2 directly as the interval mean answers a different question.
  2. After waiting one minute with no arrivals in this model, what is the probability of waiting at least another half-minute? Answer: e−1≈0.3679e^{-1}\approx0.3679. The result conditions on still waiting and uses the homogeneous Poisson assumption.
  3. For an exponential rate of five per second, what is P(0<T≤0.1)P(0<T\le0.1)? Answer: 1−e−0.5≈0.39351-e^{-0.5}\approx0.3935. The density can exceed one while this integrated probability stays below one.
  4. Is the median wait equal to the mean wait when the rate is two per minute? Answer: no. The median is log⁡(2)/2≈0.3466\log(2)/2\approx0.3466 minutes; the mean is 1/21/2 minute. The right tail pulls the mean above the median.

Connect distributions through a mechanism

A binomial count approaches a Poisson law when the number of independent opportunities grows while their success probabilities shrink and the mean tends to a fixed value. That limit explains one route to the model; it does not validate independence in an observed event stream. Pishro-Nik, Section 11.1.2, binomial limit theorem

Poisson regression models a conditional count mean, often including exposure time. Exponential waiting times provide a constant-hazard baseline for survival models and event-driven simulation. In either setting, assess counts, timing, and dependence separately. Two algorithms can fit a mean equally well while predicting very different long waits or bursts, which can matter more than their average prediction error.

Make a prediction, then check

A homogeneous Poisson process has rate 2 arrivals per minute. How do you compute exactly 2 arrivals in half a minute?

Choose one answer

Learning objectives

  • Distinguish rate λ, interval mean λt, discrete mass, and continuous density, with consistent time units.
  • Derive exponential waiting and memorylessness under a homogeneous Poisson process and explain why Poisson marginals alone are insufficient.
  • Compute log probabilities and quantiles, checking numerical and modeling boundaries with high-precision recurrence, integration, and counterexamples.

Prerequisites & connections

Explore related knowledge →

References

  1. SciPy — scipy.stats.poisson
    SciPy developers
  2. Introduction to Probability, Statistics, and Random Processes — Section 11.1.2: Basic Concepts of the Poisson Process
    Hossein Pishro-Nik · 2014
  3. Discrete Stochastic Processes — Chapter 2: Poisson Processes (MIT 6.262, Spring 2011)
    Robert G. Gallager · 2011
  4. Introduction to Probability, Statistics, and Random Processes — Section 4.2.2: Exponential Distribution
    Hossein Pishro-Nik · 2014
  5. Python — math: Mathematical functions
    Python Software Foundation

Version1 · Editorial status: Recorded technical checks completed

View technical check record (AI)

Codex · 2026-09-05 · Codex multi-agent technical check: primary-source verification, derivation and numerical assertions, bilingual comparison, and review by another agent or the parent; no independent human peer review.

  • Re-derived Poisson moments, the no-arrival/wait equivalence, exponential moments, and memorylessness, with λ>0, finite nonnegative conditioning times, Poisson(0), and the zero-rate process.
  • Compared 181 log masses at μ=0.125,2,20,100 against 80-digit Decimal recurrence; checked three truncated probability sums with independent geometric tail bounds.
  • Checked the exponential CDF with composite Simpson integration and Decimal exponentials; verified unit conversion, memorylessness, quantile endpoints, and invalid inputs.
  • Recomputed the mixture mean 2 and variance 3, and variance 8 from repeating one Poisson(2) count across two windows; compared bilingual prose, display math, code, and four exercises.
  • The parent reviewed rate versus interval mean, independent/stationary increments, memoryless waiting times, overdispersion from mixing, and code boundary policies.
  • The parent executed all 25 independent probability checks; bilingual code, display equations, main anchors, sources and exercises were additionally compared.
  • Static rendering found unprocessed answer emphasis adjacent to Chinese text; explicit strong tags now preserve all answer text, values and formulas.

Source locations checked:

Related topics

No matches. Try a synonym or acronym.

0 results shown

Wrap the whole query in double quotes for a phrase match.