how to calculate the expected value