Expectation of a random variable $\max(K-X, 0) $

expected valueprobabilityprobability distributionsuniform distribution

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.

Best Answer

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