You are travelling at a constant speed along a road. There are 5 sets of traffic lights along this road, and they all start their sequence at the same time as you pass the zero mile marker.
At what speed do you need to travel in order to remain at your constant speed?
traffic light 1 at 3 miles is red for 36 secs and green for 22 secs.
traffic light 2 at 4 miles is red for 28 secs and green for 40 secs.
traffic light 3 at 6 miles is red for 41 secs and green for 17 secs.
traffic light 4 at 7 miles is red for 62 secs and green for 15 secs.
traffic light 5 at 9 miles is red for 46 secs and green for 25 secs.
Note, the speed is an integer, above 25 and below 100MPH.
I used excel to determine whether each light would be red or green at the selected speed. The key formula uses the Mod function and the fact that you will reach the light in Green if the remainder of the time to the light divided by the cycle time of the light (red + green) is greater than the red time.
Using this formula, a matrix 5x74 displays R or G for each light at each speed between 25 and 100. There is one solution, 47 mph, at which all lights display G.
|
Posted by ivan
on 2005-03-28 22:43:30 |