Let X-1... X-n be a sequence of i.i.d. positive or negative integer-valued
random variables and H-n = max(0 less than or equal toi less than or equal
toj less than or equal ton)(X-i + - - - + X-j) be the local score of the se
quence. The exact distribution of H-n is obtained using a simple Markov cha
in. This result is applied to the scoring of DNA and protein sequences in m
olecular biology.