Yale psychologists have built a mathematical model for selfishness