def PmfProbEqual(pmf1, pmf2):
total = <NUM_LIT:0.0><EOL>for v1, p1 in pmf1.Items():<EOL><INDENT>for v2, p2 in pmf2.Items():<EOL><INDENT>if v1 == v2:<EOL><INDENT>total += p1 * p2<EOL><DEDENT><DEDENT><DEDENT>return total<EOL>
Probability that a value from pmf1 equals a value from pmf2.

    Args:
        pmf1: Pmf object
        pmf2: Pmf object

    Returns:
        float probability