Author Topic: The Four travelers  (Read 7359 times)

0 Members and 1 Guest are viewing this topic.

Offline AngelFish

  • Is this my custom title?
  • Administrator
  • LV12 Extreme Poster (Next: 5000)
  • ************
  • Posts: 3242
  • Rating: +270/-27
  • I'm a Fishbot
    • View Profile
The Four travelers
« on: June 16, 2011, 07:22:00 pm »
Four travelers, Mr. A, B, C, and D, have to cross a bridge over a deep ravine. It 's a very dark night and the they have only an old fashioned oil lamp for light. The light is essential for successfully crossing the ravine because the bridge is very old and has a lot of holes and loose boards. Even worse, its construction is really quite weak, and in its dilapidated condition, it can only support two of the men at a time. They are also out of cell phone range and are so unable to call for help. If two men cross the bridge together, the time for them to cross is equal to the crossing time of the slower man because the faster man must help the other along.


How should the men arrange themselves to cross the bridge in the fastest possible time?

Mr. A takes 1 minute to cross the bridge.
Mr. B takes 2 minutes to cross.
Mr. C takes 5 minutes to cross.
Mr. D is recovering from surgery and takes 10 minutes to cross.


Example (not the best solution):

A and D cross first, taking 10 minutes to cross.
A returns with the light, taking another 1 minute.
B and C cross, taking 5 minutes.
B returns with the light in 2 minutes.
A and B cross, taking 2 more minutes.
Total time = 10+1+5+2+2 = 20 Minutes.

It took me about 5 minutes to solve this problem. How long did it take you?
« Last Edit: June 16, 2011, 07:23:05 pm by Qwerty.55 »
∂²Ψ    -(2m(V(x)-E)Ψ
---  = -------------
∂x²        ℏ²Ψ

Ashbad

  • Guest
Re: The Four travelers
« Reply #1 on: June 16, 2011, 07:34:12 pm »
A, D over, 10
A back, 1
A, C over, 5
A back, 1
A, B over, 2

Total, 19

Optimized one cycle ;)
« Last Edit: June 16, 2011, 07:34:31 pm by Ashbad »

Offline AngelFish

  • Is this my custom title?
  • Administrator
  • LV12 Extreme Poster (Next: 5000)
  • ************
  • Posts: 3242
  • Rating: +270/-27
  • I'm a Fishbot
    • View Profile
