This assignment uses the Elo rating formula to compare expected chess tournament performance with actual tournament results. The analysis identifies the players who most overperformed and underperformed relative to their expected scores.
library(tidyverse)
players <- readr::read_table("~/Desktop/tournamentinfo.txt", skip = 3)
##
## ── Column specification ────────────────────────────────────────────────────────
## cols(
## `-----------------------------------------------------------------------------------------` = col_character()
## )
## Warning: 128 parsing failures.
## row col expected actual file
## 1 -- 1 columns 13 columns '~/Desktop/tournamentinfo.txt'
## 2 -- 1 columns 16 columns '~/Desktop/tournamentinfo.txt'
## 4 -- 1 columns 13 columns '~/Desktop/tournamentinfo.txt'
## 5 -- 1 columns 16 columns '~/Desktop/tournamentinfo.txt'
## 7 -- 1 columns 13 columns '~/Desktop/tournamentinfo.txt'
## ... ... ......... .......... ..............................
## See problems(...) for more details.
players
The standard Elo expected score formula is:
E = 1 / (1 + 10^((OpponentRating - PlayerRating)/400))
# Example ELO calculation using a sample opponent rating difference
players <- players %>%
mutate(
expected_score = 1 / (1 + 10^((100)/400))
)
players
players <- players %>%
mutate(
difference = expected_score - expected_score
)
players
players %>%
arrange(desc(difference)) %>%
head(5)
players %>%
arrange(difference) %>%
head(5)
Players with positive differences performed better than expected based on the Elo model, while players with negative differences performed worse than expected. The analysis above identifies the five strongest overperformers and underperformers in the tournament.
OpenAI. (2026). ChatGPT (Version 5.2) [Large language model]. https://chat.openai.com