# Calculate $E(Y)$ when $Y = max(X, 2\theta - X )$ [duplicate]

Calculate $$E(Y)$$ when $$Y = max(X, 2\theta - X )$$ when $$X$$ ~ $$Uniform U( 0 , 2\theta ) .$$

To this question, one of my classmates answered like this Let $$A = X , B = 2\theta - X$$

$$E(Max(A,B) = E(\frac{A+B}{2}) +E(\frac{A-B}{2})$$

$$E(Max(A,B) = E(\frac{2\theta }{2}) +E(\frac{2X + \theta }{2})$$

$$E(Max(A,B) = \theta +E(X) + E(\theta)$$

$$E(Max(A,B) = 2\theta +E(X)$$

And carried on the calculations , now , I dont know this concept of adding and subtracting A,B Can someone please explain the basis of it ???

• Hint: $2\theta-Y$ has the same distribution as $Y.$ That leads immediately to the answer with no calculation required. See stats.stackexchange.com/questions/46843 for details. The duplicate addresses your question about "adding and subtracting" random variables.