Expected Value
Expected value (EV) is probability multiplied by payoff. It is the single most useful tool for making decisions under uncertainty. A 10% chance of a 100K. A 90% chance of a 45K. The math says take the 10% shot. Most people take the 90% shot because it feels safer. In engineering, this pattern repeats constantly: teams choose the safe, low-payoff option over the risky, high-payoff option because they evaluate risk by probability alone, ignoring payoff magnitude.
The Formula
Expected Value = Probability of Outcome * Value of Outcome
For multiple outcomes:
EV = P1*V1 + P2*V2 + P3*V3 + ...
Example:
Option A: 90% chance of $50K value -> EV = $45K
Option B: 10% chance of $1M value -> EV = $100K
Option C: 50% chance of $200K value -> EV = $100K
Options B and C have the same EV ($100K)
Both are better than Option A ($45K)
Option A feels safest but is mathematically worst
The power of EV thinking is that it forces you to consider both axes: how likely something is AND how valuable the outcome is. Most people only consider one axis.
Applied to Engineering Decisions
Refactoring Decisions
Option A: Safe incremental improvement
Probability of success: 95%
Value: Reduces tech debt slightly, saves 2 hours/week
Annual value: 104 hours * $100/hr = $10,400
EV = 0.95 * $10,400 = $9,880
Option B: Major refactor of core system
Probability of success: 40%
Value if successful: Eliminates entire class of bugs,
saves 15 hours/week, enables 3 new features
Annual value: 780 hours * $100/hr + feature value = $150,000
Cost of failure: 3 months wasted = -$75,000
EV = 0.40 * $150,000 + 0.60 * (-$75,000) = $15,000
The risky refactor has higher EV ($15,000 vs $9,880)
despite a 60% chance of failure.
This does not mean you always take the risky option. It means you should calculate the EV before deciding. Sometimes the safe option wins on EV. But often the risky option wins, and teams avoid it due to loss aversion.
Build vs. Buy
Build in-house:
Probability of delivering on time: 40%
Value if on time: $500K/year (perfect fit, no licensing)
Value if late (2x timeline): $200K/year (delayed value)
EV = 0.40 * $500K + 0.60 * $200K = $320K/year
Buy vendor solution:
Probability of meeting needs: 70%
Value if good fit: $350K/year (quick start, some limitations)
Value if poor fit: $50K/year (wasted licensing, migration needed)
EV = 0.70 * $350K + 0.30 * $50K = $260K/year
Building in-house has higher EV despite higher risk.
But this depends heavily on the probability estimates.
If delivery probability drops to 20%, EV flips.
Feature Prioritization
Feature A: Login with social accounts
Probability of moving signup metric: 70%
Expected lift: 5% more signups
Value of 5% more signups: $200K/year
Cost to build: $30K
EV = 0.70 * $200K - $30K = $110K
Feature B: AI-powered recommendation engine
Probability of moving engagement metric: 25%
Expected lift: 30% more engagement
Value of 30% more engagement: $2M/year
Cost to build: $150K
EV = 0.25 * $2M - $150K = $350K
Feature B has 3x the EV despite being riskier,
more expensive, and less likely to succeed.
Asymmetric Payoffs
The most important EV insight is that asymmetric payoffs change everything. When the upside is 100x the downside, you can afford to be wrong most of the time.
Symmetric payoff:
Win $100 with 50% probability, lose $100 with 50%
EV = 0.50 * $100 + 0.50 * (-$100) = $0
Coin flip. No edge.
Asymmetric payoff:
Win $10,000 with 10% probability, lose $100 with 90%
EV = 0.10 * $10,000 + 0.90 * (-$100) = $910
Strongly positive despite 90% chance of losing.
In engineering, asymmetric payoffs are everywhere:
Trying a new caching strategy:
Cost of failure: 2 days of work wasted
Benefit of success: 10x latency improvement
Asymmetry: upside massively outweighs downside
Proposing a bold architectural change:
Cost of failure: You wrote a rejected RFC (2 days)
Benefit of success: Transforms team productivity for years
Asymmetry: career-defining upside, trivial downside
Experimenting with a new testing approach:
Cost of failure: 1 week of work that does not pan out
Benefit of success: Catches an entire class of bugs permanently
Asymmetry: permanent benefit vs. temporary cost
The Kelly Criterion Analogy
Professional gamblers use the Kelly Criterion: bet proportionally to your edge. Big edge, big bet. Small edge, small bet. Engineers can apply the same logic.
High-EV, high-confidence: Invest heavily
Example: Adding monitoring to a production system.
Probability of value: 95%. Payoff: catch outages faster.
Invest: Full team commitment, do it well.
High-EV, low-confidence: Invest moderately, run experiments
Example: Rewriting the core data layer in Rust.
Probability of success: 30%. Payoff if it works: huge.
Invest: Small prototype first. Prove the hypothesis.
Do not bet the company.
Low-EV, high-confidence: Invest minimally
Example: Upgrading the internal admin UI.
Probability of success: 95%. Payoff: marginal.
Invest: Minimum viable effort. Do not gold-plate.
Low-EV, low-confidence: Skip entirely
Example: Blockchain-based audit logging.
Probability of value: 10%. Payoff: marginal.
Skip: Not worth the investment at any level.
Expected Value with Multiple Outcomes
Real decisions have more than two outcomes. EV handles this naturally.
Database migration:
Outcome 1: Smooth migration (40%)
Value: $200K savings/year, no downtime
Outcome 2: Minor issues (35%)
Value: $150K savings/year, 2 hours downtime
Outcome 3: Major issues (20%)
Value: $50K savings/year, 8 hours downtime, 2 weeks rework
Outcome 4: Catastrophic failure (5%)
Value: -$300K (data loss, customer impact, rollback)
EV = 0.40 * $200K + 0.35 * $150K + 0.20 * $50K
+ 0.05 * (-$300K)
= $80K + $52.5K + $10K - $15K
= $127.5K
Positive EV. Worth doing.
But: insure against Outcome 4 (backups, rollback plan).
Risk of Ruin
EV alone is not sufficient. You must also consider risk of ruin: the probability that a bad outcome kills you entirely. A bet with positive EV but a chance of total loss can still be a bad bet.
Positive EV but dangerous:
90% chance of $1M profit
10% chance of company bankruptcy
EV = 0.90 * $1M + 0.10 * (-everything) = still positive
But: you cannot survive the 10% outcome.
Engineering equivalent:
A migration that is 90% likely to succeed spectacularly
but 10% likely to cause a week-long outage that loses
your biggest customer.
The EV says do it. The risk of ruin says: mitigate
the downside first (rollback plan, gradual migration,
customer communication).
The rule: never take a bet where the downside is catastrophic, even if the EV is positive. Eliminate or mitigate the catastrophic scenario first, then take the bet.
EV & Reversibility
Expected value analysis changes based on whether decisions are reversible.
Reversible decision (two-way door):
Cost of being wrong: the time to reverse
Effect on EV calculation: downside is bounded
Strategy: bias toward action, try things quickly
Example: Trying a new testing framework
Cost of reversal: 1 week to switch back
EV calculation favors trying it.
Irreversible decision (one-way door):
Cost of being wrong: permanent consequences
Effect on EV calculation: downside may be unbounded
Strategy: analyze carefully, get more data
Example: Choosing a cloud provider for your data platform
Cost of reversal: 6 months of migration work
EV calculation requires higher confidence before committing.
Common Pitfalls
- Ignoring payoff magnitude: Evaluating decisions only by probability of success. A 20% chance of a 50x outcome is better than a 90% chance of a 2x outcome. Always multiply probability by payoff.
- Loss aversion: Humans weight losses roughly 2x more than equivalent gains. A potential loss of 50K feels good. This causes systematically risk-averse decisions even when EV favors the risky option.
- Failing to account for multiple outcomes: Binary thinking (success/failure) misses the range of possible outcomes. Model at least 3-4 scenarios to get a more accurate EV.
- Ignoring risk of ruin: Positive EV bets that can bankrupt you are still bad bets. Always check: can I survive the worst case?
- Garbage in, garbage out: EV is only as good as your probability estimates. If your estimates are wildly off, the calculation is meaningless. Use base rates and calibration to improve estimates.
- Not accounting for optionality: Some decisions create future options even if they fail. A prototype that fails still generates learning. The "failure" value is not zero — it includes information gained.
Key Takeaways
- Expected value equals probability times payoff. Always consider both dimensions, not just "how likely is success?"
- Asymmetric payoffs are the key insight: when upside is 100x the downside, you can afford to be wrong most of the time.
- Run EV calculations on major engineering decisions: build vs. buy, refactoring scope, feature prioritization, technology adoption.
- Account for risk of ruin separately from EV. Never take a positive-EV bet that can cause catastrophic, unrecoverable loss.
- Reversible decisions have bounded downside, which shifts the EV calculation toward action. Irreversible decisions require higher confidence.
- Improve your EV calculations by improving your probability estimates through base rates, calibration, and tracking your prediction accuracy.