def variance(names):
    """
    Determine a variance-like quantity for a set of strings.

    @param names: dict of <string, int>
        A set strings to find variance for, and their associated counts.
    @return: float
        A variance-like measure of how distributed the items are.
    """
    if len(names.keys()) < 2:
        return 0.0
    total_distance = 0.0
    sum_counts = 0.0
    for name_a, count_a in names.items():
        sum_counts += count_a
        for name_b, count_b in names.items():
            if name_a != name_b:
                distance_a_b = 1.0
                total_distance += distance_a_b * count_a * count_b
    return total_distance / sum_counts
