from typing import Counter
import random


def pick_tribute(population, previous_tributes, seed=None):
    """Pick a tribute. May the odds be ever in your favor.

    Parameters
    ----------
    population : list
        List of all the choices to choose from.

    previous_tributes : list
        List of previous tributes to be considered.
        Duplicates are allowed. In fact, the more duplicates are detected
        for a choice, the lower the chance that choice is picked.

    seed : int, optional
        Random seed for reproducibility.

    Returns
    -------
    tribute
        Selected tribute from ``population``.

    """
    population = list(set(population))  # Ensure uniqueness
    c = Counter(previous_tributes)
    max_weight = len(population)

    if max_weight == 0:
        raise ValueError('Empty population')

    weights = [max_weight if c[name] == 0 else 1 / c[name]
               for name in population]

    if seed is not None:
        random.seed(seed)

    # NOTE: k > 1 can return duplicate, so just return one
    return random.choices(population, weights=weights)[0]