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

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.

