Suppose you have \( n \) investment opportunities, each with its own rate of return distribution. How should you allocate your resources so that you maximize your long-term return?

At first glance, it seems optimal to put everything into the investment with the highest average ROI. It is the best performer after all and so we'd expect it to do just well in the future. The issue with this allocation strategy is that it is highly susceptible to gambler's ruin. That is to say, one bad day or year in that particular investment can completely wipe your whole portfolio out. It is this multiplicative nature of the rate of return that makes investing both a highly lucrative and a highly volatile business.

So what is the correct allocation strategy so that you minimize your risk and maximize your overall return? The answer is in the generalization of the Kelly criterion.

For this first part, let's restrict the problem to that of one investment opportunity. That is to say, you have the choice of what fraction \( f \) of your portfolio to put into this one investment (keeping the rest in cash). It turns out that the optimal solution is of the form
\[ f = \frac{\mu}{\sigma^2} \]
where \( \mu \) is the mean rate of return and \( \sigma^2 \) is the standard deviation.

Suppose we start out with \( V \) dollars and this investment has a randomly distributed rate of return of \( R \) over a given time period. We wish to find the allocation fraction \( f \) that maximizes our expected long-run rate of return. Let \( r_1, r_2, \dots \) denote the portfolio return for each time period. Then our asset value after \( t \) periods is
\[ V_t = V \times (1 + r_1) \times (1 + r_2) \times \dots \times (1 + r_n) \]
As usual, multiplication is difficult, so let's maximize the expected log value
\[ \log V_t = \log V + \sum_{i=1}^t \log(1 + r_i) \]
Taking the expectation of this (letting \( X \) be a random variable representing our portfolio return), we get
\[
\begin{align*}
E[\log V_t] &= \log V + \sum_{i=1}^t E[\log(1+X)] \\
&= \log V + t \times E[\log(1+X)]
\end{align*}
\]
Since \( \log V \) and \( t \) are constant, we simply need to maximize \( E[\log(1+X)] \). Expressing \( X \) in terms \( f \) and \( R \):
\[
\begin{align*}
1 + X &= (1-f) + (1 + R) \times f \\
&= 1 + fR \\
E[\log(1+X)] &= E[\log(1 + fR)]
\end{align*}
\]
To simplify this further, we will use the second-order Taylor expansion of the logarithm \( \log(1+x) = x - \frac{1}{2} x^2 + O(x^3) \). Thus we have that
\[
\begin{align*}
E[\log(1 + fR)] &= E\left[ fR - \frac{1}{2} (fR)^2 + O((fR)^3) \right] \\
&= E[R] f - \frac{E[R^2]}{2} f^2 + O(f^3)
\end{align*}
\]
To maximize this, we take the derivative with respect to \( f \) and set it equal to 0
\[
\begin{align*}
0 &= \frac{\partial}{\partial f} E[\log(1 + fR)] \\
&= E[R] - E[R^2] f + O(f^2)
\end{align*}
\]
To a first-order approximation, we have that
\[ \boxed{f \approx = \frac{E[R]}{E[R^2]}} \]
i.e. you should allocate according to the ratio of the first and second raw moments of the distribution of returns. A quick sanity check verifies this approximation since a higher mean and lower variance leads to a higher allocation fraction.

If you have the third-moment, you can solve the quadratic to go up to a second-order approximation.

Also note that there are two other critical points for the boundaries: \( f=0 \) and \( f=1 \), which may be the correct solutions for some extreme distributions.