I'm trying to implement conditional probability distribution when the events of two RVs are sets. If I try to extrapolate concepts from real or categorical variables to sets things become confusing for me. In particular, for some pair of discrete RVs, $X,Y$ we can compute the conditional probability of two events by using the Bayes theorem: $$P(Y=y|X=x)=\frac{P(X=x|Y=y)P(Y=y)}{\sum_{y'\in\mathcal{Y}}P(X=x|Y=y')P(Y=y')}=\frac{f(x,y)}{\sum_{y'\in\mathcal{Y}}f(x,y')},$$ where $f(x,y)=\sum_{(x',y')\in (\mathcal{X},\mathcal{Y})}\chi(x'=x,y'=y)$ is an accumulator function giving the total number of times the specific joint event $x,y$ is observed in the sample space (i.e. the indicator function $\chi(x'=x,y'=y)$ equals one when $x'=x,y'=y$ holds). I'd like to compute such probability when events drawn by $X,Y$ are sets $X_i,Y_j$, respectively. So, how to define the corresponding $f(X_i,Y_j)$?
I've tried with: $$f(X_i,Y_i)=\sum_{j}|(X_i\cap Y_i)\cap(X_j\cap Y_j)|.$$ The motivation behind is that $X_i\cap Y_i$ provides a measure of how the attributes of both sets should be observed jointly (such as any intersection event). In turn intersecting this intersection event against other intersection events $X_j\cap Y_j$ should provide the measure of how much the joint attributes are observed through the sample space. However, I'm not sure whether this analogy is correct with respect to the usual notion of observing joint events in a sample space. Please, some one can help me to clarify/fix/prove this?
Thank you in advance