1

Given $n$ red and $n$ black cards, what is the expected length of the longest sequence after the $2n$ cards are shuffled? A sequence here is defined as the number of consecutive cards of the same color.

For example, if $n = 2$, and suppose that the shuffling results in red, black, black, red, then the longest sequence is 2.

For the $n = 2$ case, we have the following possibilities

$$ BRBR \\ RBRB \\ BRRB \\ RBBR \\ BBRR \\ RRBB \\ $$

And the expectation of the longest sequence is $1/6 * (1 + 1 + 2 + 2 + 2 + 2) = 10/6$. But I am lost on how to extend this to the generic $n$ case. Is the derivation actually straightforward/simple?

One idea that just popped up is that we can consider all possible locations at which we can form a longest sequence of $n/2. n/2 -1, n/2-2, etc...$. This seems rather tedious however but perhaps it's the only suitable approach here?

  • Intuitively I would guess something like $\log_2 n$, though simulation suggests the expectation is slightly higher than this, perhaps by a little more than $0.3$ for large $n$ – Henry Oct 05 '20 at 21:18
  • @Henry Do you think a closed form solution exists for a generic $n$? – student010101 Oct 05 '20 at 21:37
  • This should be a difficult problem. For large $n$, I expect (but I'm not sure) that it's equivalent to having independent equiprobable values. If so, see here https://math.stackexchange.com/questions/1409372/what-is-the-expected-length-of-the-largest-run-of-heads-if-we-make-1-000-flips/1409539#1409539 – leonbloy Oct 05 '20 at 21:49
  • @leonbloy's link then links to http://www.csun.edu/~hcmth031/tlroh.pdf which suggests my "a little more than $0.3$" should be closer to $\gamma \log_2( e)-\frac12 \approx 0.3327$ – Henry Oct 05 '20 at 23:03
  • @leonbloy Would it be an easier problem if it was asking for the expected average length instead? – student010101 Oct 06 '20 at 00:00
  • @student010101 I guess so (but "expected average" is the same as "expected"). – leonbloy Oct 06 '20 at 00:44
  • @leonbloy Hmm, I haven't worked out why it's the same. By expected average, I mean, e.g., consider the $n=2$ case, and consider the sequence $red, black, black, red$. The average of this is (1+2+1)/3. And then you take the expectation of all averages (in this case there should be $4!$ averages. Why is it easier btw? – student010101 Oct 06 '20 at 00:46

0 Answers0