Yahoo Answers is shutting down on May 4th, 2021 (Eastern Time) and beginning April 20th, 2021 (Eastern Time) the Yahoo Answers website will be in read-only mode. **There will be no changes to other Yahoo properties or services, or your Yahoo account.** You can find more information about the Yahoo Answers shutdown and how to download your data on this help page.

## Trending News

# Fun math question: Find the distance between two cities?

There are 20 traffic signals between city A & B (road starts & ends with a signal), distance between these signals follows Arithmetic Progression. Each of these signals remains on for 2 min & then stays off for 30 seconds. Tom's car leaves from city A at 12.00pm. It goes at constant velocity "v" & reaches city B at 3.00pm.

During this journey Tom has to stop at 8 signals. find the distance between two cities if the distance between first two traffic signals is 1km.

He has to stop when signals are off. I also stuck at this stage. I think they should mention "find the minimum distance" between two cities. I asked this question because I want to know the right answer.

Dr. D & Scythian:

"Are all the signals supposed to turn green and red at exactly the same time?"

Yes, we have to assume that.

This question is from one of the old puzzle books of Shakuntala devi, I do not have the solution book with me :(

Special thanks to Dr. D & Zeta, BTW Zeta it is safe to assume that the driver stops the full 30 seconds each time.

### 9 Answers

- 1 decade agoFavorite Answer
I can formulate a systematic way to do this, but I don't know if it's simple at all. I am assuming, like you said, that all lights (starting from when the car begins to move) turn on and off simultaneously.

Here is a graph to better understand things:

http://i645.photobucket.com/albums/uu171/retinap33...

Basically whenever the red line (which is the car's motion) "hits" any of the segments (which are the stop lights) it has to stop immediately and wait until the end of the segment, and then continue.

Let total distance be 1 + x*k; Let t1 be the time it takes to reach the first light. And for now, re-scale the time so that 1 second is 30 seconds (which means the car took 360 seconds to reach city B). The whole cycle of the traffic signal's on and off is 5 seconds. So however long it takes to reach light 1, divide it by 5 and look at the remainder. If the remainder is more than 4, it has to stop, and it has to stop for exactly 5 minus that remainder. I will formulate it using the greatest integer function (and this is only an experiment) ([[]] is the greatest integer function)

Define:

R ( t ) = t - 5 [[t / 5]] ..........this is remainder when divided by 5

HaveToStop( t ) = [[ R ( t ) / 4 ]]

StopTime( t ) = [[ R ( t ) / 4 ]] * (5 - R ( t ))

HaveToStop is 1 if Tom has to stop at that time, 0 if he doesn't.

Let t1 be the time it takes to get to the first light and the stop time there; t2 is the time to get to second light from the first and the stop time and so on.

t1 = 1 / v + StopTime( 1 / v )

t2 = (1 + x) / v + StopTime ( t1 + (1 + x) / v )

t3 = (1 + 2x) / v + StopTime ( t1 + t2 + (1 + 2x) / v )

so on.

Our first equation is:

sum(i = 1 to 19) ti = 360.

Second restriction is that there were 8 stops. So:

sum(i = 1 to 19) HaveToStop( sum(j = 1 to i - 1) tj + (1 + i x) / v ) = 8

These are two extremely complicated equations in two unknows. And my computer is giving up!

Sorry it's kind of late tonight for me to continue; maybe more to be added. Hopefully this helps with the problem a little bit.

(maybe the author had assumed the driver stops the full 30 seconds each time, which would drastically simplify life.)

***************

Got it! There are definitely more than one answer (looks like an infinity of them). Here are 9 of them:

(v , x) =

{ (0.104, 0.106), (0.1045, 0.107), (0.2155, 0.337),

(0.216, 0.338), (0.2165, 0.339), (0.217, 0.34),

(0.2175, 0.341), (0.218, 0.342), (0.2185, 0.343) }

Just using the first one, x = .106, distance between two cities = 19 + 171 * .106 = 36.126 km. (this is most likely the minimum) So Dr. D was right also! Good guess!

Actually If we assume the driver stops each time for full 30 seconds, we wouldn't be using the "on for 2 min" information and the synchronization gets messed up; so let's not assume that.

- Dr DLv 71 decade ago
Well obviously the distance

L = 19 + 171y km

where the arithmetic progression is 1, 1+y, ..., 1+18y

You said there are 20 lights beginning and ending each street, therefore 19 streets.

Time taken (of actual driving) is

T = 180 - 0.5*8 = 176 mins

Speed, v = L/T = (19 + 171y) / 176 km/min

Now I believe the key is to find a value of y such that he is able to make it from A to B with only 8 stops and 12 go's. I think it's safe to start timing after the first go, so we now have to fit 8 stops into 19 traffic lights.

To be continued.

*EDIT: one little correction before I tackle this tomorrow. His driving time is not necessarily 176 mins but anything between 176 and 180 mins. That's because we don't really know as yet how much time he spends at each light. Like scythian pointed out, we do have to make some assumptions about the synchronism of the lights. I'll assume that they all show red and green at the same time, then I'll attempt to find v and y such that he gets 8 reds.

******************

I'm pretty sure this is not what the book intended. But here goes.

L = 19 + 171y

where L(n) = 1 + (n-1)y = length of nth street

and L = ∑ L(n)

v = velocity

We assume that the traffic lights are go during the time intervals 0-2, 2.5-4.5 etc and are red during the intervals 2-2.5, 4.5-5, ...

generally red during {2.5k - 0.5 to 2.5k}

He starts the 1st street at 12:00 or t = 0.

For the nth street, he takes a time of

T(n) = [1 + (n-1)y] / v

Whenever he reaches a red light, he has to wait until t = 2.5k for the light to turn green.

With this timing of the lights, he needs to actually reach the end of the 19th street at t = 179.5 to 180 mins. Either way, the final light will turn green and he reaches exactly at 3pm.

I don't have clue how to solve this problem using purely mathematical techniques. But there are numerical codes you could write, or spreadsheets. The objective is to vary y and v until we get a total of 8 reds and an arrival time of t = 180 mins. There is probably not a unique solution, but the best I can come up with so far is:

y = 0.1 km

v = 0.2025 km/min

This gives a total of 7 red lights out of the final 19. We can always say that at 12pm, he just barely gets a red on the 1st light to make up the 8.

This gives a total distance of 36.1 km.

I'll go with this until I can find something better.

*EDIT*

It seems like Zeta has found a more efficient way of finding the solutions. Using his first solution in my spreadsheet, I am getting truly 8 stops (not including the very first light which should be green anyway). Note that his "x" is my "y".

It's working for y = 0.106

but v = 0.208 to get the 180 min finish time.

This is giving red lights at the end of streets 1,4,7,9, 12,14,17,19.

But the other solutions v = 0.434 km/min (26 km/h) and y = 0.34 km (L = 77.1 km) seem most realistic.

- MathsorcererLv 71 decade ago
The arithmetic progression of distances should make the distances between lights look thusly:

1 km, 1+n km, 1+2n km, ... for a total distance of

1 + 190n km.

The trip took 3 hours but he stopped for 8 lights. The lights took up 8(.5) = 4 minutes, so he actually drove for (180 - 4)/60 = 2.9333 hours.

At this point, I am not seeing what piece of information I am missing. We presume that

v = [1 + 190n]/2.9333 kph but that doesn't help us any. We can plug in values for n and that will tell us how fast the car has to go, but that isn't really the answer, either.

one other question: does he have to stop when the signals are on or when they are off?

Doc D below me corrects one small mistake of mine: I added one too many distances between lights. It should be 171n.

- KellyLv 45 years ago
Ok let's start a journey, both to your destination and a method for doing it yourself every time you want to work this out The car averages 22 miles per gallon, so every time you go 22 miles you use a gallon of fuel (on average) the total journey is 2096 miles. If you divide this long journey into 22 mile bites, you need to find out how many of these small journeys make up 2096. You get this by 2096 divided by 22 2096/22 =95 and a bit journeys each of which uses 1 gallon of fuel if the fuel costs 3.20 a gallon, multiply the number of gallons by 3.20. 95 times $3.2 is approx equal to $290 Actually the gallons was a bit more than 95, so round up the cost to approx $300 and if you want to be on the safe side, allow a little more money, in case the wind is not in your favour. This is a down to earth description for someone who wants to work out the cost of a journey - not a homework answer good luck and have a good trip

- How do you think about the answers? You can sign in to vote the answer.
- ShadowLv 41 decade ago
The distance between the first two signals is 1km and the distances follow an arithmetic progression which means that the distance between each of the signals is 1km

there are 20 signals and the road starts and ends with a signal so that means the distance is 19km

....

- Scythian1950Lv 71 decade ago
You do have to state how the timing of the signals are synchronized. Otherwise, I could time each signal independently such that he breezes through all but 8 of them, and even those 8 signals turn green as soon as he stops, so that he could essentially drive from A to B nonstop.

Are all the signals supposed to turn green and red at exactly the same time? For the purpose of this problem, we probably can assume that yellow signals be lumped with green signals.

- Sssss SLv 41 decade ago
I honestly cannot believe the stupidity demonstrated by the answers so far, when the answer is clearly simple:

You call Tom and ask him what the two cities are to mapquest the distance!

- Scrander berryLv 71 decade ago
Sorry I dont have the energy to think about this too much right now and it looks like Doc D is doing well. I just wanted to point out my amusment with the person driving at constant velocity - how does he stop and start at the lights?

Anyway - nice question, have a star

- Anonymous1 decade ago
let the answer be x