# Optimizing profits at the racetrack

Every day, you attend a horse race between three horses. The bookie is giving fair 50%/30%/20% odds (i.e., if the third horse wins they return 1/20% = 5x), but you have inside information and know that the real chances are 70%/20%/10%. You have \$1000 total to gamble. What's your best betting strategy, and what is its payoff? Surprisingly, the best strategy is not to bet all your money on the first horse, where you have the best edge. Instead, the ideal strategy is to allocate$x$% of your money to a horse that you expect to win$x$% of the time. Here, you'd bet 70% of your money on the first horse, 20% on the second horse, and the other 10% the third horse [0]. Why wouldn't you want to bet all your money on the first horse? After all, that would give you a 70% chance of doubling up, making you back 1.4 times your money today. Our proposed strategy makes you only 1.16 times your money today, and bets on horses that you know to be worse than the bookie thinks (the second and third)! The trick is to consider your compounded returns over many days. If you bet nearly all your money on the first horse (say 98%/1%/1%) and get typical outcomes from the horses over ten days, your return is $$(98\% / 50\%) ^ 7 * (1\% / 30\%) ^ 2 * (1\% / 20\%) = 0.6\%.$$ In other words, if you started with \$1000, you ended up with \$6. The reason is that when the third horse wins, you lose 95% of your money, which blows away your doublings from the many times the first horse wins. Intuitively, when this strategy loses, it loses big. In contrast, our proposed strategy would have yielded $$(70\% / 50\%) ^ 7 * (20\% / 30\%) ^ 2 * (10\% / 20\%) = 234\%$$ by distributing money across the horses. So the best strategy for one day ("bet it all on the first horse") is terrible for many days, and a mediocre one day strategy ("bet x% on an x% probable horse") is best for many days. The most important thing to understand from this post is that the best multi-round strategy might be completely different from the best single-round strategy. The potential for compounding gains seriously shifts the best strategy. And because I can't avoid mentioning it: there's a nice piece of math hiding here. The best long-run daily return is the exponent of the KL divergence [2] of the two distributions! Here, that's roughly 1.089, for an ideal compounding profit of 8.9% per day over the long run. ### Proof Say there are$n$horses, and we participate in$r$identical rounds of betting. Let$t_i$be the true probability of horse$i$winning. Let$h_i$be the house probability on that horse. Finally$b_i$be the portion of our overall funds that we allocate to horse$i$. Let's consider the first horse ($i=1$, bookie sets house odds at$h_i = 50$%, we know that the true probability is$t_i = 70$%). We win 2x ($1/h_i$) the money we bet on that horse ($b_i$) in 70% of the$r$rounds ($t_i * r$). Putting that together, our payoff from the first horse in all$r$rounds that it wins is$(b_i/h_i)^{r t_i}$. Then our payoff from all the horses in all$r$rounds is $$\prod _{i=1}^N \left(\frac{b_i}{h_i}\right){}^{r t_i}$$ and the payoff in any given round is $$\prod _{i=1}^N \left(\frac{b_i}{h_i}\right){}^{t_i}.$$ We're looking to maximize the product of per-round profits (due to compounding), which is equivalent to maximizing the sum of their logarithms. We use Lagrangian multipliers to solve for$b_i$subject to the constraint that they sum to$1$. $$\nabla \left( \sum _{i=1}^N t_i \log \left(\frac{b_i}{h_i}\right)-\lambda \left(\sum _{i=1}^N b_i-1\right) \right) = \mathbf{0}$$ The result of this computation is that$b_i = t_i$; in other words, you should bet 70% of your money on a horse that you think is 70% likely to win [1]. Given that the house has different odds, how much money should you expect to win? Replacing$b_i$with$t_i$, we find that our money increases each round by a multiplicative factor of $$\prod _{i=1}^N \left(\frac{t_i}{h_i}\right){}^{t_i} = \exp \left( \sum _{i=1}^N t_i \log \left(\frac{t_i}{h_i}\right) \right) = \exp \mathrm{D_{KL}}(t || h).$$ In the example we started with, $$\mathrm{D_{KL}}(t || h) = 0.1 \log \left(\frac{0.1}{0.2}\right)+0.2 \log \left(\frac{0.2}{0.3}\right)+0.7 \log \left(\frac{0.7}{0.5}\right) \approx 0.085$$ and $$\exp \left( \mathrm{D_{KL}}(t || h) \right) \approx 1.089,$$ so we can book a 8.9% profit each round. ### Notes [0] In general, betting any multiple of the house distribution returns exactly your investment, so betting along 70%/20%/10% - k (50%/30%/20%) for any$k$has an identical (and optimal) return. For example, setting$k = \frac{1}{2}$, we find that betting 45%/5%/0% is also optimal. [1] You might have heard of the Kelly Criterion, which says that given a 60%/40% coin toss, you should bet 20% of your money on heads every time to maximize your profit. Our math says that you should bet 60% of your money on heads and 40% on tails. Once again these two results turn out to be equivalent, since 60%/40% - k (50%/50%) = 20%/0%, for$k = \frac{4}{5}$. [2] KL Divergence between two distributions$p$and$q\$ is given by

$$\mathrm{D_{KL}}(p || q) = \sum p_i \log \frac{p_i}{q_i}.$$ You might recognize it from statistics or machine learning.

### Sources

I produced this post as part of my work for Harvard's Physics 268, as taught by Prof. Falkovich in Fall 2022. You can find the excellent course notes here, with the content that forms the basis of this post in section 4.7.

This post also draws on Kelly's original paper, A New Interpretation of Information Rate, which frames this question in terms of perfect information about the racing outcomes transmitted through a lossy channel.