Once we have found a motif of a particular SP-score, we evaluate its statistical significance by calculating the number of motifs of equal or better quality expected to occur in random data with the same characteristics. Let the score of the motif of length l in question be denoted by s, and let f(b) be the zero-corrected background frequency of nucleotide (or residue) b in the input sequences, and sim(b1, b2) be the integral score computed for all residue pairs as above. We compute Pl(X), the probability distribution of scores for a motif of length l in N sequences, in the first two steps of the following, and infer the e-value of score s in the last two: