Probability & Statistics

James Phoenix
James Phoenix

Foundational for decision-making under uncertainty.


Engineering Applications

  • A/B Testing: Confidence intervals, p-values, sample size calculations
  • Ranking Systems: Bayesian inference, prior/posterior updates
  • Error Budgets: Expected value, variance, percentiles
  • Retry Logic: Exponential backoff, jitter calculations
  • Capacity Planning: Percentile estimation, tail distributions

Key Concepts

Expected Value

E[X]=∑ixiP(xi)\mathbb{E}[X] = \sum_i x_i P(x_i)

Use for: Comparing strategies with uncertain outcomes

Variance & Standard Deviation

Var⁡(X)=E[(X−μ)2]σ=Var⁡(X)\begin{aligned}\operatorname{Var}(X) &= \mathbb{E}[(X-\mu)^2] \\ \sigma &= \sqrt{\operatorname{Var}(X)}\end{aligned}

Use for: Understanding spread of outcomes, risk assessment

Bayes’ Theorem

P(A∣B)=P(B∣A) P(A)P(B)P(A\mid B) = \frac{P(B\mid A)\,P(A)}{P(B)}

Use for: Updating beliefs with new evidence, ranking systems

Confidence Intervals

CI=xˉ±zσn\text{CI} = \bar{x} \pm z\frac{\sigma}{\sqrt{n}}

Use for: A/B testing, sample size planning


Quick Reference: Distributions

Distribution Use Case
Normal Central limit theorem, aggregates
Exponential Time between events, retry timing
Poisson Event counts per interval
Binomial Success/failure counts
Beta Probability of probability (ranking)

System Design Connections

Retry with Jitter

delay = min(cap, base * 2^attempt) + random(0, jitter)

Prevents thundering herd, smooths load.

Leanpub Book

Read The Meta-Engineer

A practical book on building autonomous AI systems with Claude Code, context engineering, verification loops, and production harnesses.

Continuously updated
Claude Code + agentic systems
View Book

Percentile Latency

p50 tells you typical experience. p99 tells you tail experience. p99.9 tells you worst-case SLO risk.


Related

Explore it visually

Topics
Data ScienceEvaluationReliability

Newsletter

Become a better AI engineer

Weekly deep dives on production AI systems, context engineering, and the patterns that compound. No fluff, no tutorials. Just what works.

Join 306K+ developers. No spam. Unsubscribe anytime.


More Insights

Cover Image for Why Unrealistic /goal Targets Keep Coding Agents Working Longer

Why Unrealistic /goal Targets Keep Coding Agents Working Longer

I used an unrealistic tutor-discovery target to keep Codex working beyond a finished-sounding handover. Here is the run, the results and the reusable prompt.

James Phoenix
James Phoenix
Cover Image for Why I Threw Away My Video Harness When Opus 5.5 Arrived

Why I Threw Away My Video Harness When Opus 5.5 Arrived

I spent £700 on video analysis. A week later, Opus 5.5 outperformed my custom harness and changed how I think about constraints, consistency and model progress.

James Phoenix
James Phoenix