As you remark, Sturmian words (encoding horizontal and vertical steps when approaching optimally from below a line of given slope by a discrete path (with steps $(1,0)$ and $(0,1)$) of $\mathbb Z^2$) solve the problem if either $p_{00}$ or $p_{11}$ is zero. In the general case, I have the impression that one can combine two Sturmian words as follows: Suppose $p_{00}\geq p_{11}$. We construct first a Sturmian sequence with the correct relative proportions $p_{00}/(1-p_{11})$ and $p_{01}/(1-p_{11})$ of subwords $00$ and $01$ (or $10$). We now replace the isolated $1'$s by $1^a$ and $1^{a+1}$ using a suitable Sturmian word in order to get the correct amount of $11$'s (the correct relative frequencies should be $p_{01}/(1-p_{00})$ and $p_{11}/(1-p_{00})$, I guess). Since this does not alter the relative proportion of subwords $00$ and $01$, this should do the job and the final word has recurrent properties.
Roland Bacher
- 17.9k
- 3
- 45
- 113