<html>
  <head>
    <title> The Big Giant Brain's Weekly Brain Teaser </title>
    <meta name="Author" CONTENT="Rick O'Hair">
    <meta name="Classification" CONTENT="O'Hair:brain teasers">
    <meta name="Copyright" CONTENT="2003 Rick O'Hair for the Big Giant Brain">
    <meta name="Description" CONTENT="This is the Big Giant Brain's Weekly Brain Teasers in HTML format.">
  </head>
  <body bgcolor="#ffffe0">
    <font color="black">
      <center>
	    <p align="justify">&nbsp</p>
	    <h1> Treasure! </h1>
      </center>

      <blockquote>
        <hr>
        <p>Our old friend, the Pirate, buried some treasure on a deserted island and
        wrote instructions for locating it on an old parchment:</p>
        <img align="left" src="pirate1.gif" height="226" width="150" alt="the pirate">
        <table bgcolor="#f5deb3" border=1 cellspacing=1 cellpadding=8><tr><td>
           <p>"On the island there be only two trees, and the remains of a
           gallows. Start at the gallows and count ye paces to walk a
           straight line to the first tree. At the tree turn 90 degrees to starboard and
           then walk fore the same number o' paces. At the point where ye stops,
           drive a spike into the ground. Return to the gallows and walk
           a straight line, counting thy paces, to the second tree. When ye reach the
           tree, turn 90 degrees to port and make the same number of paces 
           fore, driving another spike where ye stop. Dig at the point halfway
          'tween the spikes and ye will find the riches."</p></td></tr>
        </table>
        <p>Unfortunately, when our pirate returned to the island he found the gallows missing.
        Is there any way he can still get to the treasure?</p>
        <p>(A hint for you landlubbers: Starboard is right and port is left.)</p>
        <p>&nbsp;</p>

        <!-- end teaser here -->

        <!-- start answer insertion here -->
        <center>
          <p>Scroll down for the answer.</p>
        </center>

        <p align="justify">&nbsp</p>
        <p align="justify">&nbsp</p>
        <p align="justify">&nbsp</p>
        <p align="justify">&nbsp</p>
        <p align="justify">&nbsp</p>
        <p align="justify">&nbsp</p>
        <p align="justify">&nbsp</p>
        <p align="justify">&nbsp</p>
        <p align="justify">&nbsp</p>
        <p align="justify">&nbsp</p>
        <p align="justify">&nbsp</p>
        <p align="justify">&nbsp</p>
        <p align="justify">&nbsp</p>
        <p align="justify">&nbsp</p>
        <p align="justify">&nbsp</p>
        <p align="justify">&nbsp</p>
        <p align="justify">&nbsp</p>
        <p align="justify">&nbsp</p>
        <p align="justify">&nbsp</p>
        <p align="justify">&nbsp</p>
        <p align="justify">&nbsp</p>
        <p align="justify">&nbsp</p>
        <p align="justify">&nbsp</p>
        <p>The Answer:</p>

        <p>The Pirate did some experimenting with a ruler and paper, and found
        that any position for the gallows leads to the same point. However, it
        can be proven with a bit of vector algebra:</p>
        <blockquote>
          <p>Define a square grid with its origin at tree A (herein point A) tree B (point B) at 
          (0,1). Gallows G exists at arbitrary point (x,y). 
          <br />
          <br />The walk from G to A is defined as:
          <br /><tt>== (-x,-y)</tt>
          <br />
          <br />The walk from G to B can be defined as:
          <br /><tt>== (-x,-y+1)</tt>
          <br />
          <br />Let A* denote the position after turning port (left) at tree A,
          and B* denote the position reached after turning starboard (right) at tree B.
          The walk from A to A* is:
          <br /><tt>== (+y,-x)</tt>
          <br />
          <br />The walk from B to B* is:
          <br /><tt>== (-y+1,x)</tt>
          <br />
          <br />The walk from G to A* is:
          <br /><tt>== (G -&gt; A) + (A -&gt; A*)</tt>
          <br /><tt>== (-x+y , -x-y )</tt>
          <br />
          <br />The walk from G to B* is:
          <br /><tt>== (G -&gt; B) + (B -&gt; B*)</tt>
          <br /><tt>== (-x-y+1 , x-y+1)</tt>
          <br />
          <br />The walk from A* to B* is:
          <br /><tt>== (G -&gt; B*) - (G -&gt; A*)</tt>
          <br /><tt>== (-x-y+1+x-y , x-y+1+x+y)</tt>
          <br /><tt>== (1-2y , 1+2x)</tt>
          <br />
          <br />Now, the walk to the treasure is:
          <br /><tt>== (A-&gt;A*) + .5(A*-&gt;B*)</tt>
          <br />
          <br />and since the treasure is half way from A* to B*
          <br /><tt>== (+y,-x) + .5(1-2y , 1+2x)</tt>
          <br /><tt>== (+y+.5-y , -x+.5+x)</tt>
          <br /><tt>== (.5,.5)</tt>
          <br />
        </blockquote>
        <p>So stand at A, walk half way to B, turn starboard (right), walk the same distance
        straight ahead, and get digging...</p>
        <!-- end answer here -->
        <hr>
        <p><a href="http:\\www.guardiangeek.net/teasers/index.html">Back to the Brain Teasers Index</a></p>
        <small>
          <p>If you would like to submit a Brain Teaser, email it, along with
          the answer, to the <a href="mailto:teasers@guardiangeek.net">Big Giant Brain.</a>
        </small>
        <hr>
        <small>
          <center>
            <font color="#000000" face="Helvetica,arial">
              <small>
                Copyright © 2003
                <a href="http://www.guardiangeek.net/">Guardian Geek</a><br />
                <a href="mailto:info@guardiangeek.net"><i>Comments?</i></a>
              </small>
            </font>
          </center>
        </small>
      </blockquote>
    </font>
    <font color="000000" face="Helvetica,arial">
      <p><small><i>Last updated October 10<sup>th</sup>, 2003</i></small>
    </font>
  </body>
</html>

