We address the notion of dynamic, endogenous diversity and its role in theories of investment and technological innovation. We develop a formal model of an innovation arising from the combination of two existing modules with the objective to optimize the net benefits of diversity. The model takes into account increasing returns to scale and the effect of different dimensions of diversity on the probability of emergence of a third option. We obtain analytical solutions describing the dynamic behaviour of the values of the options. Next we optimize diversity by trading off the benefits of diversity (due to recombinant innovation) and the benefits associated with returns to scale. We derive conditions for optimal diversity under different regimes of returns to scale. When the investment time horizon is beyond a threshold value, the best choice becomes diversity. This threshold will be larger the higher the returns to scale.