I am trying to come up with a generalisation of the Kelly formula for optimal fractional betting but and have hit a roadblock. The Kelly criterion is usually explained via a game that ends in 1 of 2 states (e.g. a coin flip) and gives the optimal fraction of your wealth $f$ that should be bet each round to maximise growth. I'm trying to extend this to get $f$ for a game with N possible end states.
Here's what I have so far. Each round of the game ends in 1 of N possible states. The probability of getting any $n$ result is $p_n$ ($\sum_{n=1}^N p_n = 1$) and the payout is $b_n$ such that you wealth $X$ would change by $X_1 = X_0(1 + b_n f)$ on an outcome of $n$. The expected return after each round is given by:
$$ {X_1 \over X_0} = \prod_{n=1}^N(1+b_n f)^{p_n} $$
Taking the natural log of both sides (as per the original Kelly idea):
$$ ln\left({X_1 \over X_0}\right) = \sum_{n=1}^N p_n \ln(1+b_n f) $$
Differentiating and setting to zero gives:
$$ \sum_{n=1}^N{ {p_n b_n} \over {1+b_n f}} = 0 $$
This is where I am stuck. I would like to get $f$ in terms of some function of the $b_n$ and $p_n$ terms? So far I've been unsuccessful. Any idea mathematical tools/approach I can use?
I should add there there is no functional relationship between any of the $p_n$ and $b_n$ values that could be used to simplify here (except the relationship $\sum_{n=1}^N p_n = 1$). Also note that $b_n$ can be positive or negative.
Thanks!