Why zigzags always close up

The crucial point is that the zigs and the zags operate independently: that is, the length of a particular zig, and the angle it is at to the horizontal, don't depend at all on what the zags are doing. Thus, if you want to work out where you are after n steps of the zigzag, you can work out where the first n zigs have taken you, and where the first n zags have taken you, and combine the two results. The point of doing this is that it's much easier to work out what happens when you restrict attention to just the zigs or just the zags.

Here's an example: suppose that the zig angle is 60 degrees. Then (ignoring the zags altogether), successive zigs look like this:

So after 6 steps, the total effect of the six zigs is to have done nothing at all. Here are some other examples, with zig angles 72, 120, 144, and 117 degrees respectively


You should be able to see that the zigs get back to where they started every time the total angle they've turned is a multiple of 360 degrees. In the first example, where the zig angle q1 is 60 degrees, the zigs get back to where they started every 6 steps (since 6×60 = 360). Similarly, since 5×72 = 360, the zigs return to their starting point every 5 steps when q1 = 72.

What about when q1 = 144? This doesn't divide exactly into 360, but 5×144 = 720, which is twice 360, and so the zigs get back to their starting point every 5 steps.

For a general zig angle q1, the number of steps to return to the starting point is therefore the smallest number n which, when multiplied by q1, gives a multiple of 360. To work out what this is, we have to consider what part of 360 is already `contained' in q1: that is, the greatest common divisor (or highest common factor) of 360 and q1: this is often written gcd(360,q1). Since the gcd is already contained in q1, we only need to multiply q1 by 360/gcd(360,q1) to get a multiple of 360. That is


Number of steps for zigs to return to start is 360
gcd(360,q1)
.

Check this formula for the zig angles 60, 72, 120, and 144 shown above. How many steps does it take to return to the start when q1 = 117?

Notice that the worst possible case is that it takes 360 steps for the zigs to get back to the start: this happens when the gcd of 360 and q1 is equal to 1 (i.e. 360 and q1 have no common factors).

Now lets bring the zags back into the discussion. Suppose that the zig angle q1 is 60, and the zag angle q2 is 72. Then the zigs get back to their starting place every 6 steps, and the zags get back to their starting place every 5 steps. For the zigzag to close up, both the zigs and the zags need to be back where they started. The zigs are back home after 6, 12, 18, 24, 30, 36, ... steps, and the zags are back home after 5, 10, 15, 20, 25, 30, ... steps. Thus the first time they're both back home together is after 30 steps. You can check this out on the program below: if you set the zig angle to 60 and the zag angle to 72, the zigzag will close after 30 steps, no matter what the zag length is.

Can you find a general formula for the number of steps it takes for the zigzag to close? The formula involves greatest common divisors again. It's unlikely you'll be able to work out the answer without doing some experiments on the program above. Try out some values for the zig angle and zag angle, and notice how many steps there are in the zigzag. Pay special attention to the cases where there are fewer than 360 steps: in these cases, how many times does the number of steps divide into 360? How is this related to the zig angle and the zag angle?

When you have a guess for the answer, test it out by working out the number of steps it takes to close when the zig angle is 72 and the zag angle is 231: check your answer on the program above.


Return to main page