Can cyclic shifts of ABAB and ABBA be equal?

137 Views Asked by At

Do there exist binary strings $A$ and $B$ so that:

  1. the word $ABAB$ is a cyclic shift of $ABBA$ and
  2. the word $AB$ does not equal $BA$?

Here $AB$ represents the concatenation of $A$ and $B$.

1

There are 1 best solutions below

0
On BEST ANSWER

No; note that any cyclic shift of $ABAB$ still has the property that it is some sequence repeated twice. If this is equal to $ABBA$, then the repeated sequence is equal to both $AB$ and $BA$, contradicting that these are different.