# Conditioning a conditional probability to a sigma algebra

Suppose I have two random variables, $X$ and $Y$, defined on the space $(\Omega,\mathcal{F},P_1)$ which can both take the values $0,1,\ldots,N$.

Suppose further I want to define the probability of an event $A$ as $P_2(A)=P_1(A|X=Y)$.

Assume the following events are independent for all $i$.

1. $A$ and $Y=i$
2. $X=i$ and $Y=i$

Also, assume that $A\subset X=i^*$ for some $i^*$.
Then $P_2(A)=\frac{P_1(A)P_1(Y=i^*)}{\sum\limits_{i=0}^NP_1(X=i)P_1(Y=i)}$.

Finally, here is my question. Assume we have a sigma algebra $\mathcal{H}\subset\mathcal{F}$ such that the events $X=i$ are all independent of $\mathcal{H}$and hence $A$ is independent of the sigma algebra as well. Then how do I find $P_2(A|\mathcal{H})$? I feel like the answer should be one of the following two things (more likely the first), but I can prove neither.

1. $\frac{P_1(A)P_1(Y=i^*|\mathcal{H})}{\sum\limits_{i=0}^NP_1(X=i)P_1(Y=i)}$
2. $\frac{P_1(A)P_1(Y=i^*|\mathcal{H})}{\sum\limits_{i=0}^NP_1(X=i)P_1(Y=i|\mathcal{H})}$

For me what makes this more difficult is working with the sigma algebra. I am not very strong on finding probabilities conditional on a sigma algebra. I understand the general theory of conditional expectations and probabilities with respect to sigma algebras but have not had actual computational practice.

Thanks for the help!

I think there are some issues with the independence assumptions.

## Independence of $A$ from $\cal{H}$

From "$\{X=i\}$ independent from $\cal{H}$" and "$A\subset \{X=i^*\}$" you cannot conclude that $A$ is independent from $\cal{H}$.

Counterexample: Let $\Omega=\{1,2,3,4\}$, $\cal{F}=2^\Omega$ and $P(\{i\})=1/4$. Let $X$ be the random variable with $\{X=0\}=\{1,2\}$ and $\{X=1\}=\{3,4\}$ and $\cal{H}$ the Sigma Algebra generated by $\{1,3\}$. $X$ is independent from $\cal{H}$ since $P(\{X=0\}\cap\{1,3\})= P(\{1\})=1/4=P(\{X=0\})P(\{1,3\})$ likewise for the other events. Let $A=\{1\}\subset \{X=0\}$ but $A$ is not independent from $\cal{H}$ because $P(\{1\}\cap\{1,3\})=1/4\neq 1/4 * 1/2$

## Independence for factoring

Even the assumption that $A$ is indeed independent from $\cal{H}$ and your stated assumption that $A$ is independent from $Y$ would not be sufficient to factor the probabilites as you wish to do. You need a stronger assumption, namely that $A$ is independent from the sigma algebra generated from the join of $\{Y=i\}$ and $\cal{H}$. The reason will be more clear from the next section but it boils down to the necessity of factoring not only pairs but triples such as $P(A\cap \{Y=i^*\}\cap H)$ where $H\in \cal{H}$.

## Actual calculation

I will demonstrate the problems with an example and assume that $\mathcal{H}$ is generated by a single event, i.e. $\mathcal{H}=\{\emptyset, H, H^c, \Omega\}.$ With $\Delta = \{\omega\mid X(\omega)=Y(\omega)\}$ the conditional probability $P_2(A\mid \mathcal{H})$ can be written as $$P_2(A\mid \mathcal{H}) = \frac{P(A\cap \Delta\cap H)}{P(\Delta\cap H)} \cdot 1_H + \frac{P(A\cap \Delta\cap H^c)}{P(\Delta\cap H^c)} \cdot 1_{H^c}.$$

Once you make all the required independence assumptions and use $A\cap\Delta = A\cap\{Y=i^*\}$ you can factor and get \begin{align} P_2(A\mid \mathcal{H}) &= \frac{P(A)}{P(\Delta)}\left( \frac{P(\{Y=i^*\}\cap H)}{P(H)} \cdot 1_H + \frac{P(\{Y=i^*\}\cap H^c)}{P(H^c)}\cdot 1_{H^c}\right)\\ &=\frac{P(A)}{P(\Delta)}P(\{Y=i^*\}\mid\mathcal{H}\})\end{align} which is indeed your first formula.

The statement should be true for the general case as well, but the proof would look rather different, since you cannot rely on the explicit presentation which is possible with such a simple Sigma Algebra.