The Mathematics of Quality Score Optimisation