More complicated Birthday Paradox This is a variation on the birthday paradox, but never the less still within its scope.  Assuming we have sequence of 1,000,000 numbers which are from the set {1,2,3,4}  there will be some repeats.  That is to say  {1,2,3,4,3,4,1} contains a repeat of "3,4".  The length of this repeat is 2.   
If each of the numbers 1-4 is equally likely as the sequence is generated, how can we find the longest length of a repeat that has a 50% chance of appearing?    
I am also looking to find overlapping repeats, such that in the sequence {1,2,1,2,1,2} there is technically a repeat of length 4.  {1,2,1,2,,} and {,,1,2,1,2}
Additionally I am curious if there is an answer for the length of the longest repeat guaranteed to be there?
 A: For the "guaranteed" part: For length $k$, there are $10^6-k+1$ subsequences of length $k$ and there are $4^k$ possible different sequences of length $k$. hence if $4^k+k<10^6+1$ (i.e., $k\le 9$), there must be some repetition. It is not too difficult to construct an infinite periodic sequence that runs through all $4^{10}$ possible $10$-sequences preiodically, hence the first $10^6$ terms from this has no duplicate $10$-sequences, i.e., for the "guaranteed" part of the problem, $9$ is the correct answer.
Now the probabilistic part. On a party fo $\approx 10^6$ people on a planet where a year has $m$ days, we'd reasonably expect a duplicate birthday provided $$\prod_{i=0}^{10^6-1}\left(1-\frac im\right)<\frac12 $$
A rough estmate of the product (based on $m\gg 10^6$) is $$ \left(1-\frac{10^6}{2m}\right)^{10^6} = \left(1-\frac1{2m/10^6}\right)^{2m/10^6\cdot 10^{12}/2m}\approx e^{-10^{12}/2m}$$
so that we want $$m>\frac{10^{12}}{2\ln 2}\approx 7\cdot 10^{11}\approx 2.6\cdot 4^{19}.  $$
If all subsequences were independent (which they are not, but almost), this suggests that $19$ is the longest length where we'd expect a duplicate.
