def avg_mutation_rate(alignment :list):
    """
    Counts number of POLYMORPHIC sites on an alignment.
    -> no distinction on whether mutation carried by 1 or several sequences
    Used to estimate the age of the most recent common ancester.

        Parameters:
            alignment (list): !should be a compatible segment
        Outputs:
            float: #polymorphisms / len(aln) x #seq
    """
    count = 0
    for bases in alignment:
        if len(set(bases)) > 1:
            count += 1

    return count / (len(alignment) * len(alignment[0]))