All problems
Elo Update Magnitude
Problem
Return the Elo rating change k * (score - expected) for a game where score is 1.0 for a win, 0.5 for a draw, and 0.0 for a loss. The expected score uses the standard 400-point logistic scale.
Test cases
case 1
in: [1500,1500,1,32]
expected: 16
case 2
in: [1500,1500,0,32]
expected: -16
case 3
in: [1600,1400,1,16]
expected: 3.8440491736326745
case 4
in: [1600,1400,1,0]
expected: 0
Starter codePython
def elo_update(ra, rb, score, k):
# Your code here
pass4 test cases · run your code against them in the editor