lab #5 worksheet ---------------- - make a new folder for week5 - files for this week: w5exp.m w5queue.mws - start matlab & change to the week 5 folder warm-up ------- - run "w5exp", it shows 2 ways to generate transition times that obey the exponential transition time process of section 6.2. it also generates the associated probabilities by making a histogram of how often a transition time falls into an interval (t->t+dt). note: i used both "hist" and "histc" as was most appropriate in each case. WHY? - figure No.1 is made by direct simulation of figure 6.1. - figure No.2 is directly made by a single call to "rand"! - conclusion: there is a direct method to simulate exponential transition processes. - in-class challenge: what is the mean and variance of the two methods? * be sure that you understand why the direct method works before you leave the lab. - superbonus: "w5exp.m" seems to have a statistical glitch at t=3+3/8 -- why is this? (i've got no clue right now.) study #1 -------- - use the direct method of generating exponential transition times to simulate the arrival times for the queueing process of section 6.3. - you DON'T want to use figure 6.2! we will use that approach in lecture tomorrow. - build a matlab script that does a simulation loop of the queueing system of section 6.3. at t=0 there is nobody in line. then arrivals happen "randomly" at intervals distributed by an exponential transition time with mu=1. - build a simulation loop to collect the following data. (mine is an easy rip-off from the w5exp loop!) a) average queue size at t=25, b) variance of the queue size at t=25, c) probability histogram of queue sizes. $ how many simulations one needs, seems to be a good topic for the discussion forum. $ use Maple to calculate the p_j(Ndt) probabilities using the combinatorial formula given in lecture for the center of the distribution. it is valid for the limit as dt->0. how well did your simulation fare? to what extent can you tell? study #2 -------- - use the direct method of generating exponential transition times to simulate the car arrival time for the street crossing process of section 6.4. - build a matlab script that does a simulation loop of the pedestrian system of section 6.4. pedestrian arrives at t=0. then cars pass by "randomly" at intervals distributed by an exponential transition time with mu=1. - build a simulation loop to collect the following data, as a function of how large a gap time between cars that the pedestrian wants. a) average # of cars which pass (assuming pedestrian doesn't wish to use medical coverage & SUV drivers don't stop to let people cross), b) variance of the # of cars, c) probability histogram of # of cars. collect similar data on waiting times. $ confirm as many of your results as you can using the material of the lectures & text. (discussion here will likely generate hints & ideas.) hopefully wednesday's lecture will add some ideas.