Probabilistic estimation of the number of prefixes of a trace