Kelly Criterion for a finite number of bets I am not a mathematician but I have read extensively about the Kelly Criterion and understood it well (I think at least).
Kelly criterion allows you find out the fraction f* of your bankroll that you should bet if the odds of a bet and the probability of its success are known such as to maximize the logarithmic growth rate of your account. 
For reference, the formula and derivation can be found on the wiki.
However, in real life this is hardly ever the case that a bet (even if it had positive expectancy) is available to us infinitely.
So let us say there was a limit on the number of a times you could make a bet. How can the Kelly formula be adjusted so that one could find the optimum fraction of bankroll to bet assuming there was a limit to the number of bets allowed.
For example, let's say a casino offered you a bet that for every \$1 you bet, 60% of the times you would win \$1 in addition to the 1$ bet and 40% of the time you would lose the \$1.
So according to the Kelly formula you would want to bet:
f* = (0.6 * 1 - 0.4) / 1 = 0.2

20% of your bankroll.
However, let us say I added an additional criteria that you are only allowed 10 bets or maybe even less (like 2 bets?) How can I extend the Kelly formula to calculate the optimum fraction of bank roll to bet when this new constraint is added.
Thanks in advance!
Cheers!
 A: The idealized Kelly strategy is unrealistic largely because the bet size as a fixed fraction of capital must be allowed to become arbitrarily small.  For this reason the strategy maximizes the expected logarithmic rate-of-growth and at the same time imposes a zero probability of ruin.  In realistic gambling scenarios there is a minimum allowed bet size so the second property is not preserved.
Another beneficial property, in theory, is that the expected time to reach a specified goal is asymptotically less than any other strategy (including non-proportional strategies). 
The fact that the strategy assumes no limit on the number of bets is unrealistic, of course, but only in the following sense. There can be runs of bad luck that drive capital close to zero and reversion of the running logarithmic rate-of-growth back to the expected rate may require an incredibly long time and an impractically large number of further bets.
Nevertheless, in a situation where a maximum number of bets $n$ is restricted, the same Kelly optimal fraction applies as long as the strategy is to bet a fixed fraction of wealth. Again, the optimal fraction maximizes the expected logarithm of terminal wealth (and the expected logarithmic rate-of-growth).
In your example, the outcome of each bet is a binary random variable $X_k$ where $P(X_k = 1) = p$ and $P(X_k = -1) = q= 1-p$.  Given initial capital $W_0$ the capital after $n$ bets using a fixed betting fraction $f$ is 
$$W_n = W_0(1 +f X_1)\cdots(1 + f X_n),$$
and so
$$\log \frac{W_n}{W_0} = \sum_{k=1}^n \log(1 + fX_k)$$
Since the random variables are identically distributed we have
$$\mathbb{E} \left(\log \frac{W_n}{W_0}\right) = n\left(p \log(1+f) + q\log(1-f) \right)$$
The optimal fraction $f^* \in [0,1]$ that maximizes this expectation (found by taking the derivative with respect to $f$ and equating to zero) is
$$f^* = p - q = 2p -1,$$
and this result holds for any choice of $n$.
The probability of ruin is still zero since the worst-case scenario of $n$ repeated losses results in
$$\tag{*}W_n = W_0 (1-f^*)^n = W_0 2^n(1-p)^n > 0$$
However, with a small number of bets,  the variance of potential outcomes — with the worst case (*) — may be very unappealing.  The desirable asymptotic properties of the Kelly strategy may never be seen. For example, one may run out of bets while still in a deep drawdown. 
It may be preferable to apply a strategy for achieving some goal, e.g., increasing capital by $25 \%$ while  minimizing the variance of outcomes or the probability of ruin.
If the odds are unfavorable ($p < 1/2$) then the strategy that minimizes the probability of ruin with a goal of doubling the capital is to bet everything at once.  Gambling with smaller bets allows play to continue longer (a possible objective) but in the face of unfavorable odds the probability of ruin increases.  Of course, casino owners like this phenomenon.
For more see Gambler's ruin.  
