def euclidean_distance(prev_pmf, current_pmf):
    """Calc. euclidean distance between two probability mass function (pmf). Both pmf have to have the same order
    but not the same length -> current_pmf is allowed to to be longer.
    """
    euclid_dist = 0
    for val in current_pmf:
        try:
            euclid_dist += abs(current_pmf[val] - prev_pmf[val])
        except KeyError:
            euclid_dist += current_pmf[val]
    return euclid_dist
