// the chalkboard scene
The Eduardo Saverin formula.
Eduardo's chalkboard equation is real — it's Arpad Elo's rating system, used by the World Chess Federation since 1970. Plug in two ratings, pick a winner, watch the math run.
// expected score of A vs B
Eₐ = 1 / (1 + 10^((Rᵦ − Rₐ) / 400))
// new rating (Sₐ = 1 if won, 0 if lost)
R′ₐ = Rₐ + K · (Sₐ − Eₐ)
K = 32
// elo.simulate()
Dog A / Rₐ
- expected score
- 0.5000
- new rating
- 1416
- Δ
- +16
Dog B / Rᵦ
- expected score
- 0.5000
- new rating
- 1384
- Δ
- -16
// expected outcome
A 50.0%50.0% B
$ Eₐ = 1 / (1 + 10^((1400 − 1400) / 400)) = 0.5000
$ Eᵦ = 1 − Eₐ = 0.5000
$ R′ₐ = 1400 + 32 · (1 − 0.5000) = 1416 (+16)
$ R′ᵦ = 1400 + 32 · (0 − 0.5000) = 1384 (-16)