Mighty Mosquito and the Runaway Train

An out-of-control freight train with no brakes is hurtling towards an infinitely massive dead end.

(Picture from the 1985 movie, “ Runaway Train ”)

A lone Mighty Mosquito flies out to save the day, and put itself between the train and the dead end, and waits motionless. The freight train is 1 , 000 , 000 , 000 , 000 1,000,000,000,000 times more massive than Mighty Mosquito. What happens next is a sight to behold!

Mighty Mosquito is infinitely elastic, acting like a perfect tiny hard ball, so that when the train collides with the insect, it slows down a bit, but sends the insect hurtling towards the infinitely massive dead end, which is also perfectly elastic. The insect bounces back, and hurtles towards the train, only to collide with it again, which slows it down further. This repeats many, many times, the insect bouncing back and forth between the train and the dead end, until finally, not only it actually reverses the motion of the train, but sends it hurtling towards the other direction!

In doing this mighty feat, Mighty Mosquito endured X X number of collisions, all the times he hit the train and hit the dead end, until finally the train is travelling faster than Mighty Mosquito, both going in the same direction, so that there are no further collisions.

Find the 7 digit number X

Note It's assumed that the runaway train is moving freely and under no power, and we ignore friction, air resistance, etc., and that the train itself is also perfectly elastic. Also, disregard relativistic effects.


The answer is 3141592.

This section requires Javascript.
You are seeing this because something didn't load right. We suggest you, (a) try refreshing the page, (b) enabling javascript if it is disabled on your browser and, finally, (c) loading the non-javascript version of this page . We're sorry about the hassle.

3 solutions

Ronak Agarwal
Oct 13, 2014

Yes, great problem , how do you think of such things Sir. Here's my way of doing it.

At first sight it may seem that initial velocity of the train is required, but it is not so.

Hello Hello

I have diagram showing the velocities of mosquito and train just before their ( n + 1 ) (n+1) th collision and just after ( n + 1 ) (n+1) th collision.

I am taking a n {a}_{n} =Velocity of train after n n -collisions

Also b n {b}_{n} = Velocity of mosquito after n n -collisions

m 1 {m}_{1} =Mass of train , m 2 {m}_{2} =Mass of mosquito

For the ( n + 1 ) t h (n+1)th collision we have :

By conservation of linear momentum.

m 1 a n m 2 b n = m 1 a n + 1 + m 2 b n + 1 {m}_{1}{a}_{n}-{m}_{2}{b}_{n}={m}_{1}{a}_{n+1}+{m}_{2}{b}_{n+1}

Also for an elastic collision e = 1 e=1 hence we have :

a n + b n = b n + 1 a n + 1 {a}_{n}+{b}_{n}={b}_{n+1}-{a}_{n+1}

Solving both the equations we get :

a n + 1 = ( m 1 m 2 ) a n 2 m 2 b n m 1 + m 2 {a}_{n+1}=\frac{({m}_{1}-{m}_{2}){a}_{n}-2{m}_{2}{b}_{n}}{{m}_{1}+{m}_{2}}

b n + 1 = ( m 1 m 2 ) b n + 2 m 1 a n m 1 + m 2 {b}_{n+1}=\frac{({m}_{1}-{m}_{2}){b}_{n}+2{m}_{1}{a}_{n}}{{m}_{1}+{m}_{2}}

We take m 1 m 2 = k \frac{{m}_{1}}{{m}_{2}}=k , The above equations simplify into :

a n + 1 = ( k 1 ) a n 2 b n k + 1 \large { a }_{ n+1 }=\frac { (k-1){ a }_{ n }-2{ b }_{ n } }{ k+1 }

b n + 1 = 2 k a n + ( k 1 ) b n k + 1 \large { b }_{ n+1 }=\frac { 2k{ a }_{ n }+(k-1){ b }_{ n } }{ k+1 }

Dividing the equations we get :

b n + 1 a n + 1 = 2 k a n + ( k 1 ) b n ( k 1 ) a n 2 b n \large \frac { { b }_{ n+1 } }{ { a }_{ n+1 } } =\frac { 2k{ a }_{ n }+(k-1){ b }_{ n } }{ (k-1){ a }_{ n }-2{ b }_{ n } }

Here comes the main step we take b n a n = r n \large \frac { { { b }_{ n } } }{ { a }_{ n } } ={ r }_{ n }

Our above equation turns into :

r n + 1 = 2 k + ( k 1 ) r n ( k 1 ) 2 r n \large r_{ n+1 }=\frac { 2k+(k-1){ r }_{ n } }{ (k-1)-2{ r }_{ n } }

So we have formed our recurrence relation.

We know that r 0 = b 0 a 0 = 0 {r}_{0}=\frac{{b}_{0}}{{a}_{0}} = 0 Since initially the velocity of the mosquito was zero.

To solve the recurrence we have to take :

