Conditional expectation of insurance payment I'm trying to solve the following problem:
An insurance policy is written to cover a loss, $X$, where $X$ has a uniform distribution on $(0, 1000)$. At what level must a deductible be set in order for the expected payment to be $40\%$ of what it would be with no deductible?
$X$ = total loss
$D$ = deductible
$Y$ = insurance payment  
I know that the insurance payment should be:
$$Y = \begin{cases}
  0, & \text{for } X \leq D , \\
  X - D, &\text{for } X > D.
\end{cases}
$$
So then the expected insurance payment is:
$$E[Y] = E[X - D|X >D] \cdot P[X>D]$ $
So that gives us:
$$E[Y] = \frac{1000+D}{2}\cdot\frac{1000-D}{1000}$$
After this I'm stuck. 
 A: With no deductible, the expected payment is $500$. $\frac{40}{100} \times 500 =200$. Let $d$ be the deductible. $\int\limits_{d}^{1000}\frac{(x-d)}{1000}dx=200$ so $\frac{(1000-D)^{2}}{2000}=200$, I hope I am not mistaken!
A: Your mean excess loss function is set up wrong. By definition, E[X-d|X>d]=the average payment that exceeds the deductible d given that the loss exceeds the deductible.
The original set up: (1000+d)/2 is interpreted as the value of the loss that exceeds the deductible from the insured's point of view. "The insured must incur this amount of loss in order to receive the average payment" 
The correct excess loss function: (1000-d)/2. This is the expected value of the loss that exceeds the deductible from the insurer's point of view. For this example, there exists possible payments from 0 to (1000-d), uniformly distributed. The expected value of this uniform distribution is ((1000-d)+0)/2.
In summary, the theoretical set up is correct:


*

*E[X-d|X>d]*P[X>d]=E[Y]

*To solve the problem: ((1000-d)/2)*((1000-d)/1000)=(0.4)*500


Note: mich95 sets up the problem correctly as well. If integrating (x-d) * f(x) is more intuitive, go for it. But in general, I hope this post addresses the problem with where the original equation went wrong.
