Return-Path: william@bourbon.usc.edu Delivery-Date: Sun Sep 21 09:21:03 2008 X-Spam-Checker-Version: SpamAssassin 3.2.3 (2007-08-08) on merlot.usc.edu X-Spam-Level: X-Spam-Status: No, score=-2.3 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.2.3 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.14.1/8.14.1) with ESMTP id m8LGL3Cv012853 for ; Sun, 21 Sep 2008 09:21:03 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.14.2/8.14.1) with ESMTP id m8LGNDBv000979 for ; Sun, 21 Sep 2008 09:23:13 -0700 Message-Id: <200809211623.m8LGNDBv000979@bourbon.usc.edu> To: cs551@merlot.usc.edu Subject: Re: cs551-warmup#2 Date: Sun, 21 Sep 2008 09:23:13 -0700 From: Bill Cheng Someone wrote: > Can you kindly explain how shud we calculate the avg no. of customers in Q1 > using measured quantities like enqueue_time,dequeue_time of each customer > and no. of customres in queue(every time a customer is added ro removed from > the queue). You should take a look at the last slide of lecture 5. As I've mentioned in class, you need to calculate the area under the curve divide by the total time. There is more than one way to calculate the area under the curve. Here's one way I've mentioned in class. Let's use the last timeline as an example. You can draw vertical lines at each transition and divide the timeline into many regions: In the first region, there was 0 customer in Q1. In the 2nd region, there was 1 customer in Q1. In the 3rd region, there were 2 customers in Q1. In the 4th region, there was 1 customer in Q1. In the 5th region, there was 0 customer in Q1. In the 6th region, there was 1 customer in Q1. In the 7th region, there were 2 customers in Q1. In the 8th region, there were 3 customers in Q1. and so on Let V1 be the time interval length of region 1, V2 be the time interval length of region 2, V3 be the time interval length of revion 3, and so on. The total aread under the curve is just (sum of (Vi * Hi)) where Hi is the height of region i. Your Q1 should know the values of Vi and Hi and it can keep a running sum. You should figure out the details. -- Bill Cheng // bill.cheng@usc.edu