Consider a model with two binary stochastic nodes $x_0,x_1$ with probability of being on of $P(x_0), P(x_1)$ respectively.
When $x_i$ is in its on state it sends probability $u_0$ to some other variable, let's call it $y$.
We define the value of $y$ as being the product of all incoming probabilities, and if there are none then the value of $y$ is 1.0 (the null product).
In sum:
$y = \prod_{i:x_i = on} u_i \tag{1}$
A single stochastic sample of the model is given by:
$y{_k} = u_0^{x_0}u_1^{x_1} \tag{2}$
Where the $x_i$ are binary samples from the $P(x_i)$, and thus have values 0 or 1 for the off and on states respectively.
An approximation for the expected value of y can be obtained by averaging over a sufficiently large number of samples:
$\mathbb{E}[y] \approx \frac{1}{n} \sum_k y_k \tag{3}$
What is the exact expected value of y?
In this simple model we can obtain an exact value by enumerating over all possible combinations of the $x_i$, as follows:
$\mathbb{E}[y] = u_0 [P(x_0) - P(x_0)P(x_1)] + \\ u_1 [P(x_1) - P(x_0)P(x_1)] + \\ u_0 u_1 P(x_0)P(x_1) + \\ 1-P(x_0)P(x_1) \tag{4}$
However, the number of combinations to enumerate rapidly becomes impractical with increasing numbers of $x_i$. Are there efficient ways of finding $\mathbb{E}[y]$ or a good approximation?