Skip to content
DeepForgeby svx
All problems

Bradley-Terry Home Advantage Probability

Problem

Compute the Bradley-Terry win probability for the home side including a home bonus in Elo points: 1 / (1 + 10 ** (-(rating_home + home_bonus - rating_away) / 400)).

Hint

A 100 point home bonus is worth roughly a 64 percent win probability against an even side.

Test cases

case 1
in: [1500,1500,0]
expected: 0.5
case 2
in: [1500,1500,100]
expected: 0.6400649998028851
case 3
in: [1400,1600,0]
expected: 0.2402530733520421
Starter codePython
def bt_home_win_probability(rating_home, rating_away, home_bonus):
    # Your code here
    pass

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