Crawl around the cube

Weekly Problem 37 - 2010
An ant is crawling around the edges of a cube. From the description of his path, can you predict when he will return to his starting point?
Exploring and noticing Working systematically Conjecturing and generalising Visualising and representing Reasoning, convincing and proving
Being curious Being resourceful Being resilient Being collaborative

Problem



An ant crawls carefully around the edges of a cube, starting at point $P$ and in the direction of the arrow.

Image
Crawl Around the Cube


At the end of the first edge it chooses whether to go either left or right. It then turns the other way at the end of the next edge and continues like this, turning right or left alternately at the end of each successive edge.

After how many edges does the ant return to point $P$ for the first time?

If you liked this problem, here is an NRICH task which challenges you to use similar mathematical ideas.