def rule_of_succession(kA, kB): # a.k.a. "Laplace-Bayes estimator"
    """
    Posterior probability that a term belongs to A
    given observations of this term on A and B.
    """
    return (kA + 1) / (kA + kB + 2)