def elimination_ask(X, e, bn):
assert X not in e, "<STR_LIT>"<EOL>factors = []<EOL>for var in reversed(bn.vars):<EOL><INDENT>factors.append(make_factor(var, e, bn))<EOL>if is_hidden(var, X, e):<EOL><INDENT>factors = sum_out(var, factors, bn)<EOL><DEDENT><DEDENT>return pointwise_product(factors, bn).normalize()<EOL>
Compute bn's P(X|e) by variable elimination. [Fig. 14.11]
    >>> elimination_ask('Burglary', dict(JohnCalls=T, MaryCalls=T), burglary
    ...  ).show_approx()
    'False: 0.716, True: 0.284