×

### Let's log you in.

or

Don't have a StudySoup account? Create one here!

×

or

## Simulation

by: Aliza Ruecker

13

0

5

# Simulation CSCI 426

Aliza Ruecker

GPA 3.56

Evgenia Smirni

These notes were just uploaded, and will be ready to view shortly.

Either way, we'll remind you when they're ready :)

Get a free preview of these Notes, just enter your email below.

×
Unlock Preview

COURSE
PROF.
Evgenia Smirni
TYPE
Class Notes
PAGES
5
WORDS
KARMA
25 ?

## Popular in ComputerScienence

This 5 page Class Notes was uploaded by Aliza Ruecker on Thursday October 29, 2015. The Class Notes belongs to CSCI 426 at College of William and Mary taught by Evgenia Smirni in Fall. Since its upload, it has received 13 views. For similar materials see /class/231163/csci-426-college-of-william-and-mary in ComputerScienence at College of William and Mary.

×

## Reviews for Simulation

×

×

### What is Karma?

#### You can buy or earn more Karma at anytime and redeem it for class notes, study guides, flashcards, and more!

Date Created: 10/29/15
CSci 426526 7 Simulation 7 Fall 2004 Examples To help you get a sense of my expectations enclosed are partial solutions to three typical exercises These three exercises illustrate the range of solution types77 you will be expected to produce exercise 122 This is a multi part exercise that requires a modify an existing program7 do some computing7 and explain what you did solution Note the explicit reference to relevant material in the text As an alternative to the in line format used to discuss how program ssql was modi ed7 you could provide a printed copy of the complete modi ed program with a highlighting marker used to clearly identify the modi cations exercise 124 This is a provedemonstrateshow mathematical exercise that requires of course a mathematical solution exercise 211 This is a multi part exercise that requires a little bit of math and a build from scratch program with corresponding numerical results Note that a printed copy of the program is included as part of the solution Note also the explicit reference to relevant material in the text You will note that all the solutions are typeset I happen to use MEX for technical typeset ting some prefer to use plain TEX You can use either7 or neither7 or you can use any other document preparation system you are familiar with 7 provided it can do a decent job with technical typesetting If you prefer7 you can write your solutions neatly by hand I care much more about the content than the style Exercise 122 1 Modify program ssql to output the additional statistics 7 j and i b Similar to example 128 use this program to compute a table of l j and i for traf c intensities of 06 07 08 09 10 11 and 12 0 Comment on how l j and i depend on the traf c intensity d Relative to examples 128 and 129 if it is decided that j greater than 50 is not acceptable to ddd precision what systematic increase in service times would be acceptable 1 The modi cation is based on the equations in theorem 121 or equivalently Little7s equations see page 129 In particular relative to these equations when program ssql terminates there will be the following correspondence between mathematical quantities and program variables on lt gt departure 271 wi lt gt sumwait 7L i1di lt gt sumde1ay 21 5139 lt gt sum service Because with analogous equations for j and i it follows that the only modi cation that must be made to program ssql to output l j and i is the addition of the following three printf statements printfquotaverage nbr in the node quot sumwait departure printfquotaverage nbr in the queue quot sumdelay departure printfquotutilization quot sumservice departure b Using the data in the le ssq1dat produces a traf c intensity of EF 2 0721 To change the traf c intensity to a speci c value say p we can multiply each service time by p0721 At the expense of needing to re compile each time p is changed the easiest way to accomplish this modi cation to program ssql is to add the line 0 define FACTOR 07 0721 to the beginning of the program for p 07 and modify the function GetService by changing the return to o returnFACTDR s With these Changes to program ssql7 the following table of results is produced traf c intensity i j l 060 060 096 156 070 070 168 238 080 080 299 379 090 090 749 839 100 099 2585 2684 110 100 6944 7044 120 100 10586 10686 c Etc d Etc Exercise 124 Complete the proof of theorem 121 The solution to this exercise is based on the proofderivation of the wait77 equation on page 1297 modi ed to handle the delay and service77 equations To derive the delay equation7 for each job i 12771 de ne a delay indicator function 0it that is 1 when the ith job is in the queue and is 0 otherwise 6m 1 al lttAlt b 0 otherw1se Then the number in the queue at time t is and so V L V L Ahqnm Emmi Mimi ZUM ai Edi i1 i1 The service equation can be derived in a similar way Or7 as an alternative7 note that lt qt t for 0 lt t lt on and mi dl sifor112n so that we can use the wait and delay equations to derive the service equation7 as illustrated iil 11 Zltwi 7 di i1 Exercise 211 For the tiny Lehmer generator de ned by 92 ax mod 1277 nd all the full period mul tipliers a How many are there b What is the smallest one 1 Because the prime factorization of m 7 1 126 is 2 32 7 and because 2 7 1 3 7 1 7 7 1 lt gtlt gtlt NHL 36 2 3 7 from theorem 213 we know that there are 36 full period multipliers b Provided the program parameter A is a full period multiplier7 the enclosed program7 based on algorithms 211 and 2127 generates and prints nds all of the 36 full period multipliers If A is not a full period multipler the program will produce no output By inspection of the output we see that 3 is the smallest full period multiplier exercise 211 the output is 3 116 109 92 86 12 83 112 55 114 48 78 67 93 106 65 58 14 118 46 43 6 56 91 57 45 39 97 110 101 53 96 29 7 23 85 inc lude ltstdio hgt define M 127 for this modulus define A 3 3 is a full period multiplier long g long X return A X quot0 M long gcdlong a long b from appendix B use a gt 0 and b gt 0 longrab while rgt0 ab br rab

×

×

### BOOM! Enjoy Your Free Notes!

×

Looks like you've already subscribed to StudySoup, you won't need to purchase another subscription to get this material. To access this material simply click 'View Full Document'

## Why people love StudySoup

Jim McGreen Ohio University

#### "Knowing I can count on the Elite Notetaker in my class allows me to focus on what the professor is saying instead of just scribbling notes the whole time and falling behind."

Kyle Maynard Purdue

#### "When you're taking detailed notes and trying to help everyone else out in the class, it really helps you learn and understand the material...plus I made \$280 on my first study guide!"

Jim McGreen Ohio University

Forbes

#### "Their 'Elite Notetakers' are making over \$1,200/month in sales by creating high quality content that helps their classmates in a time of need."

Become an Elite Notetaker and start selling your notes online!
×

### Refund Policy

#### STUDYSOUP CANCELLATION POLICY

All subscriptions to StudySoup are paid in full at the time of subscribing. To change your credit card information or to cancel your subscription, go to "Edit Settings". All credit card information will be available there. If you should decide to cancel your subscription, it will continue to be valid until the next payment period, as all payments for the current period were made in advance. For special circumstances, please email support@studysoup.com

#### STUDYSOUP REFUND POLICY

StudySoup has more than 1 million course-specific study resources to help students study smarter. If you’re having trouble finding what you’re looking for, our customer support team can help you find what you need! Feel free to contact them here: support@studysoup.com

Recurring Subscriptions: If you have canceled your recurring subscription on the day of renewal and have not downloaded any documents, you may request a refund by submitting an email to support@studysoup.com