# Two Trains and a Flying Bird Puzzle

## Puzzle of Two Trains and a Flying Bird

Premise – The puzzle of Two trains and a flying bird are at points A and B respectively. They have a distance of 120km between them. A bird is sitting on top of the train at point A. The trains start moving towards each other at a constant speed of 60 km/hr.

Rule – When the train starts, the bird also starts flying toward the other train, at a speed of 200km/hr. When it reaches the train it turns back and flies towards the first train and repeats the step over and over till both the trains collide.

Objective – How much distance does the bird cover?

### Solution for the Puzzle

Speed of Train A=60km/hr

Speed of Train B =60km/hr

Since both trains are moving towards each other, their relative speed will be

Relative speed = Speed of Train A + Speed of Train B

=  60 + 60 = 120 km/hr

Therefore time in which the trains will collide with each other=$\frac{Distance \:between \:the \:trains}{Relative \: Speed \: of A \: and \: B}$

=$\frac{120\:km}{120\: km/hr}$

= 1 hr

Hence both trains will collide with each other after 1 hour.
Now according to the question, we need to find the distance the bird travels before both the trains collide.

We know the bird is flying at a constant speed of 200km/hr
The distance the bird travels within that time will be = time taken for collision * speed of the bird
= 1 hr * 200 km/hr
= 200km

Hence the bird will cover a distance of 200 km while flying back and forth between the two trains before they collide.

## Get over 200+ course One Subscription

Courses like AI/ML, Cloud Computing, Ethical Hacking, C, C++, Java, Python, DSA (All Languages), Competitive Coding (All Languages), TCS, Infosys, Wipro, Amazon, DBMS, SQL and others