Skip to main content

Car Problem


Problem: Let A and B be two cities, with two different roads connecting them. Suppose that two cars can travel from A to B on different roads, keeping a distance that does not exceed 1 mile between them.  Is it possible for two cars to travel one from A to B, the other from B to A such that the distance between them is always greater than one mile?

Update: (23 January 2011)
Solution: Posted by Gaurav Sinha (chera) (CSE IITK 1996 Graduate, Now working at Indian Revenue Service) in comments! A more general solution with clear explanation posted by Ameya Ranade (Microsoft Software Engineer, CSE IITB 2009 Graduate)


  1. its not possible. proof is by contradiction as follows:.

    situation 1 : cars x,y move from A to B such that always d(x,y)<1.

    situation 2: cars u,v move from A to B and B to A respectively s.t. always d(u,v)>1.

    where x and u are on one road and y and v are on other road.

    now, by appropriate scaling, choose the time trajectories of all cars in such a way that cars x and u start at same time from city A and are together subsequently. By the time it reaches city B, car y will meet car v at say time t when x and u are together and , y and v are also together.
    At time t, 1< d(u,v)=d(x,y) < 1,

    a contradiction.

  2. No.
    Let P1, P2 be such that P1(t) is the location of car 1 on path 1 at time t. Similarly, P2(t) is the location of car 2 on path 2 at time t.
    Now we know d(p1(t),p2(t))<1 mile for all t.
    Let f be a fn. such that, f(p1(t)) = p2(t).

    Now p2(t) takes all values from A to B.
    Hence, its not possible

  3. well if u want to see the borderline case then it is the following:

    consider a circle of diameter 1 centered at the origin. City A is at (-1,0) and B is at (1,0). One road is from the top, the other from below. Consider equal constant speeds in both cases. This is the best we can do.

  4. @chera.. nice solution
    @shantanu.. I don't think I understand your solution. Please explain in more detail.

  5. I have one solution. Let length of 2 roads be p and q. Draw a rectangle with sides p and q at origin and in +ve x and y. here any point (x,y) represent car1 at x distance on road1 and car2 at y distance on road2 at some time. Now, at A, we are at (0, 0) and at be at (p, q). Let dis(x,y) = actual distance between the cars. From given condition, there is a path between (0, 0) and (p,q) in rectangle such that, dis(x, y) <= 1 mile at every (x,y) in the path.

    In the next case we are starting at (0, q) and ending at (p, 0). By simple path drawing we can see that this path will definitely intersect the last path at some point. Thus, the dustance <= 1 mile. Hence, proved that no such path can exist.

  6. @Stainless (Ameya Ranade)
    Correct solution! Thanks for the simple explanation.

  7. solution of stainless is complete and correct.

    solution posted by me is not complete because it is based on assumption that the 2 cars travelling on same road from A to B can travel together at all times. This is possible if there is no back gear and the cars only move forward. But its not clear to me whether this is possible in a general case, when the cars need to use back gear also.

  8. @chera. thanks for the clarification. I agree with you.

  9. chera, I guess there's another problem. We can find some x and y that move with d < 1, but it's not clear that for any x, there's such a y.


Post a Comment

Popular posts from this blog

Asking a girl out

This is not a puzzle. So, for those of you who follow this puzzle blog, please bear with me for just one post. Interesting Math in this article though :P

Most of my friends already read an article that I wrote more than an year back - "Speak Up"

Here, inspired by the movie, The Beautiful Mind, I give a mathematical analysis of asking a girl out. Nice time it is. Feb 10. No plans for Feb 14 and I am sure this article makes me look even more geekier and all the more reason for me to believe that I will be alone, yet again. But what the hell, lets do it!

Note: This is not an independent analysis. There are many "mathematics sites" which does "similar" analysis.

@Consultants, correct me if I am wrong in my estimates. :P

Why is there a need to be selective?

From the age of 15, I guess there are approximately 3,600 girls I have liked (On average days, I don't see new girls. But going outside, I like about 30 girls. Saying that I go out once every week right …

Consecutive Heads

Let's say A keep tossing a fair coin, until he get 2 consecutive heads, define X to be the number of tosses for this process; B keep tossing another fair coin, until he get 3 consecutive heads, define Y to be the number of the tosses for this process.

1) Calculate P{X>Y}
2) What's the expected value of X
3) What's the expected value of Y

This is probably the hardest puzzle I have ever put on my blog. Hence, I will post its solution in the post directly rather than on comment.

(Solved by me finally after 13 months :))

Make a state diagram. Let the state be (a,b) where a is the number of consecutive heads streak "A" is on currently and b is the number of consecutive heads streak "B" is on currently.

So, (0,3) (1,3) are final accepted states and (2,0) (2,1) (2,2) (2,3) are failure states. If you get tails, your contribution to the state reaches to "0"

f(State) = P(X>Y | "State" configuration initially)

f(0,0) = 1/4[f(…

Fraction Brainteaser

Sent to me by Gaurav Sinha

Siddhant writes a Maths test and correctly answers 5 out of 6 Arithmetic questions and 20 out of 28 Geometry questions. In total, Siddhant scores 25 out of 34. 

Vaibhav writes another Maths test and correctly answers 20 out of 25 Arithmetic questions and 6 out of 9 Geometry questions. in total, Vaibhav scores 26 out of 34.

Note that
a) Vaibhav scores more than Siddhant
b) Siddhant score better than Vaibhav in both individual topics - 5/6 > 20/25 and 20/28 > 6/9

How is it possible?