
| C   | D   | value   |
|-----|-----|---------|
| c   | d   | 0.08    |
| c   | d   | 0.08    |
| c   | d   | 0.025   |
| c   | d   | 0.5     |

Definition 3 The **product** of tables f1 and f2, written f1 ⊗tf2 is a table on the union of the variables in f1 and f2 (i.e., variables(f1 ⊗tf2) = variables(f1) ∪ *variables*(f2)) defined by:
(f1 ⊗tf2)(X, Y, Z) = f1(X, Y)f2(Y, Z)
where Y is variables(f1) ∩ variables(f2), X is variables(f1) − *variables*(f2), and Z is *variables*(f2) −
variables(f1). Note that ⊗tis associative and commutative.

To construct the product of tables, fm+1 ⊗t**· · ·⊗**tfk , we union all of the variables in fm+1 . . . fk , say these are X1, . . . , Xr. Then we construct an r-dimensional table so there is an entry in the table for each combination v1, . . . , vr where vi ∈ dom(Xi). The value for the entry corresponding to v1, . . . , vr is obtained by multiplying the values obtained from each fi applied to the projection of v1, . . . , vr onto the variables of fi.

Definition 4 The **summing out** of variable Y from table f , written Y
f is the table with variables Z = *variables*(f) − {Y} such that5

$\sum_{Y}f(Z)=\sum_{V_{i}\in dom(Y)}f(Z\wedge Y=v_{i})$, where $dom(Y)=\{v_{1},\ldots,v_{s}\}$.  
Thus, to sum out Y, we reduce the dimensionality of the table by one (removing the Y dimension),
the values in the resulting table are obtained by adding the values of the table for each value of Y. Example 3 Consider eliminating B from the factors of Example 1 (representing the belief network of Figure 1), where all of the variables are Boolean. The factors that contain B, namely those factors that represent P(E|*ABCD*) and P(B|YZ), are removed from the set of factors. We construct a factor f1(A, B, C, D, E, Y, Z) = P(E|A, B,C, D) ⊗t P(B|Y, Z), thus, for example, f1(a, b, c, d, e, y,z) = P(e|a ∧ b ∧ c ∧ d)P(b|y ∧ z)
f1(a, b, c, d, e, y,z) = P(e|a ∧ b ∧ c ∧ d)P(b|y ∧ z) f1(a, b, c, d, e, y,z) = P(e|a ∧ b ∧ c ∧ d)P(b|y ∧ z) f1(a, b, c, d, e, y,z) = P(e|a ∧ b ∧ c ∧ d)P(b|y ∧ z)
and similarly for the other values of A . . . Z. We then need to sum out B from f1, producing f2(A, C, D, E, Y, Z) where, for example, f2(a, c, d, e, y,z) = f1(a, b, c, d, e, y,z) + f1(a, b, c, d, e, y,z).

f2 is then added to the set of factors. Note that the construction of f1 is for exposition only; we don't necessarily have to construct a table for it explicitly.