The Theory of Cultural and Social Selection