Liberty BASIC Community Forum
« Train Station - Jan. 13, 2012 »

Welcome Guest. Please Login or Register.
May 25th, 2017, 4:59pm


Rules|Home|Help|Search|Recent Posts|Notification


« Previous Topic | Next Topic »
Pages: 1  Notify Send Topic Print
 thread  Author  Topic: Train Station - Jan. 13, 2012  (Read 411 times)
Noble D. Bell
Moderator
ImageImageImageImageImage


member is offline

Avatar




PM

Gender: Male
Posts: 927
xx Train Station - Jan. 13, 2012
« Thread started on: Jan 13th, 2012, 10:13am »

Hello!

Sorry for the later than normal start on this years challenges. I had some personal events that required my full attention. I hope everyone had a good Christmas and New Year.

I am going to start posting challenges every-other Friday now instead of on the usual Wednesdays.

Along with the new challenge every two weeks I am going to post my answer to the previous challenge as well.

So, without further delay, lets let the fun begin...

Each day a man meets his wife at the train station after work, and then she drives him home. She always arrives exactly on time to pick him up. One day he catches an earlier train and arrives at the station an hour early. He immediately begins walking home along the same route the wife drives. Eventually his wife sees him on her way to the station and drives him the rest of the way home. When they arrive home the man notices that they arrived 20 minutes earlier than usual. Write an LB program that will determine how much time the man spent walking?

Enjoy!
User IP Logged

Thank you and God bless,
Noble D. Bell
http://www.noblebell.com
uncleBen
Senior Member
ImageImageImageImage


member is offline

Avatar




PM


Posts: 268
xx Re: Train Station - Jan. 13, 2012
« Reply #1 on: Jan 13th, 2012, 10:47am »

Arriving home 20 minutes earlier means that it took the wife 20 minutes less to make the back-and-forth trip. Since they met on the half-way of the wife's trip, that would be 10 minutes before the arrival of the regular train. By that time the man had been walking for 50 minutes?

Code:
print 60 - 20 / 2; " minutes"
 
User IP Logged

Noble D. Bell
Moderator
ImageImageImageImageImage


member is offline

Avatar




PM

Gender: Male
Posts: 927
xx Re: Train Station - Jan. 13, 2012
« Reply #2 on: Feb 3rd, 2012, 2:49pm »

Sorry for the extra week delay. Lots going on...


The answer to this challenge is 50 minutes.

Here is how its done...

This is a hard solution to explain, it will help if you draw a graph.

Suppose another couple (call them couple B) lives with the couple stated in the problem (call them couple A). Normally both men catch the same train home. However today the husband B arrives at the station 20 minutes early and wife B is already there to take him home. Both men will arrive home at the same time, because both arrive 20 minutes earlier than usual.

On their way home at some point couple B will pass wife A picking up husband A and they will drive the rest of the way home side by side, again both arriving 20 minutes early.

Now assume that wife A didn't see her husband and instead kept going to the train station. She would have arrived exactly 20 minutes after wife B left, because husband B arrived 20 minutes before husband A was expected to arrive, and wife A is always exactly on time. Likewise if wife B had turned around when she saw husband A and went back to the station she would have arrived 20 minutes after she left the station. In other words it would take her 10 minutes to reach husband A and 10 minutes to get back to the station.

So after A walked for 40 minutes wife B would have left the station. 10 minutes later she would have caught up to husband A. So husband A walked a total of 50 minutes.

By: Michael Shackleford, ASA, August 19 1999.
« Last Edit: Feb 3rd, 2012, 3:06pm by Noble D. Bell » User IP Logged

Thank you and God bless,
Noble D. Bell
http://www.noblebell.com
Pages: 1  Notify Send Topic Print
« Previous Topic | Next Topic »

Rules|Home|Help|Search|Recent Posts|Notification

Donate $6.99 for 50,000 Ad-Free Pageviews!

| |

This forum powered for FREE by Conforums ©
Sign up for your own Free Message Board today!
Terms of Service | Privacy Policy | Conforums Support | Parental Controls