## Extracting the Answer

Suppose we had a single query variable *X*. After setting the evidence
variables, and eliminating the remaining variables, we end up
with confactors of the form:
*
*

and of the form
*
*

If *e* is the evidence the probability of *X=v*_{i}&e is proportional to
the product contributions of the confactors with context *X=v*_{i} and the
selection for the *X=v*_{i} value for the table.
Thus

*P(X=v*_{i} &e) `~`

PROD_{<X=vi ,pi>} p_{i}PROD_{<{} ,ti[X]>} t_{i}[v_{i}].

Then we have:

*P(X=v*_{i}|e) = (P(X=v_{i} &e))/(SUM_{vj}P(X=v_{j} &e)).

Notice that constants of proportionality of the evidence or by
removing constants (confactors with no variables) cancel in the division.
If we had multiple query variables (i.e., we wanted the marginal of the
posterior), then we still multiply the remaining confactors and renormalise.

David Poole
and Nevin Lianwen
Zhang,Exploiting Contextual
Independence In Probabilistic Inference, Journal of
Artificial Intelligence Research, 18, 2003, 263-313.