Skip to content
DeepForgeby svx
All problems

Elo Win Probability

Problem

Compute the Elo probability that player A beats player B: 1 / (1 + 10^((rating_b - rating_a) / 400)). Equal ratings give 0.5.

Hint

A 400-point gap corresponds to roughly a 10-to-1 expected score.

Test cases

case 1
in: [1500,1500]
expected: 0.5
case 2
in: [1600,1400]
expected: 0.7597469266479578
case 3
in: [1400,1600]
expected: 0.2402530733520421
case 4
in: [2000,1000]
expected: 0.9968476908167399
Starter codePython
def elo_win_probability(rating_a, rating_b):
    # Your code here
    pass

4 test cases · run your code against them in the editor