Question: Write a program in either Java or Python to simulate the following experiment: There is a region with small towns connected together by a network
Write a program in either Java or Python to simulate the following experiment:


There is a region with small towns connected together by a network of roads. In each town is a traffic light and traffic going through a town takes one of two routes out of the town, depending on the traffic light If a car enters town A, it moves to B or C, then to D, E, or F, and proceeds through the network reaching P. The car leaves one town going to either of two destination towns according to probabilities in the following table: 1.9 2.8 3.7 1.9 4 .6 2.8 3 .7 1 L .4.6 1.0 1.0 1.0 The time to drive the roads between towns in minutes is given in the table below 4 6 Write a program to simulate traffic flow with 10,000 cars. Calculate the average Run this program 10 times and compute the average transit time for 100,000 cars Compare the 10 runs of 10,000 with the one run of 100,000. transit time from A to P and calculate the standard deviation. and the standard deviation There is a region with small towns connected together by a network of roads. In each town is a traffic light and traffic going through a town takes one of two routes out of the town, depending on the traffic light If a car enters town A, it moves to B or C, then to D, E, or F, and proceeds through the network reaching P. The car leaves one town going to either of two destination towns according to probabilities in the following table: 1.9 2.8 3.7 1.9 4 .6 2.8 3 .7 1 L .4.6 1.0 1.0 1.0 The time to drive the roads between towns in minutes is given in the table below 4 6 Write a program to simulate traffic flow with 10,000 cars. Calculate the average Run this program 10 times and compute the average transit time for 100,000 cars Compare the 10 runs of 10,000 with the one run of 100,000. transit time from A to P and calculate the standard deviation. and the standard deviation
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