r n = k t a n ( θ n ) {r}_{n}=\sqrt{k}tan({\theta}_{n}) and observe that :

r n + 1 = k ( 2 k k 1 + t a n ( θ n ) 1 2 k k 1 t a n ( θ n ) ) = k t a n ( θ n + t a n 1 ( 2 k k 1 ) ) \large r_{ n+1 }=\sqrt { k } (\frac { \frac { 2\sqrt { k } }{ k-1 } +tan({ \theta }_{ n }) }{ 1-\frac { 2\sqrt { k } }{ k-1 } tan({ \theta }_{ n }) } )=\sqrt { k } tan({ \theta }_{ n }+{ tan }^{ -1 }(\frac { 2\sqrt { k } }{ k-1 } ))

Also since r 0 = 0 {r}_{0}=0 we have our explicit formulae for expressing r n {r}_{n} as :

r n = k t a n ( n t a n 1 ( 2 k k 1 ) ) r_{ n }=\sqrt { k } tan(n{ tan }^{ -1 }(\frac { 2\sqrt { k } }{ k-1 } ))

The mosquito's job would be done if the train's speed is greater that mosquito's both going in same direction.

Mathematically I should say that :

r n > 1 {r}_{n}>-1 for some n n , applying this condition in our formula we get :

k t a n ( n t a n 1 ( 2 k k 1 ) ) > 1 \large \sqrt { k } tan(n{ tan }^{ -1 }(\frac { 2\sqrt { k } }{ k-1 } ))>-1

n > π t a n 1 ( 1 k ) ) t a n 1 ( 2 k k 1 ) ) \large \Rightarrow n>\frac { \pi -{ tan }^{ -1 }(\frac { 1 }{ \sqrt { k } } )) }{ { tan }^{ -1 }(\frac { 2\sqrt { k } }{ k-1 } )) }

Putting the value of k = 10 12 k={10}^{12} we get :

n > 1570795.8 n>1570795.8

Hence we get :

n = 1570796 n=1570796 , since n n is an integer .

Also for every collision to the train it collides once to the dead end.

Hence total number of collisions is given by :

X = 3141592 \boxed{X=3141592}

And yes the answer has the first 7 digits of π {\pi}

Here I have used exact values but I can approximate it to.

We had n > π t a n 1 ( 1 k ) ) t a n 1 ( 2 k k 1 ) ) n>\frac { \pi -{ tan }^{ -1 }(\frac { 1 }{ \sqrt { k } } )) }{ { tan }^{ -1 }(\frac { 2\sqrt { k } }{ k-1 } )) }

Approximating it we get :

n π 2 k n\approx \frac { \pi }{ 2 } \sqrt { k }

If mass ratio is 10 2 x {10}^{2x} then we have total number of collisions as :

= π . 10 x =\left\lfloor \pi .{ 10 }^{ x } \right\rfloor

which as michael pointed out is a great thing to observe.

Hey what's recurrence relation??????

Vaibhav Jain - 6 years, 8 months ago

Log in to reply

In mathematics, a recurrence relation is an equation that recursively defines a sequence, once one or more initial terms are given: each further term of the sequence is defined as a function of the preceding terms.

In easy language we can say for a given series next term can be found in some way or the other from the preceeding terms

Ronak Agarwal - 6 years, 8 months ago

Log in to reply

So you are a JEE aspirant. Howz your preparation going??

Vaibhav Jain - 6 years, 8 months ago

Log in to reply

@Vaibhav Jain Ekdam mast.

Ronak Agarwal - 6 years, 8 months ago

That is incredible! Wonderful problem and solution.

Michael Ng - 6 years, 7 months ago

Excellent! Great problem @Michael Mendrin ! And a great answer too!

Pratik Shastri - 6 years, 8 months ago

Awesome :).

Venkata Karthik Bandaru - 5 years, 5 months ago
Michael Mendrin
Oct 13, 2014

Ronak, thank you very much for your excellent explanation of how it's worked out. This is one of my favorite oddities in math, given a mass ratio of 10 2 n { 10 }^{\displaystyle 2n } , the number of collisions is exactly the first n + 1 n+1 digits of π \pi , beginning with 3 3 for a mass ratio of 1 1 , i.e., where n = 0 n=0 . Specifically, it works out to

F l o o r π A r c T a n ( 10 n ) Floor\left\lfloor \dfrac { \pi }{ ArcTan\left( { 10 }^{\displaystyle -n } \right) } \right\rfloor

In rare cases, the last digit is off by 1 1 , as for example with n = 0 n=0 .

Maybe I should post a note about a full explanation of this oddity, someday.

I remember a similar problem on Y!A by you. Thanks for refreshing my memory :)

Vikram Pandya - 6 years, 8 months ago

Log in to reply

Vikram Pandya! I haven't heard from you in almost a year! Don't you remember that it was you that got me started here on Brilliant? You've posted some pretty good problems here. Anyway, yeah, this is a recycled product, I did originally post a version of this on Y!A a while back.

