# Expectation of the minimum of a continuous random variable $X$ and a discrete random variable $Y$

Let $$X\sim Exp(1)$$ and independently let $$Y$$ have the pmf $$P(Y=k)= p$$, $$P(Y = \infty) = 1-p$$, where $$k < \infty$$. I'd like to calculate $$\mathbb{E}(Z)$$, where $$Z = \min(X,Y)$$.

Usually, we tackle problems like this by first considering the cdf of $$Z$$, which I get to be

\begin{align}F_Z(z) &= F_X(z) + F_Y(z) - F_X(z)F_Y(z) \\&=\begin{cases} 0 , &z < 0\\ 1-e^{-z} & 0 \leq z < k, \\(1-e^{-z}) + p - p(1-e^{-z}) = 1 + (p-1)e^{-z} & k \leq z < \infty, \\1 & z = \infty \end{cases}\end{align}

Differentiating on each interval, I get the pdf $$f_Z(z) = e^{-z}$$ for $$0 \leq z < k$$, $$f_Z(z) = (1-p)e^{-z}$$ for $$k \leq z < \infty$$, $$f_Z(z) = 0$$ otherwise. Taking the expectation over each interval, I get a final answer of

$$\mathbb{E}(Z) = 1-(k+1)e^{-k} + (k+1)(p+1)e^{-k} = \underline{1 + p(k+1)e^{-k}}$$.

Is this answer correct? If not, why?

Is there a better way to tackle this?

We have $$\min(X,Y)\le X$$, hence we must have $$\mathbb{E}[\min(X,Y)]\le \mathbb{E}[X]=1$$ but you have obtained an expression that can be bigger than $$1$$. Hence you must have made a mistake.

Also, you did not consider the case where $$k < 0$$.

If $$k \ge 0$$: \begin{align} \mathbb{E}[Z] &= \mathbb{E}[\min(X,Y)|Y=k]Pr(Y=k) + \mathbb{E}[\min(X,Y)|Y=\infty]Pr(Y = \infty)\\ &= p\mathbb{E}[\min(X,k)] + E[X](1-p)\\ &=p \left[\int_0^k xe^{-x}\, dx + k \int_k^\infty e^{-x}\, dx \right] + (1-p)\\ &=p\left[ -xe^{-x}|_0^k + \int_0^k e^{-x}\, dx + k(-e^{-x})|_k^\infty\right] + (1-p)\\ &= p[-ke^{-k} + 1-e^{-k}+ke^{-k}]+(1-p)\\ &=p(1-e^{-k})+(1-p)\\ &=1-pe^{-k} \end{align}

If $$k < 0$$:

\begin{align} \mathbb{E}[Z] &= \mathbb{E}[\min(X,Y)|Y=k]Pr(Y=k) + \mathbb{E}[\min(X,Y)|Y=\infty]Pr(Y = \infty)\\ &= kp + (1-p)\\ &= 1+(k-1)p \end{align}

Edit:

Let's integrate your pdf:

\begin{align}\int_0^k e^{-z} \, dz + \int_k^\infty (1-p)e^{-z}\, dz&=\int_0^\infty e^{-z}\, dz - p \int_k^\infty e^{-z}\, dz\\&=1-p(1-(1-e^{-k})) \\ &= 1-pe^{-k}\end{align}

It is not a valid pdf.

• Nice explanation. – BruceET Apr 11 '20 at 5:38
• $Z$ does not have a pdf against the Lebesgue measure since it takes the value $k$ with positive probability. – Xi'an Apr 11 '20 at 8:03

This problem can be framed as a specific case of a more general result that will hold for any non-negative random variable $$Y$$, which I think will be of interest to readers. To obtain the general result, let's start by considering the random variable $$X \sim \text{Exp}(1)$$. For all $$y \geqslant 0$$ we have:

\begin{aligned} R(y) \equiv \mathbb{E}(\min(X,y)) &= \int \limits_0^\infty \min(x,y) \ \exp(- x) \ dx \\[6pt] &= \int \limits_0^y x \exp(- x) \ dx + \int \limits_y^\infty y \exp(-x) \ dx \\[6pt] &= 1 - (1+y) \exp(- y) + y \exp(- y) \\[12pt] &= 1-\exp(-y). \\[6pt] \end{aligned}

Now suppose we have a seperate non-negative random variable $$Y$$ (that is independent of $$X$$) with moment generating function $$m_Y$$. Using the law of total expectation we have:

\begin{aligned} \mathbb{E}(\min(X,Y)) &= \int \limits_{ \mathcal{Y}} \mathbb{E}(\min(X,y)) \ dF_Y(y) \\[6pt] &= \int \limits_{ \mathcal{Y}} R(y) \ dF_Y(y) \\[6pt] &= \int \limits_{ \mathcal{Y}} (1-\exp(-y)) \ dF_Y(y) \\[6pt] &= 1 - \int \limits_{ \mathcal{Y}} \exp(-y) \ dF_Y(y) \\[6pt] &= 1 - m_Y(-1). \\[6pt] \end{aligned}

That is, the expected value of the minimum is a simple function of the moment generating function of $$Y$$. In the particular case in your question you have $$m_Y(t) = p e^{tk}$$ for all $$t<0$$, so you have:

$$\mathbb{E}(\min(X,Y)) = 1 - m_Y(-1) = 1 - p e^{-k}.$$

• A very succinct answer (+1). Is there an intuitive reason/derivation for the first equality after '...with moment generating function $𝑚_𝑌$ we have:'? It doesn't seem immediately obvious – Will Apr 11 '20 at 16:14
• I have edited to specify that this is the law of total expectation. – Ben Apr 12 '20 at 0:12

Comment: Possibly-helpful hints, but not a finished analytic solution. First, as a reality check. I tried simulating this in R for $$p = 1/2$$ and $$k=2.1 > 0.$$ Also, it seems that without harm we can use $$10\,000$$ for $$\infty$$ to get a good approximation because we're looking for a minimum and the smaller value of $$Y$$ is the important one. Note $$P(X \le 50) = 1,$$ to many places.

pexp(50, 1)
[1] 1


Simulation:

set.seed(2020)
p = .5;  k = 2.1
x = rexp(10^6)
y = sample(c(k,10000), 10^6, rep=T, prob=c(p,1-p))
z = pmin(x,y)
mean(z)
[1] 0.9382071        # my aprx answ
summary(z)
Min.   1st Qu.    Median      Mean   3rd Qu.      Max.
0.000001  0.288108  0.693391  0.938207  1.385659 13.346349

1 + p*(k+1)*exp(-k)
[1] 1.203003         # your proposed answ


Addendum: For my constants, @siong's Answer (+1) gives:

1 - p*exp(-k)
[1] 0.9387718


My approach would have been as below. I'm not saying yours is wrong, but I find mine easier.

$$1 - F_Z(z) = P(Z > z) = P(\min(X,Y) > z) = P(X > z)P(Y > z) = \cdots.$$

Notice that the distribution is a mixture of discrete and continuous, with a discontinuity of the CDF at $$Z=k>0.$$

Then find the (mixture) PDF $$f_Z(z)$$ and use it to get $$E(Z).$$