# jointly discrete continuous & discrete probability - conditioning on a range

Given discrete and continuous random variables, $$X$$ and $$Y$$, respectively, the following conditional probability can be computed:

$$\begin{equation} P(Y \leq y_1 | X =x) = \int_{-\infty}^{y_1} f_{Y|X}(y|x)dy \end{equation}$$

But say you wanted to compute $$P(X=x| Y \leq y_1)$$, where you're now conditioning over a range, how would you compute it using the above approach? Typically, I would compute it using Bayes rule, but I wanted to try to derive an expression analogous to the above for $$P(X=x| Y \leq y_1)$$ (one that involves integrating perhaps the pdf of $$Y$$ or a conditional pmf of $$X$$), but I can't think of how this can be done nor have I seen it in any examples (all the examples use Bayes rule). How would one do this?

\begin{align} P\left\lbrace X = x | Y \leq y\right\rbrace &= \int_{-\infty}^{\infty} P\left\lbrace X = x | Y \leq y \,\cap Y = v \right\rbrace P\left\lbrace Y = v | Y \leq y \right\rbrace dv \end{align}

Notice that it is clear that $$P\left\lbrace Y = v | Y \leq y \right\rbrace = 0$$ if $$v > y$$. Thus, when $$-\infty < v \leq y$$, we also know that $$P\left\lbrace X = x | Y \leq y \,\cap Y = v \right\rbrace = P\left\lbrace X = x | Y = v \right\rbrace$$. This implies that we must instead have that

\begin{align} P\left\lbrace X = x | Y \leq y\right\rbrace &= \int_{-\infty}^{\infty} P\left\lbrace X = x | Y \leq y \,\cap Y = v \right\rbrace P\left\lbrace Y = v | Y \leq y \right\rbrace dv \\ &= \int_{-\infty}^{y} P\left\lbrace X = x | Y = v \right\rbrace P\left\lbrace Y = v | Y \leq y \right\rbrace dv \\ &= \int_{-\infty}^{y} P\left\lbrace X = x | Y = v \right\rbrace f_{Y|Y\leq y}(v) dv \end{align}

It is with this final result that one can make progress in further working out any specific result given knowledge of $$P\left\lbrace X = x | Y = v \right\rbrace$$ and $$f_{Y|Y\leq y}(v)$$.

• Y is continuous so $P\{Y=v|\text{Any event}\} = 0$. So the first, and hence all, integrals are zero. I can only interpret the above as an intuitive way of showing why we would like to have the final result, not the actual way of getting there. Or do I misunderstand something? Jul 10, 2021 at 8:07

Another, maybe a bit more transparent, way to deal with this probability is through the definition

$$P(X=x|Y\leq y_1)=\frac{P(X=x, Y\leq y_1)}{P(Y\leq y_1)}=\frac{\int_{-\infty}^{y_1}dy f_{X,Y}(x,y)}{\int_{-\infty}^{\infty}dx\int_{-\infty}^{y_1}dy f_{X,Y}(x,y)}$$

This expression is inequivalent to $$\int_{-\infty}^{y_1}dy f_{X|Y}(x|y)$$, since the latter doesn't necessarily represent a probability measure with respect to the variable $$Y$$. However it is possible to represent this quantity, somewhat expectedly, in terms of it's Bayes' rule equivalent:

$$P(X=x|Y\leq y_1)=\frac{f_X(x)\int_{-\infty}^{y_1}dy f_{Y|X}(y|x)}{\int_{-\infty}^{\infty}dx f_X(x)\int_{-\infty}^{y_1}dy f_{Y|X}(y|x)}$$

EDIT:

If $$X$$ represents a discrete variable, then replacing $$\int dx\to\sum_{x}$$ we have that

$$P(X=x|Y\leq y_1)=\frac{P(X=x)\int_{-\infty}^{y_1}dy f_{Y|X}(y|x)}{\sum_{x} P(X=x)\int_{-\infty}^{y_1}dy f_{Y|X}(y|x)}$$

where $$P(X=x)=\int_{-\infty}^{\infty}dyf_{X,Y}(x,y)$$.

Also, if one has to write an expression with respect to only conditional probability distributions of $$X$$ and the distribution $$Y$$then one can write the expression:

$$P(X=x|Y\leq y_1)=\frac{\int_{-\infty}^{y_1}dy f_{X|Y}(x|y)f_Y(y)}{\sum_x\int_{-\infty}^{y_1}dy f_{X|Y}(x|y)f_Y(y)}$$

where $$f_Y(y)=\sum_xf_{X,Y}(x,y)$$

• I follow the first part, I think, but how does one typically obtain the joint mixed probability function, $f_{X,Y}$? Could you explain the second part in a bit more detail? In particular, is $f_X(x)$ a marginal pmf of $X$? (I'm used to $f$ representing pdfs, and P's for pmfs). Actually, it seems you are assuming $X$ is a continuous random variable here? Mar 30, 2020 at 21:10
• How one obtains the joint mixed probability distribution is dependent on the problem considered and the information available on the distribution. Conditional distributions only carry partial information, while the joint probability distribution carries all the information about the two variables, so generally, you can't determine the joint one just by knowing one conditional probability. X is in continuous formalism here, but everything can be discretized by replacing integrals over $x$ with sums. Finally, $f_X(x)=\int_{-\infty}^{\infty}dy f_{X,Y}(x,y)dy$. Mar 30, 2020 at 21:30

Look at the case for a fixed $$y$$, then integrate over the interval to account for all such $$y$$ values.

$$P(X = x | Y \leq y_1 ) = \int_{-\infty}^{y_1} P(X=x | Y = y) dy = \int_{-\infty}^{y_1} f_{X|Y = y}(x | y)dy$$

• isn't $f_{X|Y}$ supposed to be a pmf since $X$ is discrete? Mar 30, 2020 at 18:54
• $f_{X|Y}(x|y)$ is a different pmf for each value of $y$. We are integrating over the family of these pmf's for a fixed $x$ value. I'll edit the notation to make it more obvious Mar 30, 2020 at 18:59
• ahh I see. Would you determine $f_{X|Y}$ from bayes rule? Mar 30, 2020 at 19:05
• I think there's an issue with your expression because the units on the first and second terms would not match Mar 30, 2020 at 19:30
• Can you be more specific? Mar 30, 2020 at 19:55