Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Two train and a bird puzzle

 
rehans oberoi
Ranch Hand
Posts: 174
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
One train leaves Los Angeles at 15mph heading for New York. Another train leaves from New York at 20mph heading for Los Angeles on the same track. If a bird, flying at 25mph, leaves from Los Angeles at the same time as the train and flies back and forth between the two trains until they crash, how far will the bird have traveled?
 
Ryan McGuire
Ranch Hand
Posts: 1048
4
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by rehans oberoi:
One train leaves Los Angeles at 15mph heading for New York. Another train leaves from New York at 20mph heading for Los Angeles on the same track. If a bird, flying at 25mph, leaves from Los Angeles at the same time as the train and flies back and forth between the two trains until they crash, how far will the bird have traveled?


Just so the problem is self-contained, let's say that the traintrack is 2800 miles long.
 
Reid M. Pinchback
Ranch Hand
Posts: 775
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
bird flight distance = 0 if the bird was sitting on the tracks when the L/A train pulled out of the station.

(I know silly, boundary case with tenuous justification, but its almost Friday)
[ March 09, 2006: Message edited by: Reid M. Pinchback ]
 
Vinayak patil
Ranch Hand
Posts: 67
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Distance = 2800 miles.
Time = 2800/35 = 80 hrs.
So bird travels 25*80 = 2000 miles.
 
Reid M. Pinchback
Ranch Hand
Posts: 775
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You forgot about the flying back and forth part; that is just the first leg of the trip.
 
Jim Yingst
Wanderer
Sheriff
Posts: 18671
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Reid: No, it's all included actually. 80 hours is the total time bevfore collision. During that time, the bird is flying either west-east or east-west at 35 mph. In terms of total ground covered (scalar distance, not vector displacement) the direction doesn't matter, and the infinite number of direction reversals at the end doesn't need to be calculated directly. 80 hours at 35 mph gives 2000 miles.

And note that your earlier "boundary case" is clearly contradicted by the problem statement.
[ March 10, 2006: Message edited by: Jim Yingst ]
 
Ashok Mash
Ranch Hand
Posts: 1936
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Vinayak patil:
Distance = 2800 miles.
Time = 2800/35 = 80 hrs.
So bird travels 25*80 = 2000 miles.


Good stuff, very clear thinking!
 
Paul Clapham
Sheriff
Pie
Posts: 20177
25
MySQL Database
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
There's an old (probably untrue) story that when John von Neumann was asked this question, he thought for a few seconds and then gave the correct answer. The asker said "Very good! Most people don't see the easy way and sum the infinite series instead." To which von Neumann said "I did sum the infinite series."
 
Reid M. Pinchback
Ranch Hand
Posts: 775
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Jim Yingst:
And note that your earlier "boundary case" is clearly contradicted by the problem statement.


Yes, but my interpretation is more fun! Just because the bird can fly fast doesn't mean it can hop up from the track fast enough to not get squashed. Kinda like the "what is in my pocket?" riddle.
[ March 10, 2006: Message edited by: Reid M. Pinchback ]
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic