My background is in physics, not statistics, so forgive any suspect terminology or notation, but I hope the problem is clearly set out below. Secondly, my statistics is not good enough to recognize whether this problem has been asked elsewhere on the site, so please bear with me.
Suppose we have N objects. A fixed proportion 'p' are of type A, and a proportion 'q' are of type B and these are distinguishable. Objects are either A or B, but not both, so the classes are mutually exclusive.
Objects can not be any other type, and p + q = 1.
Both p and q are non-zero and less than one.
The objects are randomised by some agreed method so that they form a sequence of N objects. This might be equivalent to shuffling a deck of cards, of which a proportion p are Red and a proportion q are black.
A run of length 'c' is defined as a sequence of 'c' objects of one particular type, bounded by either objects of the different type OR the two boundaries of the sequence. For example a run of two A's could be a run of two A's bounded by B's. Or if the sequence starts AAB…., then the first two objects constitute a run of size 2.
Let ' n(c) ' be the number of runs of size 'c', within the collection.
Question: What is the probability distribution of n(c) in a randomized collection of objects?
In other words (if I have understood this correctly), what are the probabilities of such a deck having 0, 1, 2, 3, etc. runs of each possible size, c?
From this, what are...
- the expected value of n(c)
- the variance of n(c)
I have seen reference to runs within coin tosses, but I think this problem is different, in that the total proportion of each type of outcome is fixed here, whereas it is not when tossing a coin. I have also noted the other answers on runs within a deck, but these consider runs in general, of any length, rather than the distribution of runs of different lengths.