probability function

Compute probability of words