The Mathematics of Morality