F1 has set up a new game for this season called F1 Fantasy: https://fantasy.formula1.com, and winning comes with some decent prizes:
The game has two rules
(1) Select 5 drivers and 2 constructors/teams
(2) Stay under a total cost cap of $100 million
Each driver and team is associated with a particular cost, for example, Max Verstappen costs $30 million to choose, and the Red Bull team costs $27.9 million.
F1 already tells us what choices would make up the “Dream Team,” but this team easily breaches the $100 million cost cap and cannot be chosen. In fact, the total cost for this team is $149.6 million:
We are therefore presented with a little optimization problem that gives us an opportunity for a little F1 number crunching! We want the best combination of drivers and teams without spending more than $100 million. Our criteria for the “best” drivers and teams will be their performance in 2023, in terms of number of championship points won.
Step 1: Generate a list of all possible combinations of 5 drivers and 2 teams that have a total cost of $100 million or less (we will use the cost caps themselves to identify the drivers and teams)
Our “affordable results” table, showing the number of possible combinations we can pick in the game by spending $100 million or less, looks like the below. There are 441,312 possibilities:
Step 2: Pull the driver and team championship points for 2023 and match them to each observation in the “affordable results” table. “X” is the cost cap data we already generated, and “Y” are the 2023 points won by each driver and team. We then use R’s version of vlookup to pull this into the same table.
Now we have the cost caps and points in one big table, still with 441,312 possible choices:
Step 3: Find the observation (combination of 5 drivers and 2 teams) with the maximum points won in 2023. To do this, we just make a new variable that is the sum of the points columns, and sort the entire table by this new variable:
The result is that the most points-winningest combination that can be chosen without spending more than $100 million is the following:
With $0.4 million to spare, and 1863 points for 2023 won by this combination.