Saturday, November 13, 2010

Turtle Crawl

GEK1517 Tutorial 6 / Question 2.
Consider the turtle's movement:
F means advancing 1 unit in the firection of the turtle's head:
+ / - means, respectively, turning the turtle's head to the right / left by d degrees - the position of the turtle remains unchanged.
Take d = 90˚and start with F + F + F + F (0[th] iteration). In the subsequent steps, let the rewriting rule be
F ↦ F - F + F
(a) Sketch the first two iterations.
(b) It is observed that in the first few iterations, the turtle always returns to the same position where it starts. Does this hold for all iterations? Present the key ideas critically and carefully to support your answers.


Key Ideas:
1: As given, Iteration 0 produces a closed loop.

2: (1) applies because in Iteration 0, F is reproduced 4 times, then joined together so that each F is rotated 90 degrees to the right w.r.t. the previous F. This forms a closed square loop.

3: In every subsequent iteration, the instances of F produce identical segments.
F + F + F + F
↦ F' + F' + F' + F'
↦ F" + F" + F" + F" ...

4. In every subsequent iteration, we find 4 identical segments joined end on end, each one rotated 90 degrees right w.r.t the previous segment. This also forms a closed loop.
Fn + Fn + Fn + Fn

4. If (4) is shown to be true, proposition holds for all iterations
Summary: (1) is given, (1) requires (2), (2)⇒(4) proven, ⇒ proposition holds

-- END OF DEMONSTRATION --

Iterations 3 and 4 for your enjoyment

No comments:

Post a Comment