For a sequence with some ones and zeros, we count the number of continuous runs of equal digits in it. (For example the sequence $011001010$ has $7$ continuous runs: $0,11,00,1,0,1,0$.) Find the sum of the number of all continuous runs for all possible sequences with $2019$ ones and $2019$ zeros.
Problem
Source: 2020HKTST1 Q6
Tags: combinatorics
24.08.2019 16:25
The number of continuous runs is the number of $01$ or $10$ plus 1. Each two consecutive block has probability $\tfrac{1}{2}$ to be either $01$ or $10$. Thus the expected value of continuous runs is $\tfrac{4038-1}{2} + 1 = \tfrac{4039}{2}$. Thus the answer is $\boxed{\tfrac{4039}{2}\tbinom{4038}{2019}}$.
29.09.2019 06:54
Let be $a_1,a_2, \cdots, a_{4038}$ the sequence of $2019$ ones and $2019$ zeros. Fixing k, the number of sequences where $a_k a_{k+1} \in \{01,10\}$ is $2\cdot \tbinom{4036}{2018}$. If we count the number of blocks $01$ and $10$ that appear in all the sequences, there are $4037 \cdot 2 \cdot \tbinom{4036}{2018}= 4038 \tbinom {4037}{2019} = 2019\tbinom{4038}{2019}$. If we want to know the number of continuous runs in a sequence, we have to add $1$ to the number of the blocks $01$ and $10$. Therefore, the sum of the number of all continuous runs is $2019\tbinom{4038}{2019} + \tbinom{4038}{2019} = 2020\tbinom{4038}{2019}$ The answer is $\boxed{2020\tbinom{4038}{2019}}$
24.10.2019 20:21
The answer is indeed $2020 \cdot \binom{4038}{2019}$ (to see why, put $n=3$ and $n=2$ ). The trick is to count the total number of $10$ blocks and the $01$ blocks separately. First, notice that there are $\binom{4038}{2019}$ sequences with $2019$ $0$s and $1$s. Moreover, for any $0<i < 4038$, exactly $2 \cdot \binom{4036}{2018}$ have a $01$ or $10$ as their $i,(i+1)^{th}$ digit. Thus number of continuous runs $=\binom{4036}{2018} \cdot 8074 + \binom{4038}{2019}=\binom{4038}{2019} \cdot 2020$ after simplification, using continuous runs = number of $01/10$s $+1$. Now I have 2 questions: 1. Can someone amend the EV proof given by @2above, as combinatorial proofs using probability seem to be the most elegant ones out there... 2. Why is this in 2020 contests? I get it's for IMO 2020, but it was still conducted in mid-2019...
11.12.2019 10:46
This seems easy for Q6