def PmfProbLess(pmf1, pmf2):
 total = 0.0
 for (v1, p1) in pmf1.Items():
  for (v2, p2) in pmf2.Items():
   if (v1 < v2):
    total += (p1 * p2)
 return total

def PmfProbLess ( pmf1 , pmf2 ) : total = 0.0 for ( v1 , p1 ) in pmf1 . Items ( ) : for ( v2 , p2 ) in pmf2 . Items ( ) : if ( v1 < v2 ) : total += ( p1 * p2 ) return total
probability that a value from pmf1 is less than a value from pmf2 .