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] = Σ x_i * P(x_i)

Use for: Comparing strategies with uncertain outcomes

Variance & Standard Deviation

Var(X) = E[(X - μ)²]
σ = √Var(X)

Use for: Understanding spread of outcomes, risk assessment

Bayes’ Theorem

P(A|B) = P(B|A) * P(A) / P(B)

Use for: Updating beliefs with new evidence, ranking systems

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

Confidence Intervals

CI = x̄ ± z * (σ/√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.

Percentile Latency

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


Related

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 Computer Use Kills the Config Tax, Not the Trust Tax

Computer Use Kills the Config Tax, Not the Trust Tax

My sister hates job applications because they make her re-submit information she already has. That is the same pain as API app review, and the same agent that lives in my codebase can dissolve both. This feels insane, and it is the new default shape of the work.

James Phoenix
James Phoenix
Cover Image for Sentry Errors Should Spawn Agents on Your Own Machine

Sentry Errors Should Spawn Agents on Your Own Machine

A new production error is an event. Events should trigger work, not sit in a dashboard. So I wired Sentry to spawn a coding agent on my own hardware, point it at my exact stack, and open a draft PR with a fix.

James Phoenix
James Phoenix