On the probabilities of rankings of k populations with applications