def update_dist(state, updates, dist):
    """yields outcomes updates and their probability"""
    if not isinstance(dist, list):
        dist = dist(state)
    mass = sum(dist)
    if mass < 1:
        updates.append({})
        dist.append(1 - mass)
    for u, p in zip(updates, dist):
        yield u, p
