An analysis of a random algorithm for estimating all the matchings