Expectation of a random variable $\max(K-X, 0) $ Given that I have a random variable $\max\{K-X, 0\}$ where $k>0$ is a constant and $x$ is uniformly distributed on $[-K, K]$ or I guess more generally with any distribution. How does one go about finding the Expectation of such random variables? Some ideas come up to mind like I think it could be $P(K-x>0)\cdot(K-x)+P(k-x<0)\cdot0$ but that is itself a random variable. Maybe  it is obtained by taking the Expectation of this one but I can't justify that.
 A: I believe the approach you are trying to use is the Law of Total Expectation:
$$\mathbb{E}[g(X)] = \mathbb{E}[g(X) \ | \ A] \ \mathbb{P}(A) + \mathbb{E}[g(x) \ | \ A^c] \ \mathbb{P}(A^c).$$ In your case, taking $g(X) = \max(K-X,0)$ and $A$ being the event that $X \leq K,$ we get 
$$\mathbb{E}[\max(K-X)] = \mathbb{E}[\max(K-X) \ | \ X\leq K] \ \mathbb{P}(X\leq K) + \mathbb{E}[\max(K-X) \ | \ X>K] \ \mathbb{P}(X>K)$$
$$ = \mathbb{E}[K-X \ | \ X\leq K] \ \mathbb{P}(X\leq K) + \mathbb{E}[0 \ | \ X>K] \ \mathbb{P}(X>K) $$ $$= \mathbb{E}[K-X \ | \ X\leq K] \ \mathbb{P}(X\leq K)$$
If $X$ is uniform over $[-K, K]$ then by linearity of expectation this evaluates to $K.$
Another approach is to use 
$$ \mathbb{E}[g(X)] = \int_{-\infty}^{\infty} g(x) p(x) dx$$
where $p(x)$ is the density of the random variable $X.$ So in your example with $X$ uniform over $[-K, K]$ we have $$ \mathbb{E}[\max(K-x,0)] = \int^K_{-K} max(K-x, 0) \cdot \frac{1}{2K} dx = K$$
A: Hint :- Consider $Y = max(X_1,X_2)$, then $P(Y \leq y) = P(X_1 \leq y,X_2 \leq y)$. If $X_1$ and $X_2$ are independent then $P(Y \leq y) = P(X_1 \leq y).P(X_2 \leq y) = F_Y(y).$ This should be the distribution function for $Y$ and then we can proceed the expectation of $Y$.
A: In general $E\max \{K-X,0\}=E(K-X) I_{X \leq K}=KP(X  \leq K)-EXI_{X \leq K}$. In your special case this gives $E\max \{K-X,0\}=K-EX=K$
