A mathematical theory of natural and artificial selection