def histogram_to_distribution(counter):
    """
    Arguments
        counter: collections.Counter

    Returns a normalized collections.Counter, converting a histogram to a probability distribution
    """
    total = sum(counter.values(), 0.0)
    if total == 0:
        return counter
    
    for key in counter:
        counter[key] /= total

    return counter