Calculation of probability and expected value