About MatchProb
MatchProb is an interactive tool for exploring the mathematics of tennis scoring. Given a simple assumption about each player's probability of winning a point on serve, it computes the exact probability of winning the match from any score state.
What you can do
- Match Replay — Step through real historic matches point by point and watch the win probability shift with every rally. The timeline chart reveals how small moments can swing an entire match.
- Manual Score — Enter any score and serve probability to see the exact win probability, plus a heatmap of probabilities across all game scores in the current set.
- Adjust serve probability — Explore how even a small change in the probability of winning a point on serve amplifies through games, sets, and the match.
The mathematics
Tennis scoring is a finite Markov chain. The state of a match is fully described by the current score (points, games, sets), who is serving, and whether a tiebreak is in progress. From any non-terminal state, a single point is played: the server wins it with probability p, and the returner wins with probability 1 − p. This produces exactly two possible successor states.
The chain has absorbing states — the states where one player has won the match. All other states are transient: the match must eventually reach an absorbing state.
For a best-of-3 match the state space contains roughly 5,000 states; for best-of-5, around 12,500. Deuce games and extended tiebreaks create cycles (deuce → advantage → deuce), but we collapse these into equivalent canonical states to keep the space finite.
To find the win probability from every state, we use value iteration. Each transient state satisfies:
Terminal states have known values: 1 if Player 1 won, 0 if Player 2 won. Starting from an initial guess, we iterate the equation above until all values converge. This typically takes around 300 iterations and completes in under 100 ms in the browser — no server required.
The match replay data comes from Jeff Sackmann's point-by-point dataset, which uses a compact notation (S/R for server/returner wins) to encode thousands of professional matches.
Authors
Thore Graepel and Claude (Anthropic)
Built as a collaboration between human and AI. The mathematical model, architecture decisions, and domain knowledge were developed jointly; the code was written by Claude and reviewed by Thore.