Computing the exact distributions of some functions of the ordered multinomial counts