A sequential Bayesian approach to estimating the dimension of a multinomial distribution