Saturday, April 18, 2015

Hansel And Gretal

I walk in a straight line in the forest. As I walk, I leave a repeating pattern of 1's and 0's behind me.

What is the length of the shortest pattern such that if you happen along my trail, you can determine with certainty which direction I was going?

Hansel And Gretal Puzzle Solution

One solution is 010011, and is probably the shortest. In a repeating series of this pattern, we may get:

If we are to look through the sequence, we should find that we can match the pattern 010011 but not the reverse pattern, 110010. Hence we know which direction the person was travelling.