def get_built_config_distribution(built_config, minimal_diffs):
    """
    Args:
        built_config: Configuration built so far
        minimal_diffs: List of all the minimal diffs in built config space

    Returns:
        A probability distribution over blocks in the built config -- probabilities of next removal
    """

    def f(block, minimal_diffs):
        diffs_containing_block = list([x for x in minimal_diffs if block in x["built_minus_gold"]])
        return len(diffs_containing_block)

    # get counts
    scores = list([f(x, minimal_diffs) for x in built_config])
    # normalize
    if not sum(scores) == 0:
        normalized_scores = list([float(x)/float(sum(scores)) for x in scores])
    else:
        normalized_scores = scores

    return normalized_scores