A REAL math problem

This is a discussion on A REAL math problem within the A Brief History of Cprogramming.com forums, part of the Community Boards category; Originally posted by DrZoidberg If it is possible to find the treasure without knowing the position of the gallows that ...

  1. #16
    Registered User axon's Avatar
    Join Date
    Feb 2003
    Posts
    2,572
    Originally posted by DrZoidberg
    If it is possible to find the treasure without knowing the position of the gallows that means it doesn't matter where the gallows was located. The outcome will be the same for all starting points. So just choose one. I suggest starting in the middle between the 2 trees.
    you are correct, the starting position is rather arbitrary in this problem, but the solution is not as easy as you think. Different starting points will resultas in different amount of calculations to find the treasure. I suggest starting at the first quadrant. You can note that the relative position of the trees is arbitrary as well!

    some entropy with that sink? entropysink.com

    there are two cardinal sins from which all others spring: Impatience and Laziness. - franz kafka

  2. #17
    C++ Developer XSquared's Avatar
    Join Date
    Jun 2002
    Location
    Ontario, Canada
    Posts
    2,718
    Start at the Oak, walk half of the distance to the other tree, turn left at a right angle, and then walk the same distance. Then you're at the treasure.
    Naturally I didn't feel inspired enough to read all the links for you, since I already slaved away for long hours under a blistering sun pressing the search button after typing four whole words! - Quzah

    You. Fetch me my copy of the Wall Street Journal. You two, fight to the death - Stewie

  3. #18
    Registered User
    Join Date
    Jan 2002
    Posts
    552
    Its a fairly simple problem, although it may take a bit of calculation. Just use vectors. (Im too lazy right now to actually solve it, if no one else does it I will later)
    C Code. C Code Run. Run Code Run... Please!

    "Love is like a blackhole, you fall into it... then you get ripped apart"

  4. #19
    Registered User
    Join Date
    Jan 2002
    Posts
    552
    lol, now I see how you would use imaginary number (just replace imaginary numbers with 2d vectors)
    C Code. C Code Run. Run Code Run... Please!

    "Love is like a blackhole, you fall into it... then you get ripped apart"

  5. #20
    Registered User axon's Avatar
    Join Date
    Feb 2003
    Posts
    2,572
    Originally posted by *ClownPimp*
    lol, now I see how you would use imaginary number (just replace imaginary numbers with 2d vectors)
    you're right ClownPimp, you could also use vectors; I even think that the solution might be more elegant this way. I will post the imaginery numbers solution later tonite.

    some entropy with that sink? entropysink.com

    there are two cardinal sins from which all others spring: Impatience and Laziness. - franz kafka

  6. #21
    ... kermit's Avatar
    Join Date
    Jan 2003
    Posts
    1,528
    Originally posted by axon
    I thought that this will be the response from some. It shows a lot from a "youth leader" like yourself silvercord. How about you try the problem, but if you find it borring/stupid, ot whatever, don't make any comments.
    hmmm...maybe the 'doctor' should have followed his own advice on the addition problem post...

  7. #22
    Registered User axon's Avatar
    Join Date
    Feb 2003
    Posts
    2,572
    Originally posted by kermit
    hmmm...maybe the 'doctor' should have followed his own advice on the addition problem post...
    I did start out my answer to your post with a rather rude comment, but that is because I've seen that done way too many times on these boards...not because I didn't lilke it. Therefore my comment was not directed at the problem, but at the post as a whole.

    some entropy with that sink? entropysink.com

    there are two cardinal sins from which all others spring: Impatience and Laziness. - franz kafka

  8. #23
    Registered User axon's Avatar
    Join Date
    Feb 2003
    Posts
    2,572
    Originally posted by XSquared
    Start at the Oak, walk half of the distance to the other tree, turn left at a right angle, and then walk the same distance. Then you're at the treasure.
    what is your reasoning xsquared?

    some entropy with that sink? entropysink.com

    there are two cardinal sins from which all others spring: Impatience and Laziness. - franz kafka

  9. #24
    ... kermit's Avatar
    Join Date
    Jan 2003
    Posts
    1,528
    Originally posted by axon
    I did start out my answer to your post with a rather rude comment, but that is because I've seen that done way too many times on these boards...not because I didn't lilke it. Therefore my comment was not directed at the problem, but at the post as a whole.
    Actually, if I had known that the 'problem' had been flogged so hard on the board, I certainly never would have reposted it. I think next time I might just do a search on the board before I decide to post any similar such trivia - just to be sure that it hasn't been covered already.

  10. #25
    Registered User axon's Avatar
    Join Date
    Feb 2003
    Posts
    2,572
    Kermit: then I believe we have an understanding? cool...anyhow...try to get a solution to my problem...I'll post the solution soon.

    some entropy with that sink? entropysink.com

    there are two cardinal sins from which all others spring: Impatience and Laziness. - franz kafka

  11. #26
    ... kermit's Avatar
    Join Date
    Jan 2003
    Posts
    1,528
    Ergh...so many problems...so little time - I have been working on cleaning up a program posted on the C board - its the currency conversion program where the guy thought he had problems with arrays - I can get it to compile now, and it 'works' but just a couple of stubborn little problems. Think I will post what I have done and someone else can take it from there...

    Then maybe I will attempt your problem.

  12. #27
    C++ Developer XSquared's Avatar
    Join Date
    Jun 2002
    Location
    Ontario, Canada
    Posts
    2,718
    If the position of the gallows has no effect on the location of the treasure (T), then we can position the gallows (G) equidistant from the two trees (O and P), ans also so that OGP = 90 degrees. Therefore, if you do the construction, you will find that OGPT is a square, and that the two stakes are co-incident (same point). If you let the diagonal OP be 2, and label it's midpoint M, then OM=MP=1, and since it is a square, OP = GT, and therefore TM=MG=1. Thus, you just walk 1/2 OP from O, then turn left 90 degrees, and walk that same distance, and then start diggin.
    Naturally I didn't feel inspired enough to read all the links for you, since I already slaved away for long hours under a blistering sun pressing the search button after typing four whole words! - Quzah

    You. Fetch me my copy of the Wall Street Journal. You two, fight to the death - Stewie

  13. #28
    C++ Developer XSquared's Avatar
    Join Date
    Jun 2002
    Location
    Ontario, Canada
    Posts
    2,718
    Diagram:
    Attached Images Attached Images  
    Naturally I didn't feel inspired enough to read all the links for you, since I already slaved away for long hours under a blistering sun pressing the search button after typing four whole words! - Quzah

    You. Fetch me my copy of the Wall Street Journal. You two, fight to the death - Stewie

  14. #29
    Registered User
    Join Date
    Jan 2002
    Posts
    552
    See axon, you made it too simple by confirming that it didnt matter where the gallows was positioned. The real challenge is to show that it doesnt matter (ie, using an arbitrary starting position)
    C Code. C Code Run. Run Code Run... Please!

    "Love is like a blackhole, you fall into it... then you get ripped apart"

  15. #30
    Registered User axon's Avatar
    Join Date
    Feb 2003
    Posts
    2,572
    Yes, if I didn't say that the position of the gallows is arbitrary than the problem might have been a more tougher. Below is my solution, where the actual position of the gollows does cancel out.
    Sorry about the ugly pic, but MSPaint is the only utility on this PC...
    I haven't looked at your solution XSquared with any scrutiny yet, as time is of essence to me this morning....I will surely comment on it later tonite. Thanks to all who tried.

    //solution:

    consider the island as a plane of complex numbers; draw one axis (real)
    throught the base of the two trees, and another axis (imaginery) at
    right angles to the first, through a point half way between the trees.
    Taking one half of the distance between the trees as our unit of
    length, we can say that the oak is at the point -1 on the real axis and
    the pine at +1. We don't know the location of the gollows so lets
    call that position X.

    Since we don't know where the gollows is we must consider X as a
    complex number: X = a + bi

    The seperation in distance and direction between X and the oak can be
    denoted by (-1) - X = -(1+X). Similarly the separation between X and
    the pine us 1 - X. To turn these two distances by right angles
    clockwise and counterclocwise we must multiply them by -i and i, thus
    finding the location where we must place our spikes:
    Code:
          first spike:  (-i)[-(1+X)]+1 = i(X+1)-1
          second spike: (+i)(1-X)-1 = i(1-X)+1
    Since the treasure is halfway between the pikes, we must now find
    one half the sum of the two above comples numbers. We get:
    Code:
          (.5)[i(X+1)+1+I(1-X)-1] = (.5)[+iX+i+1+i-iX-1]
                                  = (.5)(+2i) = +i
    So regardles of the position of the gollows we know that the treasure
    must be located at +i. And +i is located at the intersection of the
    imaginary axis with the line joining the two spikes, note the pic.

    http://www.angelfire.lycos.com/linux...cs/island1.JPG

    some entropy with that sink? entropysink.com

    there are two cardinal sins from which all others spring: Impatience and Laziness. - franz kafka

Page 2 of 2 FirstFirst 12
Popular pages Recent additions subscribe to a feed

Similar Threads

  1. %16 with double
    By spank in forum C Programming
    Replies: 11
    Last Post: 03-05-2006, 10:10 PM
  2. how to use operator+() in this code?
    By barlas in forum C++ Programming
    Replies: 10
    Last Post: 07-09-2005, 08:22 PM
  3. Math Test Problem Disagreement
    By orbitz in forum A Brief History of Cprogramming.com
    Replies: 29
    Last Post: 02-28-2003, 04:27 PM
  4. problem with output
    By Garfield in forum C Programming
    Replies: 2
    Last Post: 11-18-2001, 08:34 PM
  5. Little math problem
    By Thantos in forum A Brief History of Cprogramming.com
    Replies: 2
    Last Post: 10-27-2001, 08:44 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21