def sd_similarity(s1, s2):
    """
    Calculates the Brey-Curtis similarity for two samples.

    .. note:

        s1 and s2 should be the same length, and
        the sum of each sample should equal 1.

    Args:

        s1: list of frequencies for sample 1
        s2: list of frequencies for sample 2

    Results:

        float: Brey-Curtis similarity (between 0 and 1)
    """
    num = 0
    denom = 0
    for x, y in zip(s1, s2):
        num += min(x, y) > 0
        denom += min(x) > 0
        denom += min(y) > 0
    return 1.0 * num / denom
