# Finding the median of a random variable

Losses under an insurance policy have the density function

$$f(x) = \begin{cases} 0.25 e^{-0.25x}, \; \; \; \; x \geq 0 \\ 0, \; \; \; \; \text{otherwise} \end{cases}$$

The deductible is $1$ for each loss. Calculate the median amount that the insurer pays a policyholder for a loss under the policy.

## Attempt

What is confusing me here is the term deductible. I believe this is the amount of money that the policyholder must pay. Since $f(x)$ is the density of the rv $X$ which is the losses. We can make another rv call it $Y$ that is that amount of money the insurer pays. Then,

$$Y = X - 1$$

And $F_Y(y) = P(Y \leq y ) = P(X-1 \leq y ) = P(X \leq y + 1 ) = F_X(y+1)$

Therefore, we want want to find $\alpha$ so that

$$F_Y(\alpha) = 0.5$$

or in other words,

$$F_X (\alpha + 1 ) = \int\limits_0^{\alpha+1} 0.25 e^{-0.25x} dx = 0.5$$

Is this a corect approach?

The client's original losses are $X \sim \mathsf{Exp}(rate = 1/4)$ with $E(X) = 4.$ However, only claims exceeding $1$ will result in payouts. So only about 77.9% of client losses will result in payouts. If you find the CDF of $X,$ you will see that $F_X(1) = P(X \le 1) = 0.2212.$ [Computation in R statistical software.]

1 - pexp(1, 1/4)
## 0.7788008


The distribution of the payouts is $Y= X|X > 1,$ and by the no-memory property of the exponential distribution, the distribution of $Y$ is again $\mathsf{Exp}(rate = 1/4).$ Then, as you say, you seek $\alpha$ such that $F_Y(\alpha) = .5.$ Thus, you can find $\alpha = 2.7726.$

qexp(.5, 1/4)
## 2.772589


Simulation: In the following simulation of a million losses $X$ (first histogram), we find $X_{adj} = X - 1$ (second histogram), and retain only losses $Y$ resulting in payouts (third histogram). The first and third histograms show the density function of $\mathsf{Exp}(\lambda=1/4).$ The vertical red line in the third is at the median.

set.seed(422);  m = 10^6;  lam=1/4
par(mfrow=c(1,3))
x = rexp(m, lam); summary(x)
Min. 1st Qu.  Median    Mean 3rd Qu.    Max.
0.000   1.153   2.776   4.002   5.547  55.216
hist(x, prob=T, br=50, col="skyblue2", main="Losses Before Deductible")

Min. 1st Qu.  Median    Mean 3rd Qu.    Max.
-1.0000  0.1526  1.7764  3.0016  4.5469 54.2163