Page 1 of 4 123 ... LastLast
Results 1 to 10 of 36

Thread: Family Crossing a BRIDGE

  1. #1
    Join Date
    Jul 2005
    Posts
    75
    Rep Power
    0

    Default Family Crossing a BRIDGE

    Well here is the next problem.

    A family was out on a vacation and came to a pulley bridge, now they had thirthy seconds to get across before they completely lose all light. Now the members of the family and the time they take to cross the bridge are as follows:

    (1) Grandpa - 12 secs to cross.
    (2) Father - 8 secs to cross.
    (3) Mother - 6 secs to cross.
    (4) daugther - 3 secs to cross.
    (5) son - 1 sec to cross.


    Now the bridge being a pully a maximum of two person can go across but one person have to carry it back. Here are the rules for crossing:

    (1) When 2 persons are crossing the person with the longest time to cross is the time it takes to get to the other side. eg, if the father and the Son is crossing the time to get across is 8 seconds.

    (2) The time going back is also calculated, e.g. if the father and the Son is crossing the time to get across is 8 seconds.. Now logically in the interest of time you will let the son go back. This trip in it's totality will take 9 secs, 8 secs + 1 sec to get back.

    Now in designing your algorithm do not design a algorithm that solves this problem. Design a generic one where if i change the number of family members it still work.

    I have not seen or done a solution as yet so i cannot suggest a LOC acceptable limit.
    "A computer once beat me at chess, but it was no match for me at kick boxing." - Emo Philips -

  2. #2
    Join Date
    Mar 2004
    Posts
    123
    Rep Power
    0

    Default

    I've been trying to figure out what combinations of move would give me 30 secs or less but so far I've only come up with a minimum of 32 secs. So, question. Should the grandpa's time be 10 secs or am I missing something?
    There is no wrong or right, only consequencies to action

    "It is the duty of man to make his knowledge so complete in life, so as to make it impossible for any other to take advantage of him" - Marcus Garvey

  3. #3
    Join Date
    Dec 2002
    Posts
    500
    Rep Power
    0

    Default

    ive seen this flash animated before the minimum is 29. no errors there. i think theres also a solution in exactly 30.
    Cultured in Aggression and Koding like a Warrior!!
    “Common sense is instinct. Enough of it is genius.” - George Bernard Shaw.
    "The significant problems we face cannot be solved by the same level of thinking that created them." - Albert Einstein

  4. #4
    Join Date
    Sep 2004
    Posts
    1,905
    Rep Power
    21

    Default

    Glad mi catch sombody need clarification on the problem.

    I aggree with the 32 limit

    The algorithm seems too simple if that is the case, maybe I am wrong, or maybe the pulley size can be varied.

    Any clarifications????????????
    Let's act on what we agree on now, and argue later on what we don't.
    Black men leave Barbeque alone if Barbeque don't trouble you

  5. #5
    Join Date
    Sep 2004
    Posts
    1,905
    Rep Power
    21

    Default

    Oh mi see it now Still can the pully size be varied? I am working with it cant
    Let's act on what we agree on now, and argue later on what we don't.
    Black men leave Barbeque alone if Barbeque don't trouble you

  6. #6
    Join Date
    Jul 2005
    Posts
    75
    Rep Power
    0

    Default Tjrak That Not Cool!!!!

    You solved it for everyone, that is not cool.

    Part of what makes it fun is when people come up with the solution for themselves.

    Now all they have to do is code.

    Quote Originally Posted by crosswire
    Oh mi see it now Still can the pully size be varied? I am working with it cant
    Well the limit is 30 secs, see TJRAK show you the solution in a previous post. He tells you how to get across in 29 secs. I have devise a solution where it can find the optimal time for any sequence of numbers.
    Last edited by Mr. Unstoppable; Aug 9, 2005 at 10:30 PM. Reason: Added in INFO
    "A computer once beat me at chess, but it was no match for me at kick boxing." - Emo Philips -

  7. #7
    Join Date
    Sep 2004
    Posts
    1,905
    Rep Power
    21

    Default

    Man This is more fun than playing Unreal Tournament in ONS-Ahheban with 20 bots, AI set to GodLike, and I am outnumbered.

    Sorry still
    Let's act on what we agree on now, and argue later on what we don't.
    Black men leave Barbeque alone if Barbeque don't trouble you

  8. #8
    Join Date
    Sep 2004
    Posts
    1,905
    Rep Power
    21

    Default

    Mi start from 3:00pm and mi no stop are eat dinner yet
    Let's act on what we agree on now, and argue later on what we don't.
    Black men leave Barbeque alone if Barbeque don't trouble you

  9. #9
    Join Date
    Sep 2004
    Posts
    1,905
    Rep Power
    21

    Default

    PS I did not read the logic behind TRAK solution, even know. I assumed it would not work so I am working on a generic solution. I read one word and stop and block it out.

    The example he had only let me know that my soultion was not generic
    Let's act on what we agree on now, and argue later on what we don't.
    Black men leave Barbeque alone if Barbeque don't trouble you

  10. #10
    Join Date
    Jul 2005
    Posts
    75
    Rep Power
    0

    Default

    Crosswire i am glad you like my challenges. I have figured a very generic solution. I have think i have it solved and can now post a reasonable LOC for the challenge to become just that "a challenge".

    Without further ado, the LOC is 100 LOC.............

    I currently working on a solution that will not meet the 100LOC limit. Icymint3 have proven that can solve any program in a 1/4 the LOC average programmers take to do it, so let him challenge that LOC limit.
    Last edited by Mr. Unstoppable; Aug 10, 2005 at 01:49 AM. Reason: correction
    "A computer once beat me at chess, but it was no match for me at kick boxing." - Emo Philips -

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •