Jan 7, 2010

Capturing a pirate ship

Source: Puzzle collection of K. Rustan M. Leino, Microsoft Research

Problem: You're on a government ship, looking for a pirate ship. You know that the pirate ship travels at a constant speed, and you know what that speed is. Your ship can travel twice as fast as the pirate ship. Moreover, you know that the pirate ship travels along a straight line, but you don't know what that line is. It's very foggy, so foggy that you see nothing. But then! All of a sudden, and for just an instant, the fog clears enough to let you determine the exact position of the pirate ship. Then, the fog closes in again and you remain (forever) in the thick fog. Although you were able to determine the position of the pirate ship during that fog-free moment, you were not able to determine its direction. How will you navigate your government ship so that you will capture the pirate ship?:)

8 comments:

let the speed of the pirate ship be s. Thus at any time t after the sighting of the pirate ship, its locus will be a circle of radius ts centered at its initial position. suppose at the time of the sighting, the pirate ship is at a distance d from the government ship. We have to make sure that after time t, the government ship is at a distance of ts from the initial position of the pirate ship. So, we go in 2/3 d towards the position of the pirate ship, and then start moving in a spiral such that the rate of increase in radius is s. Thus we will always be at a distance of ts from the initial position of the pirate ship, same as the pirate ship. and by the time we have completed one rotation, we should have captured the pirate ship, assuming it does not change directions.does this look good?ps: this is the iitd first year wala suyash

All we need is the speed of the government ship to be greater than the speed of the pirate ship, which is the case here.The government ship can then use its speed to move around the initial point of the pirate ship in a spiral, taking its own sweet time to complete a rotation (which is perfectly possible because only a part of the speed goes in increasing the radius of the spiral, allowing it to move along the circumference at the same time).

OK. working from suyash's ide, suppose the pirate ship has a speed v and our ship has a speed 2v, then when we are at the point where we would have met the ship if it started heading towards us, we have to move to the next point that we can intercept the ship.

Assume that we would reach that point at time dt later where dt is a vanishingly small number. Then using polar co-ordinates and a bit of Pythagoras, our vector length 2*v*dt is the hypotenuse of a right angle triangle with opposite side v*dt along the line from the original position of the pirate ship to its next potential point, and an adjacent side of v*t*da, where t is the time since we first saw the pirate ship and da is the vanishingly small change in the angle to the new potential point.

So we have:

(2*v*dt)^2 = (v*dt)^2 + (v*t*da)^2

Dividing by v^2, simplifying and taking square roots we have

sqrt(3)*dt = t*da

or dt/da = t/sqrt(3)

which inegrates to give

t = exp(a/sqrt(3)) + constant

The time taken is the time taken to go from a = 0 to a = 2*PI, which is exp(2*PI/sqrt(3))-1.

Since the Earth is a sphere, just go to the point where the pirate ship was and wait. The pirate ship is traveling along a straight line (one of the great circles), so eventually it will come back around to the same point.

Amazon.com Mathematics Bestsellers

Buy me Coffee / Beer via Paypal/BTC

Pages

Search This Blog

Follow by Email!

About Me

I am an early stage technology investor at Nexus Venture Partners. Prior to this, I was a 3x product entrepreneur. Prior to this, I worked as a private equity analyst at Blackstone and as a quant analyst at Morgan Stanley. I graduated from Department of Computer Science and Engineering of IIT Bombay. I enjoy Economics, Dramatics, Mathematics, Computer Science and Business.

Disclaimer

This is a personal blog. Any views or opinions represented in this blog are personal and belong solely to the blog owner and do not represent those of people, institutions or organizations that the owner may or may not be associated with in professional or personal capacity. Any views or opinions are not intended to malign any religion, ethnic group, club, organization, company, or individual.

All content provided on this blog is for informational purposes only. The owner of this blog makes no representations as to the accuracy or completeness of any information on this site or found by following any link on this site. The owner will not be liable for any errors or omissions in this information nor for the availability of this information. The owner will not be liable for any losses, injuries, or damages from the display or use of this information.