# Mean value of a (portion of an) exponential distribution satisfying a given inequality

I have some questions about exponential distributions. I have tried googling around but with no success.

Imagine we have an HTTP server which serves Web pages in $x$ milliseconds, with a mean service time $s$. In my understanding, this can be modelled using an exponential distribution, right? Now:

a) If I consider only the requests s.t. $x \leq k$ (e.g. $k=400$ ms), will these still follow an exponential distribution?

b) Is it possible to compute the mean value of $x$ for the requests, when $x \leq k$ ?

c) Are the answers for (a) and (b) the same if I consider $x \gt k$?

In my understanding, this can be modelled using an exponential distribution, right?

Perhaps - sometimes service time type distributions are reasonably close to exponential, and sometimes they aren't. What convinces you that for your particular problem, the distribution will be sufficiently close to exponentially distributed for your purposes?

If I consider only the requests s.t. $x≤k$ will these still follow an exponential distribution?

No, if the distribution without the restriction was exponential, it will be truncated exponential.

Is it possible to compute the mean value of $x$ for the requests, when $x≤k$?

Yes, it is possible to compute the conditional mean.

If the mean service time is $\mu$ (edit: that's your $s$) and you truncate at $k$ (so you only see those service times that don't exceed $k$, ignoring the others) then given that $p=e^{-k/\mu}$ is the probability that the service time exceeds $k$, the mean service time for those that don't exceed $k$ is $\mu-\frac{p}{1-p}\cdot k$.

This is readily obtained in several ways. I did it by treating the original service time as a mixture of the truncated part and the tail (the distribution beyond the truncation point), and the mean of the mixture is then the mixture-weighted average of the component means, which we then equate to $\mu$. All terms except the required mean of the truncated distribution can be written by inspection and then the resulting equation solved for the truncated-mean.

Are the answers for (a) and (b) the same if I consider $x>k$?

Yes in that they're still "No" and "Yes" but the distribution (shifted exponential) and the mean time ($k+\mu$) will be different.

• The formula for (or a pointer to) the conditional mean would be much appreciated, tnx! – Matteo Feb 17 '16 at 14:48
• I have given the formula, and added some more my answer to the last part – Glen_b Feb 17 '16 at 22:20
• Can we say that it's rather intuitive - the mean is the mean of the exponential decreased by the odds ($\frac{p}{1-p}$) of getting a service time $k$? Did you just "see" it, or did you derive it? – Antoni Parellada Feb 17 '16 at 23:43
• @Antoni I derived it using the approach I described in the answer -- by treating the original exponential as a mixture and equating the known mean to the mean of the mixture then solving for the truncated mean -- but since everything else but that value is obvious by inspection it only takes a couple of lines of simple algebra. (I then double checked by using simulation for a few values of $k/\mu$). It is nice the way the odds of exceeding the truncation point come in.. – Glen_b Feb 18 '16 at 0:38