This problem came out of a brainstorming session for ideas for reasonably short, self-contained programming problems:
An ant is walking in a straight line across the desert, leaving a periodic (i.e., repeating) pattern of equally spaced 1s and 0s (or ant-droppings and not-droppings, if you like) behind it as it moves. You are a myrmecologist-mathematician also walking in the desert, and you come upon the ant’s trail. The ant is long gone. However, depending on the pattern of its trail, which you know, you may be able to determine which direction the ant was moving.
What is the shortest possible repeating pattern left by the ant that would allow you to unambiguously determine its direction?