$\{\sa{aa},\sa{abab},\sa{bb}\}$ cannot be avoided by a word of length at least $5$. On the contrary, $\{\sa{aa},\sa{bb}\}$ is avoided by the infinite word $(\sa{ab})^\infty$.
Set $X = \{\sa{aaa}, \sa{aba}, \sa{bb}\}$ is unavoidable because the sequence of reductions yields $\Bi$ (changed words are underlined): $\{\sa{aaa},\underline{\sa{aba}},\sa{bb}\} \rightarrow \{\underline{\sa{aaa}},\sa{ab},\sa{bb}\} \rightarrow \{\sa{aa}, \underline{\sa{ab}}, \sa{bb}\} \rightarrow \{\underline{\sa{aa}}, \sa{a}, \sa{bb}\} \rightarrow \{\sa{a},\underline{\sa{bb}}\} \rightarrow \Bi.$
Problem 57: Avoidability of Binary Words |
Some patterns occur in all long enough words. They are said to be unavoidable. The notion obviously depends on the alphabet size and in the problem we consider binary patterns.
A word $w$ is said to avoid a set $X$ of words if no factor of $w$ belongs to $X$. The set $X$ is said to be avoidable if there is an infinite word avoiding it, or equivalently on a finite alphabet, if there are infinitely any words avoiding it. The goal is to test if a set of words drawn from the binary alphabet $\Bi=\{\sa{a},\sa{b}\}$ is avoidable.
To design the test we define two reductions on a set $X\subseteq\Bi^+$.
\begin{algorithmic} \WHILE{$\mbox{reduce1 or reduce2 are applicable to } X$} \STATE $X\leftarrow \mbox{reduce1}(X)$ \OR $\mbox{reduce2}(X)$ \ENDWHILE \IF{$X\ne \{\tt{a},\tt{b}\}$} \RETURN{True} \ELSE \RETURN{False} \ENDIF \end{algorithmic}