Calculating probabilities and expected profit