def generalized_entropy_index(distribution, alpha):
    """Genralized Entropy Index

    Args:
        distribution (list): wealth distribution of the population
        alpha (float): inequality weight, for large alpha the index is
            especially sensitive to the existence of large incomes,
            whereas for small alpha the index is especially sensitive to the
            existence of small incomes

    Returns:
        (float): Generalized Entropy Index (GE), inequality of wealth
            distribution with inequality weight alpha
            0 <= GE(aplha) < +inf,
            GE(alpha) = 0, perfect equality
    """
    n = len(distribution)
    mean_amount = sum(distribution) / n
    epsilon = 0
    for amount in distribution:
        epsilon += (amount / mean_amount) ** alpha - 1
    return epsilon / (n * alpha * (alpha - 1))