Evolutionary dynamics of science and technology