I'd like to repost some of your own problems here, which I think deserves way more attention. What do you say?

Michael Mendrin - 6 years, 8 months ago

Log in to reply

Yes, I got you started here :) Sorry I was really busy setting up my own venture. Fortunately it is doing very well. Ofcourse feel free to post my questions. Most of the times, I come here how to see your questions. I think in near future I will be able to again start contributing more on both brilliant and Y!A once the initial hardships of setting up a start up will fade away .

Vikram Pandya - 6 years, 8 months ago

Log in to reply

@Vikram Pandya Great to hear that your startup is taking off. I can thoroughly sympathize the pressures involved. One of these days maybe you can tell me about it.

Michael Mendrin - 6 years, 8 months ago

@Michael Mendrin Can you please check why I'm getting exactly half the answer?

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
m1 = 10^12; m2 = 1; u1 = 1.0; u2 = 0; d = 1; colissions = 0;
While[True,
 v1 = (m1 - m2)/(m1 + m2) u1 + (2 m2/(m1 + m2)) u2;
 v2 = (m2 - m1)/(m2 + m1) u2 + (2 m1/(m2 + m1)) u1;
 u1 = v1;
 u2 = v2;
 colissions++;
 If [Sign[v1] == -1, Break[];];
 t = d/u1;
 u2 = -u2;
 d = d - u1 t;
 colissions++;
 If [Sign[v1] == -1, Break[];];
 t = d/(u1 - u2);
 d = d - u1 t;] 

Agnishom Chattopadhyay - 6 years, 6 months ago
Lu Chee Ket
Dec 31, 2014

Something like a million of Pi.

[Original formula solved included a not catch for elastic collision.]

m1 v1 + m2 v2 = m1 u1 + m2 u2 {Conservation of momentum with no external force against.}

m1 v1^2 + m2 v2^2 = m1 u1^2 + m2 u2^2 {Conservation of energy with no lost of energy.}

Generally, with v1 and v2 as only unknowns to be found, via solving quadratic equation:

v1 = (m1 u1 + m2 u2 - | m2 u1 – m2 u2 |)/ (m1 + m2) {Determined answer from quadratic roots.}

v2 = (m1 u1 + m2 u2 + | m1 u1 – m1 u2 |)/ (m1 + m2) {Determined answer from quadratic roots.}

Since | -x | = | x |, and | x – y | = | y – x |, while | x | = x for x >=0 or | x | = - x for x <0, | x – y | = | y – x | is particularly risky to remain as a form of expression.

Therefore, rewrite the above formula using real axis convention for either or both direction(s):

For u1 >= u2, {Benefited from original negative and positive.}

v1 = (m1 u1 + m2 u2 – (m2 u1 – m2 u2))/ (m1 + m2) = [u1 (m1 – m2) + 2 m2 u2)]/ (m1 + m2)

v2 = (m1 u1 + m2 u2 + (m1 u1 – m1 u2))/ (m1 + m2) = [2 m1 u1 - u2 (m1 – m2)]/ (m1 + m2)

For u1 < u2, {Explained why not positive and negative.}

v1 = (m1 u1 + m2 u2 – (- m2 u1 + m2 u2))/ (m1 + m2) = u1

v2 = (m1 u1 + m2 u2 + (- m1 u1 + m1 u2))/ (m1 + m2) = u2

Specifically, overall momentum is not conserved once external force changed u2 before each collision (as from the passage, it does not include impact with the dead end; but it meant on answer.) between train and mosquito. In a context of ratios only, initial speed of train and mass of mosquito are assigned 1. Replace u2 with -u2:

v1 = [u1 (m1 – m2) - 2 m2 u2)]/ (m1 + m2)

v2 = [2 m1 u1 + u2 (m1 – m2)]/ (m1 + m2)

Gradual change of what happen when the train knock onto the deed end is being transferred to the mosquito for a detail understanding about the mechanism occurs for such impact. The mosquito represents impulses of tiny mass with high speeds. Using computing loop to substitute vi to ui repeatedly, we can observe by counting to the 7 digits for an attention. Using Turbo Pascal, V[flip] of EXTENDED type array and flip of BOOLEAN type can access previous value conveniently for a catch of wanted change.

The mosquito gained a speed of nearly twice the speed of train initially after the first collision until less than one time after 1570796th collision, which is bounced back from 1570796th knock onto the dead end. Since then, the train’s speed is greater than the mosquito’s speed both in negative direction finally, with u1 < u2 as greater magnitude in negative means smaller. Against <> exerted. u1 is always at left side of u2. Mosquito posses -0.653587 times of initial train speed eventually while the train posses -0.99999? times, not certain because of accumulation of computing errors.

Finally, collisions here do meant for all, twice as 3141592, confident because of Pi.

0 pending reports

×

Problem Loading...

Note Loading...

Set Loading...