comp_err function

Compute overall error rate (err) from probabilities.