The Elo rating: How it's used from NBA to League of Legends

Originally created for chess by Arpad Elo, the Elo rating system has become the standard rating system in many two team/player games from sports (NBA, NFL), competitive table games (Scrabble), and many video games (League of Legends, CounterStrike). 

Intuitively, a higher Elo rating represents a higher skilled player or team. If Team A and Team B play each other and r(A) > r(B) (r(X) being the Elo rating of team X), then Team A is expected to score more points. If r(A) = r(B), then both teams are expected to score the same number of points. 

In sports, the Elo rating of two teams stand as a good representation of who will win. FiveThirtyEight.com has a good breakdown of Elo in NBA and NFL. In video games, Elo drives the matchmaking process so that two teams with similar Elo scores - which means similarly skilled teams - are matched.

Once a game is concluded, each team's Elo score is updated by a factor relative to the other team's score. In other words, if a stronger team wins against a weaker team, then the stronger team's Elo would rise a small amount, and the weaker team would decrease the same amount. If the underdog wins, then their Elo would increase a larger amount, and the favoured team's score would decrease by the same larger amount. This was the reason for the creation of Elo: before Elo, a chess player who would beat many lower skilled players would have a higher ranking than a player who would have a small win rate against highly skilled players. The Elo rating system fixes this.

Formula

For Team X against Team Y, we let the Elo rating of each be r(X) and r(Y). Ultimately, after the game between these team concludes, we are going to have the following update for team X:

R(X) = 10r(X)/400

E(X) = R(X) / (R(X) + R(Y))

r'(X) = r(X) + K*(S(X) - E(X))

r(X) is the pre-game Elo rating and r'(X) is the updated Elo rating. E(X) is the expected number of points scored, from 0 to 1. S(X) is the actual result of the game, with S(X) = 1 if Team X wins, S(X) = 0 if Team X loses, and S(X) = 0.5 if it's a tie. K is a constant term, set by the respective league, and determines how significant the change in a team's updated Elo. If K is too small, a team's Elo would take a very long time to increase. On the flip side, if K is too large then a team's Elo would vary greatly. In the below example. we'll be using K = 32.

You can think of 1 as being the total points scored between both teams, so E(X) + E(Y) = 1. In the below NBA example, if E(X) = 0.62 and we say the total points scored is 82, then this breaks down to 51-31 for Team X vs Team Y. In other words, Team X scores 62% of the total points scored.

Example

Let's look at an example from the NBA. Say we have Team A, considered a strong team, with an Elo rating of 2000. Team B is considered an average team with an Elo rating of 1600. We can write this as r(A) = 2000 and r(B) = 1600. 

R(A) = 102000/400 = 100,000

R(B) = 101600/400 = 10,000


E(A) = 100,000/110,000 = 0.91

E(B) = 10,000/110,000 = 0.09

We look at the three posibilities: Team A wins, Team A loses, and Team A and B tie.

Team A wins

S(A) = 1 and S(B) = 0. The Elo ratings are updated as follows:

r'(A) = 2000 + 32(1 - 0.91) = 2000 + 32(0.09) = 2003

r'(B) = 1600 + 32(0 - 0.09) = 1600 - 32(0.09) = 1597

The favoured team won, and the Elo's were updated slightly accordingly.

Team A and B tie

S(A) = S(B) = 0.5. The Elo ratings are updated as follows:

r'(A) = 2000 + 32(0.5 - 0.91) = 2000 - 32(0.41) = 1987

r'(B) = 1600 + 32(0.5 - 0.09) = 1600 + 32(0.41) = 1613

In this case, Team A was favoured to win by a large margin. As a result, when the teams tie, Team A's Elo decreases by an amount larger than the previous update. Similarly, Team B, as the underdog, tied with a stronger team so their Elo increased.

Team A loses

S(A) = 0 and S(B) = 1. The Elo ratings are updated as follows:

r'(A) = 2000 + 32(0 - 0.91) = 2000 - 32(0.91) = 1971

r'(B) = 1600 + 32(1 - 0.09) = 1600 + 32(0.91) = 1629

Once again, Team A was favoured to win by a large margin, but this time they lost. Team B's Elo increased significantly compared to the amount it increased when it tied with Team A.