Mathematics Stack Exchange is a question and answer site for people studying math at any level and professionals in related fields. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

You are standing on the middle of a East-West street. A row of closed doors in front of you, and you have a key on hand which can only open one specific door. Compose a strategy so that X/N value is smallest under the worst situation. X is the distance you covered when arriving at the correct door. N is the distance between the door and the original point.

share|cite|improve this question
Compose a strategy for what? – Henning Makholm Jan 29 '12 at 16:27

Your problem is known as the cow-path problem. The answer is an example of an online algorithm. The best $X/N$ is known as the competitive ratio. The competitive ratio in your case is~$9$ for deterministic algorithms, and $4.6$ for randomized algorithms.

See Wikipedia for references.

share|cite|improve this answer
That Wikipedia article is almost worthless, I'm afraid. – TonyK Jan 29 '12 at 16:44
Google "cow path problem" instead. – Yuval Filmus Jan 29 '12 at 17:04
Link to that instead. – TonyK Jan 29 '12 at 19:49

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.