Find the expected waiting time in traffic lights.
A driver must pass 10 traffic lights on a certain route. Each light has a
period red-yellow-green-yellow of two minutes, of which the green and yellow
lights last for 70 seconds. Suppose the driver arrives at a traffic light at
some uniformly distributed random point of time during the period of two
minutes. Compute the corresponding waiting time. Repeat this for 10 traffic
lights. Run a large number of routes (i.e., repetitions of passing 10 traffic
lights) and let the program write out the average waiting time. Does the
computed time coincide with what you would expect? Name of program file:
waiting_time.py.