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 ???