On the conditional and unconditional distributions of the number of runs in a sample from a multisymbol alphabet
Eugene F. Schuster, Gu Xiangjun · Communications in Statistics - Simulation and Computation · 1997
Let be a randomly ordered vector of length where Ni is the number of symbols of type i,i = 1, .k in . In the unconditional problem, S is the outcome of N independent trials of a multinomial experiment with k classes and has the multinomial distribution. In the conditional problem, each is a known fixed number and is a random arrangement of the N symbols. The main results in this paper are new recursion formulas for the pdf of the total number of runs, say R, in for both the unconditional and conditional problems. We also give formulas for the pdf of the number of runs of a given symbol type. Finally, we demonstrate the utility of our recursion algorithms for the pdf of R in the software system Mathematica (Mathematica is a registered trademark of Wolfram Research, Incorporated),discuss reasons that our algorithm in the conditional problem is much faster and easier to program than the 1957 algorithm of Barton and David, and correct three errors in their table.