# Measure Theoretic Explanation of Conditional Probability Given a Random Variable and Event

What does it mean in a rigorous measure theoretic sense to have the conditional probability of an event given a continuous random variable (or vector) and an event? As in, suppose $$A,B$$ are events and $$X$$ is a random variable. Then what does $$\mathbb{P}(B|X,A)$$ represent?

I understand given a Sigma field $$\mathcal{G}$$ then $$\mathbb{P}(B|\mathcal{G}) = \mathbb{E}[I_B|\mathcal{G}]$$ is the unique a.s. $$\mathcal{G}$$ measurable random variable such that for all $$C \in \mathcal{G}$$ then $$\mathbb{E}[\mathbb{P}(B|\mathcal{G}) I_C] = \mathbb{E}[I_B I_C]$$. Moreover, when $$\mathcal{G} = \sigma(\textbf{Y})$$ for some random vector $$\textbf{Y}$$ then we can write the conditional probability as a unique a.s. measurable function $$f$$ such that $$f(\textbf{y}) = \mathbb{P}(B|\textbf{Y}=\textbf{y})$$ for all $$\omega \in \{\textbf{Y} = \textbf{y}\}$$.

My confusion is from what $$\mathbb{P}(B|X,A)$$ represents. Specifically what does it mean to assume the event $$A$$ occurred when conditioning? Are we actually taking this as given in the conditioning somehow or is it just shorthand for writing $$\mathbb{P}(B|X=x,I_A=1)$$ / taking the conditional expectation of $$I_B$$ with repsect to $$\sigma(X, I_A)$$?. Moreover, if it is shorthand what does the expression $$\mathbb{P}(B|X,I_A=1)$$ mean?

It seems to me like you would write $$\mathbb{P}(B|X,I_A) = f(X, I_A)$$ and then $$\mathbb{P}(B|X,I_A=1)$$ is interpreted as $$\mathbb{P}(B|X,I_A=1) = f(X, 1)$$. This seems equivalent to having a joint distribution $$(X,Y)$$ and considering $$(X, y)$$ where $$y$$ is some specific value.

To make it more concrete suppose $$X,Y$$ are independent random variables and let $$B = \{X > Y\}$$, $$A = \{X>0\}$$ then what is $$\mathbb{P}(B|X, A)$$? It is fair to say it is the random variable $$f(X,1)$$ where $$\mathbb{P}(B|X,I_A) = f(X, I_A)$$ and it is only defined for $$X > 0$$ and undefined for $$X \leq 0$$ (since you can't have both $$X \leq 0$$ and $$A$$ being true). Or is that just shorthand and you should technically only ever consider $$\mathbb{P}(B|X, I_A)$$ or $$\mathbb{P}(B|X=x, A)$$ if you are being precise.

For another example, suppose $$X,Y$$ are independent random variables and let $$B = \{Y - t> X\}$$, $$A = \{Y>X\}$$. Then it feels like it should always be true that $$\mathbb{P}(B|X,A) = \frac{G_Y(X+t)}{G_Y(X)}$$ (where $$G_Y(c) = \mathbb{P}(Y \geq c)$$ is the survival function of $$Y$$) but I don't know how to reason about this for general random variables because I'm not quite sure what the conditioning on $$A$$ part represents.

I have read the chapters in Durrett's and Olaf Kallenberg's textbooks on conditional expectation and conditional probability given a Sigma field but they have not been helpful with this issue. I would greatly appreciate references to any texts that explain what this notation means.

I have also read this related question: Conditional expectation given event and random variable but still wasn't sure if $$\mathbb{E}[Y|X, A]$$ is equivalent to $$\mathbb{E}[Y|X, I_A=1]$$.

• Welcome to CV. Have you searched our site for related posts? I found a few dozen promising and closely related answers. For instance, the analysis at stats.stackexchange.com/a/506634/919 looks like it directly answers your question, and so does stats.stackexchange.com/a/233076/919, and possibly even the example at the end of stats.stackexchange.com/a/123754/919.
– whuber
Nov 28, 2023 at 18:47
• Thank you! And yes I have seen those similar posts/searched for similar ones. None of them appear to directly answer my question about what conditioning on an event and a random variable represents. Specifically, is E[Y|X, A] the same as the conditional expectation of Y conditioned on the sigma algebra generated by A and sigma(X), i.e. E[Y|sigma(A \cap sigma(X))] = E[Y|X, A] or is it something different? The closest I found to an answer is the post I linked to in my question where the person asking the question suggests an answer but no one confirmed it/the poster did not seem confident in it. Nov 28, 2023 at 19:39
• The first two links I provided directly answer that question. They show the sigma algebra explicitly and explain the conditional expectation in that context. Mathematically, the two things are different--one is a function of the sigma algebra and the other is a number (the value of that function on $A$)--but the point is that the function and the number are completely equivalent because, according to the axioms of probability, each determines the other.
– whuber
Nov 28, 2023 at 19:45
• I read those posts again and I agree that E[Y|X=x, A] is a number but I don’t think E[Y|X, A] a number? Isn’t that just a function of X? It seems like E[Y|X, I_A = 1] and E[Y|X, I_A] are random variables but E[Y|X, I_A] is defined on sigma algebra generated by X and A whereas E[Y|X, I_A = 1] is defined on the sigma algebra generated by X restricted to A (which is contained in the former one). Is that correct? It is not immediately clear to me how those two posts directly answer that? Nov 28, 2023 at 20:04
• Part of the problem seems to be miscegenation of notation. The intent evidently is to condition on the sigma-algebra determined by the bivariate random variable $(X,\mathcal I_A).$ If you could provide a context for this notation or some examples of its use by some authority we might be able to be more specific.
– whuber
Nov 28, 2023 at 20:48

If we stick to the criterion of considering $$P[B|A]=P[B|I_A=1]$$, the most logical thing would be to consider, in the same way, $$P[B|X,A]=P[B|X,I_A=1]$$.
I don't see a problem in the case $$P[X>Y|X,X>0]$$, the same thing happens as asking what is $$P[B|X=-1]$$ if $$X$$ takes only positive values.
As for $$P[Y-t>X|X=x,Y>X]$$ we have: $$P[Y-t>X|X=x,Y>X]=\frac{P[Y-t>X\cap Y>X|X=x]}{P[Y>X|X=x]}=\frac{P[Y>x+t]}{P[Y>x]}$$ In a nutshell:$$P[B|X,I_A]=\frac{P[B\cap A|X]}{P[A|X]}I_A+\frac{P[B\cap \bar A|X]}{P[\bar A|X]}I_{\bar A}=P[B|X,A]I_A+P[B|X,\bar A]I_{\bar A}$$