Longshot — the math of tail bets
A single-file, in-browser dashboard for the probability of long-shot binary
bets — the kind that pay a big multiple but rarely land. Everything runs on one
model: your true win-rate p and the market price q. From those two numbers
the sim builds four views — the law of large numbers, the expected-value math of a
single bet, a Monte-Carlo of many sequential bets, and how a confident directional
“signal” can fall out of pure noise.
One model, two numbers
Drag the p win, q price and f bet sliders in the toolbar and every view updates together:
p— your true probability of winning a single binary bet.q— the market price of the contract (it settles at $1 if you win), which is also the probability the market is implying.- edge =
p/q − 1— the expected value of $1 staked. This is your edge over the implied price.
From those fall every number on the screen:
| Quantity | Formula | In words |
|---|---|---|
| Gross payout on a win | 1/q | A 3.1¢ contract that settles at $1 pays ×32 |
| Net odds | (1 − q)/q | Profit per $1 staked, on a win |
| Breakeven win-rate | q | The p you need just to not lose money |
| EV per $1 | p/q − 1 | Positive ⇔ p > q. This is the only thing that decides whether to bet. |
| Kelly fraction | (p − q)/(1 − q) | The bankroll share that maximizes long-run growth (the sim clamps it to ±1 at the extremes) |
The single most important consequence: your expected value depends only on whether your win-rate beats the price — never on how big the payout is. The ×32 multiple is pure variance. It decides how violently the bankroll swings, not whether you should be in the trade.
The four views
Flip between the four tabs (or press v), set the engine running with space,
and hover anything for a context-aware explanation. Every control, badge,
bin, curve, marker, path and graph node answers when you point at it.
Lattice — the law of large numbers
A Galton board (quincunx). Every ball falls through 8 gates; at each gate it
goes right — a win — with probability p. The bin it lands in is how many of
the 8 bets it won, so the histogram is a live Binomial(8, p) and the running
mean settles onto 8p exactly. That convergence is the law of large numbers, and
it is the one and only thing an edge guarantees: in any single ball a +20%
edge is invisible noise; it only becomes real over thousands of repetitions.
The board also makes the payout asymmetry visible. A session profits only if
it lands right of the breakeven bin at 8·q wins — because each win pays 1/q,
you can profit while winning fewer than half your bets. At the default p = 0.30, q = 0.25 fewer than half the sessions are green, yet the game is +20% EV.
Tail — when is a longshot worth it?
The economics of one bet. The payout frontier plots 1/q against price (the
deeper the longshot, the bigger the multiple) and overlays your EV = p/q − 1
as price sweeps — the curve crosses zero exactly where the price equals your
win-rate p. Drag q into the shaded tail zone and watch the payout balloon
while the EV stays pinned to your edge.
Below it, a price-target ridge shows where the price comes from. Each stacked
ridge is the distribution of the underlying at a longer horizon (spread grows like
√time — a random walk); the shaded tail mass beyond the strike is the
probability the bet wins, and that area is the fair price q. A deep longshot
is just a thin tail.
Equity — drawdowns and ruin
It runs a Monte-Carlo of 240 sequential-bet runs, each staking a fraction f
of a $1,000 bankroll over 120 bets at your chosen edge, on a log axis because
bankrolls compound.
With Reveal off you see only the single luckiest hero run — smooth and
up-and-to-the-right. With Reveal on you meet the other 239: the full path
cloud, the inter-quartile band, the median (what a typical run actually
lived), and the bust rate (the share that lost ≥ 90% of bankroll to gambler’s
ruin). Reading the hero as skill is survivorship bias. Crank f above the
Kelly fraction in the header and watch a genuinely +EV game still drive the median
toward zero — proof that bet sizing, not edge, is what kills people.
Signal — confidence is not accuracy
A force-directed graph of “signal nodes” relaxing into clusters around three hubs, printing a confident directional call: “P(UP) 71%”. The catch, exposed by Reveal: each node’s vote is a biased coin, and the consensus is a finite sample of those votes. When the real edge is near zero the true up-probability is ~50%, yet the sampled readout still swings to 65–75%. A confident percentage is cheap; a small noisy sample produces one every single time.
What’s precise about it
- Real distributions, computed live. The Lattice histogram is an actual
Binomial(8, p) accumulated ball by ball from a seeded RNG, with the exact PMF
C(8,k)·pᵏ·(1−p)⁸⁻ᵏoverlaid; the empirical mean provably converges to8p. - The bet math is the textbook math. Payout
1/q, net odds(1−q)/q, EVp/q − 1, breakevenp = q, and the Kelly criterionf* = (p − q)/(1 − q)for even-money-generalized binary odds. The header’s bust badge turns red exactly when over-betting makes ruin likely. - The equity cloud is a real Monte-Carlo — 240 independent compounding paths, per-step 25/50/75 percentiles, and a log-bucketed final-bankroll histogram. The “hero” really is the arg-max final.
- The signal’s confidence really is a sampling artifact. Votes are
Bernoulli(½ + edge/4); the displayed consensus is a finite subsample, so the gap between displayed confidence and true up-probability is genuine sampling error — drawn explicitly as the red slice of the gap bar under Reveal. - Everything is seeded and reproducible. The engine is exposed as
window.__SIM__;getState()returns every number so the math can be re-derived from outside.
Controls
| Key / control | Action |
|---|---|
space | Run / pause the animation (balls drop, graph relaxes, curves draw in) |
s / shift+s | Step one tick / ten ticks |
r | Reset — clear the bins, re-seed the Monte-Carlo, re-roll the graph, restore defaults |
v | Cycle the four views |
| p win slider | Your true per-bet win probability |
| q price slider | The market price (= implied probability); payout is 1/q |
| f bet slider | Bankroll fraction staked per bet — the dominant driver of ruin |
| Reveal knob | Off = only the lucky hero run and the bare consensus; on = the full truth (all paths, bust rate, sampling noise) |
| hover anything | Context-aware explanation on every control and every canvas region |
How it works under the hood
A single HTML file with inline CSS and JavaScript — no build, no server, no
external assets, runnable from a bare file://. A small IIFE holds the engine:
the two parameters, the in-flight Galton balls and bins, the cached Monte-Carlo
result (recomputed whenever a parameter changes), and the force-directed graph
state. It exposes send({ cmd }) / getState() and mirrors them on
window.__SIM__. A requestAnimationFrame loop — wrapped in try/catch so a
single draw bug can’t freeze the UI — reads the engine each frame and draws the
active view onto one 1180 × 700 logical canvas, rebuilding a registry of hover
regions so every meaningful part of every panel answers when you point at it.