Take a standard deck of cards, with 52 cards, 26 red and 26 black. A run is a maximum contiguous block of cards, which has the same color.
So, (,,,,...,,) has 52 runs. (,,,...,,,,,...,) has 2 runs. What is the expected number of runs, $E_{run}$ in a shuffled deck of cards?
We know that the answer to this question is 27. Source: What is the expected number of runs of same color in a standard deck of cards?
But what if we don't have 26 red and 26 black? So:
Suppose we have $x$ red and $y$ black cards, where $x+y=52.$ Prove or disprove the following:
$E_{run}$ is maximized when $x=y=26$. If not, find the pair $(x,y)$ that maximizes $E_{run}$ and find max($E_{run})$.
My concern for this problem is that $E_{run}$ may become too computationally complex to calculate when $x \neq y$. Does anybody have a general way to find it?
Using the same method in the answer to the question you linked, the expected number of runs is $$ 1 + 51\cdot \frac{2xy}{52\cdot 51} $$ Indeed, for each $n\in \{1,\dots,51\}$, the $n^\text{th}$ card is the end of a run if and only if cards number $n$ and $n+1$ are different colors. The probability that two adjacent cards are different colors is $2xy/(52\cdot 51)$; $x$ choices for the red card, $y$ choices for the black card, and $2$ choices for the order they occur. Furthermore, the last card is always the end of a run. By linearity of expectation, you can add up all of these probabilities (plus one for the last card) to get the expected number of runs.
Now, let $\delta=x-26$, so that $y=52-x=26-\delta$. The above simplies to $$ 1+\frac{(26+\delta)(26-\delta)}{26}=1+\frac{26^2-\delta^2}{26} $$ Clearly, this is maximized when $\delta=0$. This proves that the maximum expected number of runs occurs when $\delta=0$, which means $x=y=26$.