If you want to put some fraction of your money into a risky venture, how much should you invest? In order to maximise long term wealth, the Kelly Criterion is often used to size the bet. This post shows how to derive the gambling formula from the Kelly Criterion and it’s application to different games. It can be used in a simple simulation or to maximise profits in more complicated scenarios, such as Blackjack.