def __additions_substitutions__(d, a, b):
    """
    Compute the number of additions and substitutions for a given pair of
    boundary string positions using:

    :param d: Symmetric difference between the pair.
    :param a: Difference between the pair; A / B.
    :param b: Difference between the pair; B / A.
    :type d: set
    :type a: set
    :type b: set
    """
    additions = abs(len(a) - len(b))
    substitutions = (len(d) - additions) / 2
    return additions, substitutions
