How to consider hedging my bets in a betting game? I found this question here:

You are given the  opportunity to make money by betting a total of 100 bucks on the outcome of two  simultaneous matches:

*

*Match A is between the Pink team and the Maroon team

*Match B is between the Brown team and the Cyan team

The Pink team's probability of victory is 40%. The Brown team's probability of victory is 70%. The betting odds are

*

*Pink: 7:4

*Maroon: 2:3

*Brown: 1:4

*Cyan: 3:1

How much money do you bet on each team? You do not have to bet all 100 bucks, but your bets must be whole numbers and the total of all five blanks (bets on the four teams and the unbet amount) must sum to 100. There is no single "correct" answer, but there are many "wrong" answers. As a reminder, a hypothetical team having 2:7 odds means that if you bet 7 on that team and they win, you get your 7 bucks bet back and win an additional 2 bucks.


After normalising the payout data and assuming that I am betting size $B$ on team B, size $P$ on team P etc, then the expected winnings/profits is
$(\frac{7}{4}P)0.4 - (P \times 0.6)+ (\frac{2}{3}M)0.6 - (M \times 0.4)+(\frac{1}{4}B)0.7- (B \times 0.3)+(3C)0.3 - (C \times 0.7)+ R(unbet)$
$R(unbet)$ is the size of the unbet
Doing the multiplication and simplifying, this reduces to $0.1P + 0M - 0.125B + 0.2C$
Now since stake $M$ and $B$ has a non-positive expected profit (the coefficients) corresponding to them, I will not bet anything on them.
So expected winning reduces to $0.1P + 0.2C$, and  with $C + P + R(unbet) = 100$
Now if I want to maximise my expected winning, I will bet all $\$100$ on $C$ and nothing on $P$, but by doing so, I will also maximise my loses too right?
So how do I consider hedging my bets? Like how do I find a balance between expected winnings and loses?
How do I split my bets? $50/50$ or $40/60$ or whatever?
 A: Let $W$ be your amount of money. The key here is that you need to define your utility function $u(W)$ carefully. It can be tempting to just say "I want my expected wealth $E[W]$ to be as high as possible" (which amounts to choosing $u(W) = W$) but that also leads to very high probability of losing everything.
A simple utility function that often gives much more reasonable results is $u(W) = \ln(W)$, i.e. you aim to maximize $E[\ln(W)]$. The intuitive idea here is that if you got to play this game many times then you should be able to make your wealth grow exponentially, so we try to maximize the expected exponential growth rate. This is a common enough idea to have a Wikipedia page for the Kelly criterion, which is the formula determining how much you should bet based on this goal.
This strategy can be proven to give the optimal exponential wealth growth rate if you play the game over and over forever. In real life you'll only play finitely many times (or even only once?) but the Kelly bet sizes still give a decent heuristic way to grow your wealth without recommending crazy risks. Basically, if you want to figure out a custom utility function that describes how happy you'd be with various amounts of wealth then you can optimize expected utility and get better results, but if you don't want to think about it too hard then Kelly is a good base strategy.
Example
As an example, I'll show how to compute the Kelly bet size for the Cyan team. We have $p = P[\text{win}] = 0.3$ and $b = 3.0$, so the Kelly bet fraction is $$p - \frac q b = 0.3 - \frac {0.7}{3} = 0.0666,$$
which means you should bet $6.66\%$ of your total wealth on the Cyan team.
Similarly, for betting on Pink I find that you should bet 5.71% of your wealth. The other two teams are not profitable bets (Kelly formula recommends betting negative or zero) so you wouldn't place any money there.
