Optimal sampling from multinomial distribution