Deductible and Policy limit I'm trying to figure out the solution to the following problem. I was working with the Adapt program for the p exam but I can't find the solution anywhere. 
Problem:
Consider an insurance policy that reimburses collision damages for an insured individual. The probability that an individual has a collision is 80%. 
Given an individual has a collision, the resulting damage is denoted by X. X has the following pdf: 
f(x)=\begin{cases}
    1/100, & \text{if $100<x<200$}.\\
    0, & \text{otherwise}.
  \end{cases}
The policy has a deductible of 20 and a policy limit of 150. Calculate the median insurance disbursement. 
Attempt:
$\Large .8*\int_{20}^{170}(x-2)*\frac{1}{100}dx + 150*S_x(170)$ 
(where $S_x$ represents the survival function)
= $\large 184.5 * .8$ 
= 147.6
 A: Just to add some details to what has already correctly explained in the previous answer. To solve this problem, we have to determine the  pdf of reimbursement amount. Let us call this amount $y$.  If I correctly interpret the data, the conditions stated in the OP imply  that:


*

*in 20% of subjects, $y=0$ (these are subjects who will not have damages);

*among the remaining 80% who will have a damage, those with damages between $100$ and $170$ dollars (i.e., 70% of the reimbursed group, and then 56% of the total initial population ) will be fully reimbursed, except for the reduction by $20$ dollars due to the deductible amount. In this subset, then $y$ is homogeneously distributed between $80$ and $150$ with probability $\frac{0.56}{70}=0.008=\frac{1}{125}$;

*among the same remaining 80% who will have a reimbursement, those with damages between $170$ and $200$  (i.e., 30% of the reimbursed group, and then 24% of the total initial population ) will  not be fully reimbursed, as they will receive a flat payment of $150$. In this subset, $y=150$ with probability $0.24$.
As a result, $y$ has the following pdf: 
f(y)=\begin{cases}
    0.20, & \text{if $y=0$}.\\
    1/125, & \text{if $80<y<150$}.\\
    0.24, & \text{if $y=150$}.\\
    0, & \text{otherwise}.
  \end{cases}
To get the median reimbursement, since an area of $0.20$ is present for $y=0$, we have to find the value $k$ that satisfies
$$\int_{80}^k \frac{1}{125}=0.30$$
This leads to 
$$ \frac{k}{125}-\frac{80}{125} =0.30$$
which directly gives $k=117.5$.
A: The following simplifying comments, based on my reading of the problem, may
help you find the answer:
20% of those ensured don't have an accident, and so get no payoff.
Of those who have 'costly' accidents, the deductible and limit will
reduce their payoff to a maximum of \$150; that's (.3)(.8) = 24% of all
those ensured. 
The remaining 100% - 20% - 24% = 56% will have a payout that is
uniformly distributed on $(80, 150)$ dollars. You can find the
median payout from there. (The exact result will depend on
whether you round payouts to whole dollars.)
A simulation of a million policy holders in R, based on my understanding of the problem, is shown below.
 m = 10^6;  pay = numeric(m)
 for (i in 1:m) {
    acc = rbinom(1,1,.8)
    cost = acc*runif(1, 100, 200)
      if (cost > 20) cost = cost-20
      if (cost > 150) cost = 150
    pay[i] = cost }
 hist(pay, br=150, prob=T)
 summary(pay)
 Min. 1st Qu.  Median    Mean 3rd Qu.    Max. 
 0.00   86.25  117.50  100.30  148.70  150.00  # Note approx median

 mean(pay==150);  mean(pay==0)
 ## 0.239709    # approx P(payout = $150)
 ## 0.200646    # approx P(no accident)
 mean(pay>=80 & pay<150)
 ## 0.559645    # approx P($80 <= payout < 150)

A histogram of the simulated distribution is shown below.

