A large number of waiting time problems have an exponential
distribution of outcomes. We shall see (in Section 5.2) that such outcomes are
simulated by computing (-1/?) log(rnd) where ?>0. For waiting times
produced in this way the average waiting time is 1/?. For example the times
spent waiting for a car to pass on a highway or the times between emissions of
particles from a radioactive source are simulated by a sequence of random
numbers each of which is chosen by computing (-1/?) log(rnd) where 1/? is the
average time between cars or emissions. Write a program to simulate the times
between cars when the average time between cars is 30 seconds. Have your program
compute an area bar graph for these times by breaking the time interval from 0
to 120 into 24 subintervals. On the same pair of axes plot the function f(x)=(1/30)e-(1/30)x.
Does the function fit the bar graph well?