I am calculating the expectation as follows:
e = Uniform(\'e\', 0, 1) position_pr = simplify((1/num_predictions)*((1-e)**(num_match))*((e/2)**(2-num_match)))