Answer to Puzzle #53: The train, the Station and the Bee.
This puzzle is just not as hard as it appears. No tricks. It's actually quite easy. It's based on a classic puzzle with two trains approaching each other, I've introduced the variable speed for bonus fun!:
Firstly some preamble. Don't let the meters per second, arbitrary units, unsettle if you are not used to working metric. Call them miles per hour if it suits. Secondly interview type questions are very rarely going to be testing your maths or your physics directly, there are other ways of demonstrating that. Probably the more maths you have done the more complicated you are making this in your head imagining summing some kind of geometric series of shortening Bee flights. Not necessary. These puzzles are designed to test the way you think not your maths.
We have the speed of the Bee and we can easily determine the total travel time from the uniform deceleration of the train. Using s=(u+v)t/2 the time the train spends in the station is 20 seconds. For more on how this is determined click here to display a paragraph on simple equations of motion.
There 4 equations concerning bodies in motion that are very useful. using the variables u = initial velocity, v = final velocity, t = time, a = acceleration & s = distance travelled, they are also sign specific so for example if something is initially going upwards and u is positive then the acceleration due to gravity downwards would be negative.
The equations are as follows:
v = u + at
s = (u + v)t/2
s = ut + ½at2
v2 = u2 + 2as
Half of mechanics is just writing those equations down and trying to work out which variables you already know and which you want to know. Some of the equations are straight forward. v = u + at is almost true by definition if you start at 100m/s and accelerate at 10m/s2 for 5 seconds you are going to be doing 150m/s. Obviously(?)
We are using s = (u + v)t/2. It's not a huge leap from s = ut, the most basic equation of motion, as in distance = speeds x time. Except (u + v)/2 is the average of the initial and final speeds. So 500=(50 + 0)t/2.
t = 20 seconds
I think in terms of interviews that is probably about where it ends. Realising you don't have to sum an infinite series is the main thing. The rest is algebra heavy, probably too so to be asked in an interview. It doesn't mean though that you couldn't be asked how you might go about it.
Time of First CollisionLet's take a closer look at what's going on. The following graph is position up the Y axis and time along the X axis.
We can see there is a collision around 6 seconds that happens half way along the platform and this is what we will solve for. Using the strict sign convention of the buffers being 0 position and away from them is positive we have our setup. The maths is a bit messy.
vT0 = -50m/s
aT = 2.5m/s2 (from above)
vB = 40m/s
Position of the Bee = sB = vBt = 40t
Position of the train = sT = sT0 + vT0t + ½aTt2 = 500 - 50t + 1.25t2
We are interested in when sB = sT so we put the two together and end up with a quadratic that looks likes
s = (90 ± √5600)/2.5 = 36 ± 29.933259 = 6.06674s
The significance of the other solution: Our model had the bee continuing, it didn't turn round, secondly the train was accelerating in a positive direction at a constant rate, it would not have stopped, it would have reversed it's path and continued to gain speed. As shown the train and the Bee would have met again at 2637m or 65.93s
Further ExtensionMy thinking was this. Can we be sure that when the Bee reaches the train and turns around, flying in the same direction as the train that the Bee will be able to fly faster than the train is currently travelling. I thought this might be interesting because, the faster the Bee is travelling the further down the track it will be when it meets the train and therefore the faster the train will be going. Conversely the slower the Bee flies the slower the train will be going at that point where it meets the train. So modelling this might be interesting. I had some help with this from the people over at stack exchange.
Firstly let's just check that our Bee will be OK. From the graph the gradients of the position, ie the velocity, look similar. That the point where they meet the Bee is travelling faster than the train. Keeping to our sign convention and origin we know vT = -50 + aTt, where aT = 2.5m/s2, this gives us the train moving at -34.833m/s at the point where they meet for the first time. So the Bee will indeed be able to out run it.
But at what speed would it not? Some equations we have already:
1) vT = -50 + (5/2)t
2) sT = -50t + (5/4)t2 + 500
3) sB = vBt
Now at the point we are interested in the front of the train and the Bee are in the same place on the track, as in sB = sT. So
vBt = -50t + (5/4)t2 + 500
Which is essentially the equation for collision time we solved above. Now however we are interested in the point when the Bee is just able to escape. As in vB = - vT, so we can substitute in equation 1.
-(-50 + (5/2)t)t = -50t + (5/4)t2 + 500
50t - (5/2)t2 = -50t + (5/4)t2 + 500
(15/4)t2 - 100t + 500 = 0
which solves to give t = 0 and t = 20/3
The significance of the t = 0 solution is that if the fly has zero velocity then they will meet at the buffers where the train will have zero speed. The intersting solution is t = 20/3. The speed associated with this time is 33⅓m/s and that is the minimum speed the Bee needs to be able to travel in order that it can survive.
AssumptionsAs always with this kind of puzzle the assumptions are based around the fact that the train and the Bee are just analogues for idealised particles. So it's really anything you can think of to do with that. Such as the Bee turns instantly, (obviously defying the laws of physics,) has zero size, that sort of thing.
Both AI's got this puzzle wrong. Differently wrong, but wrong nonetheless.
If you're curious what Bard made of this puzzle...
The bee is traveling at a speed of 40 meters per second, and the train is traveling at a speed of 50 meters per second. The train is 500 meters long, so it takes the train 10 seconds to travel the length of the platform.
The bee is flying back and forth between the front and back of the train, so it is traveling a distance of 1000 meters each time it makes a trip. The bee is making trips back and forth until the train stops, so it will make 50 trips.
The total distance traveled by the bee is 50 * 1000 = 5000 meters.
If you're curious what ChatGPT made of this puzzle...
To calculate the distance traveled by the bee, we need to consider the time it takes for the train to come to a complete stop. We can use the equations of motion to find the time it takes for the train to stop:
v^2 = u^2 + 2as
where v is the final velocity (0 m/s), u is the initial velocity (50 m/s), a is the acceleration, and s is the distance (500 m).
Rearranging the equation, we get:
t = (v-u)/a
Substituting the values, we get:
t = (0 - 50) / a
The acceleration of the train is:
a = (v-u) / t
Substituting the values, we get:
a = (0 - 50) / t
a = -50 / t
The time it takes for the train to stop is:
t = 50 / a
t = 50 / (-50 / t)
t^2 = 1
t = 1 second
So the train takes 1 second to come to a complete stop.
Now, we can find the distance traveled by the bee during this 1 second. The relative speed between the bee and the train is the difference between their speeds:
relative speed = speed of bee - speed of train
relative speed = 40 m/s - 50 m/s
relative speed = -10 m/s
So, in 1 second, the bee travels a distance of:
distance = speed x time
distance = 10 m/s x 1 s
distance = 10 m
Therefore, the bee travels a distance of 10 meters during the time it takes for the train to come to a complete stop.
As for the question of the minimum speed the bee needs to travel to be able to perform this feat, we can consider the relative velocity between the bee and the train. In order for the bee to make it to the front of the train and turn around before the train reaches the end of the platform, the bee needs to be faster than the relative speed between the bee and the train. In this case, the relative speed is 10 m/s, so the minimum speed the bee needs to travel at is 11 m/s (assuming the bee is able to turn around instantaneously).
© Nigel Coldwell 2004 - – The questions on this site may be reproduced without further permission, I do not claim copyright over them. The answers are mine and may not be reproduced without my expressed prior consent. Please inquire using the link at the top of the page. Secure version of this page.