It's not intuitively clear to me how the game can go on forever -- I would expect that, eventually, you would hit upon some valid pattern. The explanation in the text didn't really make sense to me. Could anyone help with this?
>> A pattern is a sequence of pebbles repeated three times in a row.
By that logic, player 2 would have lost at their fifth turn. ... And 'in a row' is open to interpretation since it is additional information to 'repeated three times'.
EDIT: Clarify that only y is nonempty.