Cross-posted from Math Stack Exchange, where it hasn’t received an answer yet:
Let $S$ be a finite set and $n,m\in\mathbb N$. Consider the process $R=(R_i)_{i\in\mathbb N}$ where all $R_i$ are iid uniformly distributed on $S$. I am trying to tackle the probability of the event \begin{equation} A_m(n):=\{\exists_{1\leq i<j\leq m+n}: (R_i,\dots,R_{i+n-1}) = (R_j,\dots,R_{j+n-1})\} \end{equation} as $m\to\infty$. It is straight forward to prove $\lim_{m\to\infty}\mathbb P(A_m(n)) = 1$, since the event "$(R_i,\dots,R_{i+n-1})=r$ infinitely often" constitutes a lower bound for every $r\in S^n$ and has probability $1$ using Borel-Cantelli.
I am now trying to find the rate of convergence of $\mathbb P(A_m(n))$ depending on $n$ but I am struggling to do so. It is clear that when $m< n$ the probability $\mathbb P(A_m(n))$ is rather small, since there necessarily would have to be an overlap with the two windows of length $n$. Moreover by the pigeonhole principle one can prove $\mathbb P(A_m(n))=1$ for $m$ large enough. However, I am interested in the convergence rate in between.
This question is related to the Infinite Monkey Theorem for which formulas for the expected hitting time of a certain word exist. But here I do not need to hit a specific word and I don't look at the expectation. Rather I am interested in hitting any word of length $n$ twice when hitting $n+m$ keys on the keyboard.
Context The question arises when looking at functions I deemed "autoregressive". See here. I am happy to provide more context if needed.
I appreciate any sort of help/reference/hint !