Re: The Four travelers
« Reply #2 on: June 16, 2011, 07:36:00 pm »
That's still not the optimal solution ;)
∂²Ψ    -(2m(V(x)-E)Ψ
---  = -------------
∂x²        ℏ²Ψ

Ashbad

  • Guest
Re: The Four travelers
« Reply #3 on: June 16, 2011, 07:37:56 pm »
Really?  O.o. All I did for mine is make A cross over with the light instead of B on the second pass, saves 1 minute.  I wonder what it is :P

Offline Quigibo

  • The Executioner
  • CoT Emeritus
  • LV11 Super Veteran (Next: 3000)
  • *
  • Posts: 2031
  • Rating: +1075/-24
  • I wish real life had a "Save" and "Load" button...
    • View Profile
Re: The Four travelers
« Reply #4 on: June 16, 2011, 10:12:31 pm »
From a game theory perspective, I'd have to agree that 19 is the minimum amount of time it can take unless there is something fundamental about this problem that I'm not understanding (which I assume there is).

-Each trip across must be a full trip due to the 3 person rule.  Otherwise it could only increase the time.
-Mr. A has to travel with every person or else it could only increase time.
-I'm assuming you can't "toss" the lamp over the bridge, set it on fire, or cut it and swing to the other side.
___Axe_Parser___
Today the calculator, tomorrow the world!

Offline leafy

  • CoT Emeritus
  • LV10 31337 u53r (Next: 2000)
  • *
  • Posts: 1554
  • Rating: +475/-97
  • Seizon senryakuuuu!
    • View Profile
    • keff.me
Re: The Four travelers
« Reply #5 on: June 16, 2011, 10:17:55 pm »
I saw this problem, and I remember it was either 15 or 17 for the optimal solution. I'll try working it out again ^^
In-progress: Graviter (...)

Offline AngelFish

  • Is this my custom title?
  • Administrator
  • LV12 Extreme Poster (Next: 5000)
  • ************
  • Posts: 3242
  • Rating: +270/-27
  • I'm a Fishbot
    • View Profile
Re: The Four travelers
« Reply #6 on: June 17, 2011, 12:07:00 am »
From a game theory perspective, I'd have to agree that 19 is the minimum amount of time it can take unless there is something fundamental about this problem that I'm not understanding (which I assume there is).

-Each trip across must be a full trip due to the 3 person rule.  Otherwise it could only increase the time.

Going forwards across the bridge, yes. One person must necessarily travel back across the bridge to bring the lamp back to the others. But I assure you that 19 is *not* the minimum time required and I also highly recommend not using Google for the answer.
∂²Ψ    -(2m(V(x)-E)Ψ
---  = -------------
∂x²        ℏ²Ψ

Offline Builderboy

  • Physics Guru
  • CoT Emeritus
  • LV13 Extreme Addict (Next: 9001)
  • *
  • Posts: 5673
  • Rating: +613/-9
  • Would you kindly?
    • View Profile
Re: The Four travelers
« Reply #7 on: June 17, 2011, 12:16:49 am »
17 is the optimal solution and let me assure you the solution does not involve anything tricky like leaving members in the middle of the bridge or anything :P

Offline Juju

  • Incredibly sexy mare
  • Coder Of Tomorrow
  • LV13 Extreme Addict (Next: 9001)
  • *************
  • Posts: 5730
  • Rating: +500/-19
  • Weird programmer
    • View Profile
    • juju2143's shed
Re: The Four travelers
« Reply #8 on: June 17, 2011, 12:26:19 am »
Hmmm... It's kinda hard.

Remember the day the walrus started to fly...

I finally cleared my sig after 4 years you're happy now?
THEGAME
This signature is ridiculously large you've been warned.

The cute mare that used to be in my avatar is Yuki Kagayaki, you can follow her on Facebook and Tumblr.

Offline AngelFish

  • Is this my custom title?
  • Administrator
  • LV12 Extreme Poster (Next: 5000)
  • ************
  • Posts: 3242
  • Rating: +270/-27
  • I'm a Fishbot
    • View Profile
Re: The Four travelers
« Reply #9 on: June 17, 2011, 12:29:01 am »
17 is the optimal solution and let me assure you the solution does not involve anything tricky like leaving members in the middle of the bridge or anything :P

Yep :)

EDIT: My Linux automatically threw this link into this post, so enjoy  :P http://community.linuxmint.com/
« Last Edit: June 17, 2011, 12:30:11 am by Qwerty.55 »
∂²Ψ    -(2m(V(x)-E)Ψ
---  = -------------
∂x²        ℏ²Ψ

Offline Hayleia

  • Programming Absol
  • Coder Of Tomorrow
  • LV12 Extreme Poster (Next: 5000)
  • ************
  • Posts: 3367
  • Rating: +393/-7
    • View Profile
Re: The Four travelers
« Reply #10 on: June 17, 2011, 12:50:12 am »
AB     2    →
B       2    ←
CD     10  →
A       1   ←
AB      2   →
Total 17
« Last Edit: June 17, 2011, 12:50:34 am by Hayleia »
I own: 83+ ; 84+SE ; 76.fr ; CX CAS ; Prizm ; 84+CSE
Sorry if I answer with something that seems unrelated, English is not my primary language and I might not have understood well. Sorry if I make English mistakes too.

click here to know where you got your last +1s

Offline AngelFish

  • Is this my custom title?
  • Administrator
  • LV12 Extreme Poster (Next: 5000)
  • ************
  • Posts: 3242
  • Rating: +270/-27
  • I'm a Fishbot
    • View Profile
Re: The Four travelers
« Reply #11 on: June 17, 2011, 12:59:03 am »
Bingo.
∂²Ψ    -(2m(V(x)-E)Ψ
---  = -------------
∂x²        ℏ²Ψ

Offline Hayleia

  • Programming Absol
  • Coder Of Tomorrow
  • LV12 Extreme Poster (Next: 5000)
  • ************
  • Posts: 3367
  • Rating: +393/-7
    • View Profile
Re: The Four travelers
« Reply #12 on: June 17, 2011, 10:44:58 am »
Do I explain or do you (or do anyone else do) ?
EDIT: I think I'll explain, so.
Well, the only thing is to make C and D cross the bridge together, only one time.
So, AB have to go first, then A or B comes back to give the lamp to C and D so they can cross the bridge and give the lamp to A or B (the one who stayed) so he goes back to look for the last one.
In fact, C can even be slower, his travelling time doesn't count as it is absorbed by D.

I also highly recommend not using Google for the answer.
All I found on Google was the question... (°-.-)
« Last Edit: June 18, 2011, 03:38:54 am by Hayleia »
I own: 83+ ; 84+SE ; 76.fr ; CX CAS ; Prizm ; 84+CSE
Sorry if I answer with something that seems unrelated, English is not my primary language and I might not have understood well. Sorry if I make English mistakes too.

click here to know where you got your last +1s