You are on page 1of 157
Simulation iad Fourth Edition FASEViER Sheldon M. Ross Ein Darn of Inve ‘and Systems Enginesring University of Southem California: ‘SiS ine: in Ree oct timer Seat (See Dia sin Siete: Peace (et Race Te Mead Dak Matmtg Ce {Pores Se, Barapa, 20 om, Uk £255 Tee: Stes Sug Ca SOLAS USA Stents and Laue WE BOR ‘Parner ae pe 8 apie 200 Eur, lee ee Nogaro aun mt eed ab iy emo (yy en ecm or hes pote ty Seeder oe rn Se Pe my ee ily du Bae cs Talay ‘igs pratt Gel UE pee (20 1S SOHN eC 1S {Sith cla yan Sow yo cone ar tet {Binet Shee tops pavtcnmy ee"Ces ‘Sie st ae" es ayo Congr Capi aed Data sen mee et ibrwy Cat Petes Da SLOTS etal te he i nay eaeeeeeene aT ‘Working together to grow libraries in developing countries crenaniacom | wrod | rosie oa o 9 3 s 2 e Preface ix V Introduction 1 ereiser 3 2 Elements of Probability 5 2A Sunple Space md Eveats 53 22 Axioms of Probeiliy 6 ' 23. Conditional Pobbiity and Independence 7 24 Rendon Vash 9 25 Expectation 11 25 Vatios | 27. Cebyibev's logo ad the Laws of Lge Nunbere 6 28 Seme Discrete Rendon Vacs 18 4 Binomial Random Vinsbles 18 Prison Rendon Varies 20 Ceomesie Rndom Vartles 2 “The Neguive Binomial Rance Vaciable 25 Hyyerpeomeric Random Varables 24 29. Coins Random Vatiables 26 Unifooly Disubued Random Variables 25 ‘Nowmal Randa Varibler 25, Exposcota| Random Veribes | 27 ‘The Polson Process std Gaxoma Random Vaisbes 29 : “The Nonborogracas Poisson Prcces 32 2110 Condinal Bxpecttion and Conitonl Variance 33 “The Conditional Variance Forms 24 Beis 35 References 39 3 Random Numbers 41 Tneodicton 3 Pewonadom Nomber Gesestion 32 Using Rslom Numbers Evaluate Integrate 42 reins 6 References 4 Generating Diserote Random Variables 49 41 Tye lero Trosform Mind 9 42 Conuaing 2 Pence Ranom Varah 55 43 Gomrsing Dini Radom Vase 57 44 The Acceptance jen Tecaige 58 45 Tor Comportion Approach ) Simi if sa ae jointly conisucas with density Ration fl} an ‘hy wil be independ if ud aly if, forall x, A= LMOD nts fi) sed (9) a the density Fetons of K and Y, respi. 2.5. Expectation (ne of the most wel euncets in probably is Ua of dhe expectation of x atk vacible, IF X is sere random varable tat aks a ene of tbe 122 ementsof Probably posible vales 2.2. then the expectaon or expected value of X, alo ‘led th mean of Xa dated by 4) dein by A= Sater 2) In words, the expect va of X 84 woh average ofthe pote vale "aL can tke on, eae vale beng weighted by the probability that X assumes ‘For example, die probebty mas fusion of Xis ten by P00) 1 seni-0(2)+1( it ono eng eb al Xan se Srey then a= anco()))-4 4s weighed average of te two possible values O and 1 where the ve #58 sien ice as nc weight ste vale O sac (1) = 2900), Example 2b IF 7s anncictr random vasable forthe event A hat if 1 ie A occurs 0 A does not occue EU) = 1) +0049) = C4) ot eps te nat rani eae oe et At the probably that A oss, 1 ss eontinoous rao valle haven. probably density fancon (an, nstogous to Euston (22), we define the expe vale of X by 25 trpeaaion 13 Exomple 2c if he pobsbliydeasly funtion of Xs given by wo nderct * 110 Saeeie “arace3 any=['weeo} # Suppeso now thet we waned to detemige the cxpeted value not of he ranom vale J but ofthe random variable g(¥), whose g is ome given fucton. Since g(X) tates onthe value g(s) Whoa X thas on te vale x it ‘somite dn p(X) shoal be a weighted average ofthe posible alos {30 th fore given th weight piven to es) bang qual he probabiy {Gx probity density i the eoctinsous ese at X Wil equal x Inde, te Jretedng canbe shown to be te and we dus hae te flown res Proposition 1X tsa dtcete random variable hong probability mats incon pO) hen Age = Este) whee f comics wth probability et eto) hen aigcanl= [7 stoiads ‘coment shove repens tolling Corollory few bare cont hn Hot +8) = atta Proof inthedasee cae Blex-+4) Year+ be) seL wrens oD 00) s+» ‘Sino the prot i he contnnow cas shu, the esa sestbinhed, 142 laments of Probaity ‘ean be showa hat expscaton I inear operation in he sense a fo any ‘vo tandem vanahles X, and X, FAR HG) A) ny ee [Ex]-Sen 26 Variance ‘Whereas EX), the expected value of the rom variable X, isa welaied sverage ofthe posbl vals of, yee no information aut We vation these ales! Ono way of messing thie vation eto coma he evens Value ofthe squeof be aitference between X and E12], We a tae ed he following defn, Definition 1 isa rao sail wth mea thn te verano ete Va), ened by Ver) = #1084) ‘An lemativ formula for Va(X) is detived as ows: Ve) = EU) PEA) ey Proof Dai ram vale¥ by fa, 4X 2a jo, wx , 1 Piel = Aad Proof Since (f~u)/o* isa poaneatve random varable whuse mean is ofp] = 285071 seco nat o[spar) xh ‘Te tl om lo nce he egy (nfo? i eat 0 the nega [X= fe ‘We now te Chebyshers inaquaity rove the weak law of Inge numbers, ich sesh the pot hat be average of he at eas a sequence independent adel isuiboedandow vals aes Hom ts ean tyme ian pesto Oa m goes to ay. Theorem The Weok Law of Large Numbers Let XX... be ospuence of Independent and Weis drut random veri sing ‘neon Then for any > 0, {pee B > ]20 roe Proof We give 2 proof tner the adieral sisumsion tht the random ‘alates, havea fine varace ©. NOW ] 1 ) a tv tv of] Late tape xy 5/9. 182 Element of Probabitty Where the above eqeton makes we of the fact tat te vines ofthe sm of inlependent random verble is oq the sn of dit vasacee, Hence, ‘om Chetysbev's equality, flew that foe any positive © ai ce, fo ay €>0, by ling I be such tat ho / =e, tha i, by leg Benet/oh we se at {ffeenee which exiahshs the este 2 ‘A geonnlizton of tho weak law ithe song law of large mutes, wc, ststes th probly hin ett ‘Tht, wid ceri, the long-run aveage ofa aquanc of independent ant ‘Meuse disband vas Wil converge 8 ren, 2.8 Some Discrete Random Variables ‘There are censin yp fandom variables that quently ppt in pions, Jin seevon we sur soma ofthe dee ones Binomial Random Variables ‘Seppe da independent as, each of which result ia “acct with ‘poebIiy pa tobe performed If represents tw auch of succes that ocar i he tials then % iid to Rea hnomie ndonvaible wih rmees (a) Is probably ms non is ven bY (econ, ioe 9 Q-we5 Js the bincmial cavtlee equa to the mimber of ifrot sutets f enns ‘at canbe chosen fam «st of r elemest, alr. store » “The vat of Equation (25) can be sen by Sitting tht the probability of any parculr sequence of outcomes that tess inf siceeses tad n=? fess, bythe sumed Independence of was, 9 (I—-p)"*- Bq (25) then follows sine ere ae () diferent sequences Oe outcomes thal esl ln scenes and i flesh can be sera by ong thr are (°) deren ebeices of th tala that st in ween, ‘binomial (1yp) random vr cliad a ernll random vcs, Since 1 blondes varie X sepesent the number of sects in ‘nependet ia each of WHEh ruts In a secs With pada p, Weed repent ta lows cy whee 1 ifthe a ea Is 2 sss 0 otherwise ow AKI PO th [i]-n0a? a=W) wher the above eqaon ones te fet tit A? = (Soee OF = 0 aed Frst)-teace de representation (26) yes hat, fo bso, pando. varisbie X Ya) vaio) =F5¥a(K) sae the Xs ndeeatet np(l~p) ‘The following recursive formula expressing In tems of ps uel when comping he Binomial potable: Pa BET moo yor ft a rd 202 oman of Prebebiy Poisson Rondom Voriables ‘random varsble X tht takes op on ofthe valves 0,1 2,6 aid wo be a Piss dom ible wih pruter 1 A> ifs probability mas function isgiveaby, panomnnet ‘The symbole, defined by ¢= liye =(1-+1/0), ea frou constant in ath tics hati roy egal 027183, Poison random variables have a wide sane of applications. One reason for ‘tj hts random variables maybe sed © apreximat the dsbuten of ‘etme f sucess it age babe of rls (vai re eter independent of a most "wealy depeadent") when cach Wal fon x snl probity of tring ¢ success. To see why hs is, Suppose hae X i 4 tno random ‘arable with pamotts (,p)—aad so eepreent the same of acces 0 ‘independent male hon exch ti sce wih pecbably pnd let Ane Then Pix ot aah) (2) la 1)---(a—t4 1) Aye ant oii Now for lage aad » sl, (ine ‘ence, fr lage and p smal, nea) Oni) Since he mean and variance of biol random vrale ¥ ae given by Bienp, Yar) =np(t—p)% np forsmall Iris itive, sven the elaionhip baorsn binomial and Poston random ‘ails, tha ora Poston ano Sarl, vine parame AUX} =Varee) = ‘As aaalpic poof of the above sot san exerci ny 2.8 Some Discrete Rondom Veriables 21 ‘To compu the Polson probabliis We make use of the folowing recursive fot x. equivalently, Suppose tha cents number, of events wll cur, wher N 5 2 Ps: ‘oon variable with ean . Suppose further tht each even that oe wil, Independently, be eer aye 1 event with probably oF type 2 event wih robebily Ip. Thus, i is equal ote eunbe ofthe evens dat we P= izl,2,thea N= Ay +2, wefl sess thar he anda variables 8 ad iy re indapenden Poison random variables ws eopocive means AIGI=Ap ALN =A) “To prove there, let and be noma probability P(N, =, Nm). Beemose PUN, {olioning on wheter =} ys spect, and conker the jolt th =mN #40) PUN, =n =) = -em)P(N =n b) eee = PUM = ame owews given that N= -fm, Beem cach of he nm events indepen ety ether a typ 1 event with probably or type 2 Wit probably Ip, Icfollows atthe umber of he at ae pe | 6s Binomial undo ails vila paameters 9-4, p Content, rental (22) rome Srna aT 20 ee eA wo 0 Al ing PPI 222 lemant of Probabity ‘Summing over m yields ha PON = 0h = EP m ae een All=p)” Simi, roam) 0 ssid to bean exponential rndom vrshle with parameter Ins cumulative dacbon i given by Oaxe0 1s ayo very that he expt value an vs of uh den vibe ‘teas follows 1 1 mist mt van 5 “The key property of expenctial dom vals Is thar they posess de wemoryiess propa,” whee We say tht the nonnegative random Vateble X ismemoryes i Petits =1) ferallee0 0) ‘To udestand why te dove i called tbe memoryes propery imagine hat represets the lifetime of some uit, and consider the frobbiy ata ut of ge» wl survive an aitonal ie f Sines this wl coor i he ite of the uni exceats 74-5 given tat ssl alive at ines, we so het Pladcional feo an tem of age x exends 2) > bith “Thus, Eauation 2.40) +2 sttement of fas hat beds of te remaining [Me af an tem of age + doer oot depend on x. Tit fy it ant neces 1 rember he age of the uit boo dstbaon of romain ie ‘Equation 2.1) i eguialent © Pees et Pex gees a) As the above equation Is suled whenever X (sa exponcul random ‘ariable~snce, inthis case, P(X > a) =e-—e ae hel exponetel radon ‘riables ae memoryless (id ded ii ot cl to show te they a te nly memoryless random Yaa) Aner uefl property of exponontal eon: vibes i that they somsin ‘xpaental when mule by postive cons. Tose his spose tht X ‘Sexpateniel wit puree A apd lot ¢ be peste cuter Then Plex <3} fr A PtH nea fe niin, O, if @ xO) (©) The munbes of eveats ocaring in disjoint ne inrvals re independent 302. ements af robaiity (0 dato of he mar of rs at arte te ch oe hei of einer and aon octe, (0 tg ET (0 im, AB "Thus Consion (a) sas tut the proves begins cine 0. Condon (8), the Jndependen increment asvenpion, ss ht the tuner of events) le [ies N()]isindepeadect ofthe cub of event that our brween fad 2 ie, Ness) —A()], Contin Cth stationary ineromonassimpson, sates ‘hal he potty dtbaton of Ness) Af) fe sare fea values of ‘Conions (4) ane) sme hat Loa Sua mers of tna the probably ‘of one event occuring is approximately Ah, whereas the proba of 60 0 snore is wrote 0, ‘We now argue hat tes assumptions ply hat the mumber of eens occu ‘ing na imerval of ont # sa Poloon encom variable ith monn. Toco 5, consider the interval (0, and break sp isto enonoveapping svn lt eng fn (Figure 23). Consider fst the suber of hee sober i ‘nan an ever. As each sbimervl independent fy Cancion ()] consis ‘event wid he sume probably [by Canton (2), whic ie epproimatly equal i i flows hl the umber of och interval i bisa ero ‘arable wih awe # and p~Ar/e Hence, by de argument yielding he envergsace of te bisa the Poco, we se ty Sting» oe tate umber of such subiservalscooserges oa Poison random vale with men Ars tean be shown ht Coan (2) impli that he probably at any ‘hese sbitrvalsconabs to or mere evens goes 100 a8 n> fiw ‘tat Mi), the user of ever hat cee io (0, Poison rand vse vith mean ok ¥ ~ wie Figure 2.3 the tne (0.4 Fora Poisson proces let dete the time of te fit even. Furemare, focm> Ie, denote e clapied tine betee te (nt ad de ith eve ‘The sequeeco {%q,n= .2,.--] is eled the sequence of itera! tines For instance, 2) en ¥,~10, hen theft event of te Pesnon process vl ova at time's and the second a tine 15. "We pow dereine the dstsbation of the X.To do 0, wo fr ote tht event (> 2 aks place if and onl fm event ofthe Pson process onset inthe inva (0, hus POR, =) = PUN =0) 29 Continwous Ronde Veribles 3 eco, X; san exponential deibation with meas 1/2. "To obtain the dis Iain of nate that Pha = P{o even i 841%, 9) = Pio oven 64) where the It we equtions followed from independent and stationary incre ‘peas. Thrfre, fom the fregisg, we conclude hat X sso anexponcdal ‘dom varale with mean 1/4 and Ftbempoe hat X; is independent of epatng he same agunen yi Proposition Te terval tines X},Xy.. are ldependet ond ident cally darned exponent rand vribles wi parameter Let 5, = Ef. %; denote the thne of the nth evest, Since S, will be less than cular ifaniony tbs he ton ascent Pis.c=A000 20) Sah Let Since the lft and sei te cumulative dssitson facto of Se bai, spon lfreaaton, tat he deny funtion of 5,—eal if} given by Fo ne Fr ggra bh ya yee eigen Sy al sot Bea Definition A radon yariable faving probebiliy densi actin aor ay sald be agama random variate wi parameters (a2) fg =he™ reo “Thus we se tS, he dane ofthe nth vet of «Piston process having rate Aisa gamma random variable ith parameters (4). In ain, we obin ‘= 5X, aude previous proposition, which sated hr ese Xa independent eipoantals wi ete Ae fllowig erally 322 ements af Probably, Corallory Te su of m ndependnt exponential randow variables, each having porameer A sa gomina random narable with parameter (3). ‘The Nonhomogeneous Poisson Process ‘rom a modeing pit of view the major weakness of he Poisson proces iis snmpton tat evens are js ly to oceur inal intervals cf equal size. A ‘seein, which selaes ts ssunpton, lest the mobomopeneus ce sonsuonsry proces. Th "evens" re oocring randomly in time, and Mo) deoots the sumer of events tat occur by tine then we say dat (M2, ¢ > 0} consti 2 ‘enbomogeaeus Poison grocers with intently faction h() =, i (0) a0) =0. (©) Taeuber of ovens that cca in sj ie tervals ar independet. (6) Unjag Plesaely 1 sven between rand ¢ + 4)/h = A) (@) lim PP or more events Been Fan +A "The fnction me) defined by mid [Ady 20 ce ene ns, The vrei an ied Proposition (¢4s)~—N() isa Passo randam variable wok mean m+ ame. “The qnotty A(),caled te intasty a time, intcatashow likely tisha event wileccuraround theine [Note Ut es 41) = ti sonbemopeeat ‘vers othe anal Poison process} Te following peopesion gives ¢ wet ‘way of lnespretag. « nonomaseneos Pisson proces Proposition suppose that ovens are accering aeconing 10 a Poison proces; having rath, ond suppose tha, adapenesly of anything tha came before, am even thar oceurs a te Is cued wh probly 0). Then the ‘proces of coud evens constiates a nanhomogencons Polen Drees dh fons faction NG) — Ae Proof This poposon is proved by noting tat te previously piven cm ‘ons ae all said. Cantons (a), (0) an (0) follow sine the comesponding 2.10 Condional Expectation and Condians!Vovionee 3 esl i¢ te forall (po jst the commie) events, Condition (c) follows PUI cowed event peween and +) = P{L eveot an itis eounted) 4+ P(2 ot sce event and exactly coun} ~ aol) 2.10 Conditional Expectation and Conditional Variance 1X and ¥ are joimly discrete random vasahes, we define E[X) ‘ontonal expestaton of X gives hal Y= y, 39 aul. In cher words the conditional expectation of X, given that Le £IX] asa weighed average ofall he posse vales of X, bo now wih the wot given ote value = biz equal he condiina probaly tht cals given that Toms. ‘Silay, fX and Ys joy conteuou with oi densi fanton fs), ‘ne defn the conional expectation of X, gen that Y=y, by Laftssbax TH Let EXIM dente hat foetion of he random varsbe ¥ whose value at Y= at 1s ELEY = yh ad ote ha F[XIM is el x eed varble. The folowing ropostio is gute we Proposition Sx = 6X1 en 1 ga ase vor vale, thn Equation 211) states at AIK] = Dey = yer =>) 242 ment af Prbiiy wenn contin wt sy gn (21) sates #UK)= f BURY = aod \Wesow ghe aoc te posedin ropaston wien Xa ¥ we crete Sauir Dates ro) = DaDron rar) aP( =) =X Mga a dense condo vrs of Xs th vale 1, os flows Vert) = 1G — EXD ‘That, Vax) sa faction of Y, whieh at ¥ = is equa the vice ‘EX given th P= y. By the sane reasolng chat yids the Meaty Var) LR] (ELXD? we have ha, Voscxt) = 604 21 CeDE ID? ‘Tking expectation of bth sides ofthe above equi gives Von} = ALELC ETE] | AEX ex ‘Aso, besa ELETAY] = BA we have tat Van ELXe) ELE] ~ EUR 1) ‘Upon sing Batons (2.12) ani (2.13) we obtain the flloing en, know she condnal vriance formula ‘The Conditional Vorionce Formula ‘Var = Elvan X10] +VarEEATYD eserciee 85 Exorcisos (@) Foray events A and B show tat AUB=AUAB Be ABUA'B (©) show tat PEALE) = A) +P) — KA) 2 Consider an expert that consis of st bres, numbered 1 through 6, ‘ining ace aad suppose at the sample space grea by al eden of (2,2,3.4,5.6)) Lat A denote the eveat dit he number 1 owe among the op thre fers Jet death event tat the mer 2 Bore come nso, snd let C dena the even tht the number 3 hore comes ia. (6) Describe the event AU. How many ontemes ae contin inthis (@) How many outcomes ar conmied inte event A? {@) How may outcomes ae connie inte event ABC? (G) How say oatcos are contsine i the event AUC? ‘3. A.couple has to children. What ie he probability tht both ar gic sven ia th elder engi? Assuie tat ll four possbilibes ae etl kl 44 The king comes rom fay of two cide, Whats te probabil a ‘he oter child is reer? 5. The and variable X takes one of he values 1,2,3,4 with robebiis Pure qaig 121234 some vale. Fiod P(2= X=: {6 The continoes cerdom vale X bas «probaly density foe: fon gee by Find PUX> 2) 7. UX and ¥ have joint probaly density fmetion specie ty fis Find PU <1), 20), Qe rew,027 n} whoa X iss geomet rndom variable With parameter p 23, ‘Two payer plays cern game unt one has Woa ttl of ve games. IF layer A wins each individual ge with prebbiy 0.6, whats he pata fhe wll wine mack? 24, Consider he lpexevometic wel of Secon 28, an suppose that the ‘wit bal ae ll uber. Foe Fees et 1 if white ba mambere is elected = Ta checvie ‘Argue sha X= 5h, ¥, ant shen ws this represenstion to exermine ‘ery that us cote wit the esl given a Section 24 25, ‘The bus will rive a atime this wifory dstuid between 8 and 830 at Ifwe rive a8 aa, whats he pobabiliy that we wl wa betwen Sand 15 mins? 26. Fors aonsal random viable wih puree do show that (9 sala 0) Vari Se 382 ements oF Probbiliy 27. Let X bes Lsomil random vrsble with parseters (1, p) Explain why when is ag. 28 IF Xis an ponent! random vane with parameter , show hat (9 Aaya 1, . (0) Vena) 1 20, Persons A,B, and C ae wating ot a ak having te ler when it opens in the mowning Besos A and H each goto a tlt snd C wats hoes Tr the time i es (0 serve a eustmer i an exponential rn varible With rarer A what is the probably that 4 the at oles te ak? [int [No computations ae neces] 30. Let X and Y be independent exponent random variables wit especie ‘tes and Ts mx (7) an exponential andoa varie? 31, Consider Piss procs in which events ofc at we 03 per out ‘Wie is be prckbiity that no event ect Between 10 A od 2 PAL? INQ) =) when 6 32, Fora Poisson process with rate A, find PM SB, Repeat Breese 32 fore> SM IP's game random varale with parameters (1A) find () Ax, 0) Very, 35, An um contains fur white sn six block al. A canom sample of ie ischosen. Lat dente te uber of whe balls in he spl, An ain tal is ow selected from he eaaling i ball thew el Y egal Li tis bal i wie and Of is blk Fad eo) etrix=2 (Vax =0. (@ vacr=n, 36, IF and Y ae independent an deniclly distributed exponen eden variables, show ca the eoadoal ibibo of X,givea tht FY = the uniform stbtion (0,4. Relevance =P References, les, Wa An Iimion te Prbiy Mary at Apc, Sle Wy, ‘ew Ya, 1. Io 8 Mer Fant Corse Prodan, he. Pets Wi, Ne Seay, 202. Is, 5. Ma burt roby Model, Wo. Adee Pra, Sw Yok, Random Numbers Introduction ‘The tilling block of » sulaion study Is he ality to genet exedom umber, er «rem number pesos the value of «random vanable {aifornly dette on (0,1). Lats chapter we explain ow such umber se computer genersted und alo Begin to osuata wes 3.1. Pseudorandom Number Generation ‘Wheres random numbers wer rg iter anally ar necharcally gen red, by ung ch teebnigoes se spinning whesls o dice rolling, oe eat Stuffing the modem appro & fo ate = compile to suceaiey geeeote ra numbere Those petorandom suns costa sequence ‘frais, which, although they are detersasséealy geared, ave a He ‘Sppesances of being inlepenent firms (0,1) ranean vanables ‘hae af the moet common aprotches 10 generating pseudorandom suber sare with an inal value %,elled he seed, and en fecusively computes Succes values 4, n= 1, by Beting yraiyy medal we en whee ad mare given positive inept, and whe the sbowe means that tan, divided by m and the rena is Taken ab the vale of 3. THOS, fh’ setter 0,1... mL and he quay 44/m—alled x pscudorandom ‘nonber—is ken we approximition to the va: fa wafers 1) dos ‘abe 428 Random Numbers ‘Tee pprach spcitiodby Equation (1). gneraterandom number ised ‘he esis congraeaal method. Sac sah of the number =, sneer ne ofthe vanes 0, Ie mt~ I, flows th afte sme ste ber ‘ost ) of generated wae vale mast repeat ise ad once ts happent "whofe seauence wll begin o repeat. Thar we watt choose the eons ‘and 90 tha for any ial tod ty the number of valley tht ean Be nscaadbefre dsrpeiton cece age. "goer to courant and x shoeld be hose to sti the citi: 1. Foc any inl sec se ceaulat soguence has he “appearance” of being & Sequence of independent nif () 1) random variable, 2. For any itl ste, the aunber of vzabse that ean be gsnertod before pation bepies large. 3. The als ean he computed eficienty ona ail compute ‘A guidalin ht appar tobe of help netting tho hove tne condita is that me shuld bo chosen to bes lrg pre ember tat ca be fed to he computer wos sz. For 8-94 word machine (her the it ite ga) ithas ben sbowa ute eboes of m=" 1 and 16,807 eu in deciable properties. Fo a 364i word mace te choices of = 231 thd a5" appen fo work well) ‘Aveier gener of prcudoraadom mune ues rocamione of ete sya (om1t6) modulo Such genres a called mixed congue! genres (they salve bt ‘m adv and + mulpcatve tem), When wing geecatoes of ts type, one ‘fen choses to equal the compute’ word Ig, since thie makos the Somputton of [215 +e) module mth i, the dition of ty BY imate ein. ‘soe stating pole in he compu simulation of sytem we spe tht vw can geet Sequece of pesuorandom tubers Wek cin bees a ppeoxinaton tothe yes ofe sequen of iskpeadentenifoem (0,1) endo Vinsbies. That st, we do not exper th intent thwestal questions, ih Involve mates outside the seope of thi ext lating tothe contusion of “od? pseudorevom mimber generates. Rater, we sume lt we have 2 "Black Boe” nat gives rand somber on requ, 3.2. Using Random Numbers ia Evoluote Iniegrals ‘One ofthe eras appeons of mado nambers wae in the computation of intepals Leto) be a ncn and soppse we wane fo compute # where a) de in 2.2 Using Rondom Numberstefvelustetntogiale 43 ‘To camps the vas of 0, noe tht if U is wifamly tated ovr (0,1), hon we am expess #85 = af4(0)) UU ate independent uniform (0,1) rao variables, hs lions ‘hat tbe random variables 4(0),....4(0,) ate independent and idenialy dstbuted random vasales buviag wean 8. Tefor, by he sueag hw of Jang aur, fllows dat, with probability 1, 0 koe EE 5 acy Hence we can agronnae 6 by searing lange munber of random manbers 1a taking a ou appreximation tbe average value of (4). This apoach tpproximatng ital ell the Monte Caro appoach TE we wanted to conpate =f sores ‘hoa, by making tho subritaon y= (2~a)/(0—a), dy —da/(b-0), we ee the [os —aine—oray =fiow wee) = (6—odlart[2~ a), Ths, we an approximate @ by continually voting andom nerbecr an on taking the average Value of kovluaed a ‘here radar nb. ‘Sin ve ware [0s Mod we cond apply the subtition y ‘hn the deny [wore tee 44a Radom Nemes ‘The wlity of wang rmdom numbers to apprexinat iatprals becomes more apparent inthe case of muliensina intra. Suppose tat gi Toncson ‘ih an mimensional argument and tht we se fgrested in comparing tof fio fics nundan dite "The lay wo the Monte Calo epprosch to catia os nthe ft hat @ cam be expec she felling expen: Om BlelC..-- 0 where Ui... a indepeneatoniform (0,1) random vaiebles. Hence, if ‘he gooee independent ets, cach sonstng of w independent unifeem (0,1) ‘vom wales Up UWE a) henna varie (UU), 8 el npn 1g encalyaatboed random vals with ena we ea extn 89 Bhan Ve Ter an epletton of the show, comider he folowing aperosch to ecg Example a The Estimation af = Sappse tht the random veto (2.1) aifonly disebue a the square often 4calered the origin ‘hati its eandom pot athe region sess in Figaro 3.1. Lat x con ow the pba ta his ender point i he sqere i contnes within the Js le of radia | (ee Figute3.2). Note tat snc (X ) normaly ‘iste inthe sate fellows hat P|, 2) isn te cite} Hence, if we gente a lage number of random poins inthe syne, the proprio of pins th Fall within te cite wil be approximately, Now 4 : 4 - 22 Using Rendom Nemberste Ercole Integrals 45 ny ap Jap =o) Figure 3:1. Sou. oun oo oe Figure 3.2. Cicewidi See 1X and wee independent and tah were eifomly distbued over ‘he joi dosiy would be He0= 1040) 458 Random Numbers Since deity funtion of (2 ¥) ie constant in the sgers, i ths lows (by defies) that (£,¥) i warmly stn inthe ure Now if i ‘form on ©, 1 hen 20s nierm on (0,2). and so 20~1 is uiform on ($1.1. Theefor, i we generate random names and Wet = 20— 1 and ¥=20,~ Is and dete Linares 0 otersise aUN= POC 4Y <1)= Hence we can estimate /4 by genemting a large numberof pits of can- go mugen ean estat bye facto of pal fr whch Qu, =17 + n= Tous, random number getters cun be used wo gore he vale of ws fom (0, 1) random varahes. Stating with se random saber we show Ia CChapers 4 and 5 how we cat gouerate the values of random variables fo svi disbutions. With this ality wo genre abi random variables te wil beable to simula probability systema we ml beable gene rae, sczrdig othe specified probably laws of te system, all be andomn ‘quauites of ths system ss evowes ovr tie Exercises 1. IhaynS end se Say mee 180 fod ye: 2 Wags and y= (Se.4 17) mod 200 find 150 1 Ruscte 5-9 nse smaton to approximate the following integra. Compare yt estimate withthe ear ara ge & fewtelar Kas a Pret de Gave Pherae Ke dyde Bee aude 1 ityex 0 fy og tet Otis fnetion ad se tis uneon to gu th inal ot ch xh ms go am Oe} (ii La 509 10, Use simulation approximate Cov(U,e") where U is uiforn an (Compa your apyeaxinatcn wi te exac eases 411, Let U be uniform on 0, 2). Use simulation o approximate he flowing (9) Cou, TDA ©) Cont T=, 12, Fern (Dao ses ete travian [v:Si>s) “That 8 aqua We mber of random nares tht rat be sme ceed (a) Esme EIM by even 100 vac of (6) Estate by penerang 100 ves of (6) Este Eby genet 10.000 vee of (@) We do yon the vale of ENP 12, Lat 12 be nom sn, Defle by veniam |ofivze] where 1, oe (@) Find EA by sitaon (©) Fd Fla =2), for = 0,1, 2,3,4.5.6, by simon SyS3e 45,2 modtlOo), 029 ‘we wilealltesouence«, =x,/100, 12 1th 2's adem nunber sequence Find i fit 14 va, References Kin Te rief Computer Programming Vol 2. ad. Sonam grits "Astin Wes. Reng 4A. 200, ‘bees Maram Near Sem” Came Ase Cogn Mah 3, ic Mang , Riadom Naber Fal ity ote Pass" roe Mat Aca St USA 61 2528 1502 Mrigin,G. The Sts of Lines Congr Seger" ia Apion of ‘ee Thro Mamencl At. SK Caen Acne Pes Leno, 17a, gp. 2-235, Navor'F Campo Stn Yanga. Wey, NewYork, 1966. Riley SechasteSmaatio, Wie. ew Yok 188. tn Neumae Vatue Foes Ula Cinco wih Rendon Digi, ‘Nee "Cale Mod" UE Natl Bureos of Stns Ayped Nashenater Seren No. 1,3 3 851 : Generating Discrete Random Variables 4.1. The Inverse Tronsfarm Method ‘Suppose we wart o gener the vlue of a sree random variable X having ably mas fncton Pix=x) yo P20 ED ‘To secomplsh tis, we georeate a andom numbe U—t is, uniformly tsmibated ever (1) ma set my Um fm cUenty x, WOES U< Pop, Sine, for 0-< 0-2 61, Plas 1 goto Step 3, STEPS: Pi... Py 6 the desired random permutation. For intance suppose = and the ial perlton i 1, 2,3, 4 Ihe fast ‘ale of f with ln eqrly ly wo be eter 12,3, 0 1 —3, hea te ‘lems prions 3 and # ae lttchanged and 20 ho no permutations 1, 1.4.3 the rex aoe of Fi 2, thn th lemoas in poston 2 abd 3a Intectanged and so te pew permutation i 1, 4,2, 3. I the final vals of Fs 12, then the final permutation is, 4,23, ad tis isthe value of te random. emit 2 (Ono voy innpostan property of the preceding slgoithm ie tht # car a> ‘be used w gonemin Fanon subit tay of sae yo! the tegen yom [Namely jst flow the alr ut the positon mr I,--- mri we filed. The elements in these positions const the random subset (in doing {as we can aay supose tat r= n/2; for tr > n/2 theo we cold choose 3 ‘ado subset of iz ar aod et the lerent ot nh be the ano ‘tie of ie ) Te should te noted dat the bt to gover rundom subst is pstiully ‘mporttin medical wal Forisanc, sopose haa modal conti plain toes anew drug ceslgnd a reac is users lod cbolerol eel. To tts ences, the medial cater hs ecrued 1000 volunteers be sees tbe test To take into account he poi eat te suet Wood cholesterol Tovele may be afeted by fon extra to he tet (auc es changing mestee ‘condo, it has toes decided to wl de voluneer int wo groups of ie 500—a raiment grop tt wil be given the diug ands conot tht wil be eax paseo, Hoth fe vmibers td th admits of te dg wil act be told ois in each group (such atest called double nd), 1 remains ‘crm which of te volutes sould be chusea to consite te weatmett (ep. Clery one mould wast the weet grup adhe contol sup be ‘ceil ax por nl expects withthe encepson tat ener ia ef {up ae fo recive te dug Wl those in he ete group receive apace, {ete twoud be possible concaett any eifeence in esponse beeen the groups indeed det the ug. Thee is genera agremest at he best, way 10 accomplish is to choose the 500 volunteer o be in he teat ‘qovp in completly random fashion That isthe choice shuld be made 59 {hat cab of the (a) subnets of 500 slactes is egy Lily conto the ot of volumes Remarks Another way © generate a random penaoiaion i 6 seam apdom numbers Uj...» Uy, afer them, nd tena the nds of he sec sive valuesas be andom peinuaton Fer stics, n= 4, an U, = 0.4 Uy 01,0, =08, 0,07, theo, because Uy =U, = Uy = Uy the sandom pons ‘in s 2, 1,3. The dificaly with this approach, bowevee, tat erring ‘he am rome ypically rege onthe order of nog() comparison. oo the averse Trensform Method SS Exomple de Coleueting Averages Supe we wat © ax. yal) where ni age ad th Values (= oP ‘Spb ant cosy cased One way fo seconpis ss te at isa eect uniform random Vrable over te gers... nthe te ‘adm variable o() fs mea sven by Hoon) Lacon =F 9? ene, f we generate lest form andor vatibls X= 1... —by fgeneatng random nami {ond sting X= nal) + (dhe each oF We ‘Prandom vacates a(X) wil ve mean 3 ao 40 by the suong la of ara ‘bers efllows at wen age (lagh nach selec han nthe average bfilese vale oad approximately eqaal& Meee, we can approximate 237 ng Amber random yale at can be gener witoot nein to sere fr the lean neva e whieh the random aunber fils isthe gromete xomplo 4d Recall that Xt sid to be «geometric random varie with paramae pP mths ae, (21, whee g=i-p {can be tought fo eprecenting te ine he Sst success wher independent ti ach of which im roses ith probably p re ported. Sie Songer Pues (Gt j—1 tls al flies} Le we can generate he value of X by geneaing 2 tandom number U and sting requ to he vibe for wie reg cueing jel cx envy or web fatuse 5k Generating bizerote Random Varicles “Tate, we can define X by X=Minlj:a! <1) Hence, sing the fet tat he ogi 2 monetone fancies nd so a <5 cuivaen to log(e) < Iog(), we obtain that X canbe expessol as X=Minlj:/ log) 1/2, becanse we watt simatancouly generate a many Bemoul 42 Generating Poisson Randam Variable 55 virile as pose, we should gest the tl numberof the fit fie ‘iter un tat othe Mt succes) "The peseding ides can also be applied when the X, ae independent but set Heually ste Benoa fandom versbles. or exch (= [ye-- sm Tet ube th leat Ukely of the wo porble valves of Xp That is. =I iF P(x 1) 21/2, aed 4,0 cherie. Als, et p, = FLX, =u) and le Ty We wll simulate te sequen of Beroals by fst genera he ee ot hese for f= Te lol f when Wal Js Ue fst ht esl in ually ve, wo X wl egal n-1 Hf none of the ils esi is uliely vai, To pera X, lt gq, 0 and ote tha Pre d=[ala tenth Thos Ps )mt—Tania tnt) ‘Consequently, we can simulate X by generating 4 anom namber, Vand then sting renin [iv 1th] Xen 4 be silted seen of Dems on va is Xo TotgteUecsnete df fof 2m sat Ky dag l= Dyce d= bak, {fj Len atta tb omaig Yes Ty,--K, ia Smif 4.2 Generating o Paissan Random Variable ‘ean aie Xs ison wih wen Ai parikaqectt “The ey towsingte vet tansforn method to genre sucka andom variable ish following deny (geovod in Section 2.8 of Chapt 2: a0 A 0 Pn aire 120 an “upon using she above rcuson o compute the Polson pecbsbilites ws ey Income ssded the ines transfor algorithm fr generating a Poisson randmn ‘able wih aan canbe expressed a allows (The quant éefes fo he ‘ue resonly onder comideraon, p= p 8 te prokobitythat X eqns 1, fad F= (i he probably hat I ss han oF equal.) 55 A oneratng Biserte Rondon Vari rsp {Generate a random mnber 1 SaP2 IsOpen rap, SPS: USF, set X=1 ind sop, mr nit sa i (inthe above it soald be noted hat when we wit, fr ens, f= +, ‘ve do no mean ht eel to 1+ 1b aber that the vale af shoul be Increased by 1) Tose tht te aboresigortm does indeed generate a Folsom random variable mid mean Ay aoe tt eft geass wand aunbet su thea checks whether ce not U 4 We ean detest sbigomal np) sandom vaebleby fr above method and seat fia fom to bia the ested generation Remarks 1. Another way of geeratng a baomi (2p) andom vaiable Xs by wilz- {ng ie nterretition a the nba fates inn idopendont Remo tis, when ac nl success wih probally p. Coneguraly, we ean sso smilie ¥ by genering the eaearas of hese Heroull Gl 584 Gameraing Deerte Random Vorieblee 2. Asin ho Poisson case, when the mesn np i lg i is boner 10 Sst ‘Seermine ifthe genrsied valve i les hap oreo 9 1 = Ix(np) & Wieder itis geaer than fn he format cese abe siould en stat he Search with Zhen 7~,..., and so oo; weeas inte later case One Should Sas scuching wid 41 and go upwar 5 44 The Accoptonce-Rejecton Technique Sipps we haves it meth he iin a ann vile ao prt a fecian f./0), We can we ra teins {eet reo hasan fncon (y=) 5 fi olin © ttm vere hig son (9 then exosing i mie ‘tie wit peta poporonl ply Specie rc conan sch ak ese meat smenan 0 «2 We now have the following wcbniqne, clled te wjction method or te sceptane-eection med, or stating 2 rand varmbleX having mes fet p= PU: Rejection Method ave | sme? se 3 Simulate te vale of ¥, having pcbuility mut fancton 4, Generate random number U. UU Peleg set X= Y and sop, Otherwise, re © Step I. "The rjestion method ie pstorly represented in Fg 4 "We now prove that he eeeson meted wos Theorem The scceptace-rejecion lgortim generie a dom variable Jeswch a Pex c ao ve Teun Figure 4.1. scomasce-rion | ' i a 4A The Acoptenceojecon Technique 5? Idi, th munber of iterctions ofthe gordi needed ta obtain X Usa eomeric random variable with mea Proof To begin, let ue determine the probity data saglsieraon proces he scspted value J is noe tat PLY jit accepted) ~ PLY = )PloseplY =) Summing over j yields the probability ata generated eum vatable is secre Plceted) = Fm As each iteration independendy results in am accepted value ith probity Ye, ese tht the nome of teats ead epee with a AD, P=) =D sexed on terion 9) =Et-vg -*, ° Remark The eader should aoe sat the way in which we accept he value Y'wvih probability y/eqy" i by gracing a random number U and tea scooping TEU = Pyleay Exomple 4F Suppose we waned simulate the value of ran variaie 2X tha thes one of tie valves 1.2... 10 wid especie probable 0.1, 0.12, 00, 098, 0.12, 110, 05, 605, 0.1, 0.10. Whereas ave possibility is to aye the vere tansorm algoritm, anther approach is 1 ate the re} ‘on masbod with bing the disero wif denutsy on 1. 10- Te 116, 10° or this choice of fg) we an choos & by axle % and s ie algo wold be as ows: ver: Generate anon aber Ua st ¥ —In( 1005) +1 ster2 Generate a svond random auber Us, Stee 3M Uy py/l2, ot XY and wo, Oboe rena to Se 624 oneratng Diserte Random Variables “Th constant 0.12 in tp 3 aise ine eg; =1.2/10—0.12, On average, this goth egies oly 12 erations to obtain the genemted vale of X- ‘Tae power ofthe rection method a verin of which was nly proposed by be famous mattis Jobs von Newnan, wil become even more really sppsreat wiea we cinder is analogue hea grecang continuous raom web 4.5. The Composition Approach Supe ht webadanofiet nha sale they of andor ale Saving ter of th wo protaiy mas ncsons (j= 0)o ("JO fn) te and eo vl f the aor vale X vii sh fiction mx. ef +a), 720 43) vie «<1. One my site hand vibe Xi pe hat iP%, ond ae anon aries ving perv mas ects (9) ad {iP thn te oa race Xd’ by s aff il ne ts mass fon nen by (43). om is lows dt cn {een the val of sch randoms vrei by ia generating mado umber ‘and thes generating a valve of, fU a it probity a wit probity 1— Example 4g Sopgose we watt prem the vale of ann vale Xeon that 005 for j= 1.23.45 rencnne [its Reicanea By acing tht pj =05 9-405 where to and pha fO fe i=t2345 we can accomplish this by fst generating a dom number Land then ga rateg fas the seas uafoum over T,.--y10 ff U< 05 and fom the 4 46 Generating Random Vecors 61 ince uniform ove 6 7,8, 9,10 tberwise, Tat follows: ‘ve on slate X at svar 1: Genera radon amber, fuP2: Gener a random uber Sur 3. IEC, ©0550 X=at(100,) +i, Oternise, seeXaIa(S) +6 8 WF, fmt... nae dseibatonfneion and, §= 1... ae pomnepative runes Sasuning oI, ben the ston fonction Fiven by Fee Dako is sald (0 be e mize, oF compusion, of the dsribtion fncions Fy 1 Iysn-am, Ono way to aul fom Fe Gest to slender vrsbe 1, og to with probably ay! 1... atd then fo single rom te dismbation Fy (Tati if he Slt ve af 18 1 then She Second ‘mulation is res.) This spproach to suing rn Fi oe refered to tile conpostion mathod. 4.6. Generoting Rondom Vectors ‘Aandom victor Xi... X, canbe salted by sequently generating the XY ‘hat fst peers then ener X fom ts contol sin gives the generated val of hen geerate omits condom disbuon given the generate vals of My sd hy noon. Tse lsrated ia Example ‘sich shows haw tsa random vectorbavngsmainomil cto, Example Gh Ciosdecnindopendnt sil cahof hichrsulsincosoftbe comes 1,2... With espe probable yar. reas. 1 4, denotes enue of as tha ret n oucome ten te ao vec Giyrr-2) said be a moon random vector Te Join pobality ‘es finan i given by ‘Ths best ay to sla sich a rand Yer depend en the relate ses of ‘rand n Ir is age elev 10 m0 tht many of the ontcomes 80 m0 oc on my ofthe ai, the ts probably best 0 simalte te reaor varabes by geoeraing the cutee ofthe m wi. Tha i, fit generis Independent ‘nom vrables Yu. Fy such Oa my, 62 & Cenerating Discrete Ronda Variables sd thn et Xpermamber of fe foe Less mi Tmt (Phas he goed vale oY opens the elf wil andi te Shar of il tt ret inane 1) Gotte ober tan. spe le 7h XX ca be mad fn mguence. Tin ft grr yen rn, ao Resse ech teres inept ets monte eth poy 7, ows ‘a fs om ted vrei aces (np), Tote, We se th bod of Section 43 gore, Suan i ered vale Syren ven tts of ihre oto flor aes ‘Fao chee nn til indbpendony aul coe’ wih probably >» Poon 1) = 2 ‘Torte cndienl lsibuton of, shen X, =, binomial wh patency) Tha wean egaiamckeusef Secon $3 pote the te of ft nected alae fy a hen ont nocd 6 pret the al of ononal onthe rea tty yy Howes, gen th aes iat eniih cna 1a i Ut eatin ano 2 ‘ch ofthe emaaing n= tal idepeodety noc 3 9h Drotbiity ot Coosghenty, be condos astinuten of Z, gh at 2%, x1 13, 8 binomial with parameters (4 5, ~ 5 >E=). We thea use iis cto gata and constant e a. ve teen ected 3 Exercises 1. White program to generate valves from the probaly mass fection Pah) 2. Wie computes progam Gat, when given 2 potty mass futon y= tys-- 8a paves stan ouput he Yale fs ram Vale ling ei es con. 3. Give an efcea algorithm t simula the vals of a random vaible bh dt Poe=1}=03, FUE }=02, Pe =3) 135, 4}=015 frente 4A Geok of 100 cards—umbered 1,2... 100i shi andthe ted ‘over ome card 2 tine, Say thar 2 "hi" eas whenever ens he th ea to be tuned ove, f= 1,..-, 100. Wei a snultion program esa the xpetatin snd vse ofthe ol numberof hi Run the ra ee ‘tie nsec ad compre tem with yor etnies. '5._Anater metho of aesrting «sand permstitic, diferent fom ts one [presented im Example 4h st mscesvely gemsrate» random penton of the elements 1.2... saring With =I thee = 2, a 0 on (OF coe, tie aalom pemitaion wien n= 1s 1) Once one his «random pertain ofthe fit n= elemenes—ealtP,---y Pye random pertain of te nneemtcts I... is obaine by puting ia the Raa posison to han the Danton Pi..." Py rand then intrchangiag the moet ie positon {osmely ») wh th eemeot in x rately chosen poston wich eeu Thely be eer positen 1, postion 2... or pasion (2) Wie an slgacidu that sccomplstes th sbve (0) Brove by mathematical induction om rt he gorithm wos, ina the permuusion aired seq Hel to Be ony of he! pert chet {6 Usinganefiient procedure, slong wih the tu'trandam member sea ‘nee a sequence of 25 independea! Bernull anda variables, keh eng rmexe p=. ow many rade aumbers were node? 7A ivf fir dice we tobe comin oe un al he posse utes 2,3..--y12 ba oesure seat ance. Develop sixulton study to eine the expeted sumer of ee rls tha are node. ‘8 Suppose tht each it om tof tens hs al tached it and let) denote te value utaced tthe them on the Hit. Suppo ha mi very rae, nd alo ht eac em may appear at mst diferent pes he Ts. phn bow zona gunbers can be used w este th sun of he valves fb ferent ins onthe Iist (where the value ofeach fein i to be counted ‘nce no ater ew many Sines the item appre ont is) 9. Consider then evens Ay... Ay where A, consists of the lowing m fucames A= {a,si2---" seg}. Suppose that for any ven oeome la) be pobetiliy aie exponent els in outeome as known. Explain fw aos can use the esl of serie 8 eximateP(U A) ie probaly tha east one ofthe ovens A, occurs Note ht th evs 2, ‘20 not asd fo be mutally close, 18 The acpaive binomial probitilty mass function with partsters (7,7), ‘whee rs poste integer ad O-< p< I is given 35 64 4 Cenorating DiserteRondom Vetibler (2) sete relationship berween negative binomial and geometric rn ‘ails ad the rel of Example 4 cbs an elgrmn for Smalaing from tis dstsbuoe () Vent he ation (6) Use tho relation in pa (8) to give second alg for geoering sagt binomial random varibles. (© Use the inwepaston of te nepaire binomial distibaon as the umber of tals 10 ams wal af sueceses wea each ‘al indopendeny resale na suozoss with probbuy pw obtain tl anotber approach for gnertng sch a andor vl MM, 16 Za sanded normal rand vib, how that a= (2) "~0re8 12, Give wo moods for genratng a randoon vibe X suc hat entye Tew 1K Let X be a binomial random vrs wih parameters and p Suppose {hit we want to generates rnd vainble Y woos pobaity mass mon is the same a the coodional mass funeon of X given that X =, fe some ssn Lt a= P(X 28) an sippose thatthe valve of bas been compe. ree (0) Give th invee tranaorm mod for generating Y. (©) Give «sooond method for generating Y. (6 For wbat values ofa, small or lage, would the algrin in (8) be ‘veto? 1A, Give « method for simaiting X, having the probability ase fncion PF = 5s one I here fo.11 wen js ota and 35) <3 0.09 when jie oven and 6 = j= 14 ‘Uso the tx random suber soqunce to genre. teri oS 1S. Sipposethet he random varisleX ca tke om ayo he vats 30 ‘wth espstve pobeblites 0.08, 006,005, 0.05, 0.05, 0.15, 0.13, 0. 01. (013. Use the composton approach to ive a alga hat gener the Velie Of X Use Oe text's andom auber sequence gear X. 16 Prost eto ee tea of, ee ana(1)\" 2" rraa=(B)" 02", ‘eth wats caf mbes egtceogatat 1. Wet X uve ms fnton p= PX Fy et (Stow that py = A, and Pee (AME D) AD ‘The quastes A, 1, ae called th disrte hazard rates, sine if we tisk of X fs he Mtne of some sem then 2, epost fe Probably tar an em tat hat reached the age wil ee dine ts tne period Te folowing appotch vo simulating dsc andor ‘ables, ale the pert hard ate rn, nes vce fads aus, stopping hss fhe mh random rome i xs hn 2h egos can bo ween ae follows seh: X= Stee 2¢ Generate a dom number sters: Uy su, wre x fiers: Goto Sep 2. (©) Show thatthe vahe of X when the above stops bas tho desod nase function, (© Sappese thar xis geometric random varie with paumeterp. Deter tne he valoes A= 1. Explaia what he above alc Is dolag in ths case end yi valid is leas, 18 Suppose ha Ay A fal n> 1, Consider be follwing algorithm to ‘eee a rans vanibi having sree hazard aes (2) srl; $=0, a(t fer 2: Generate U and et 65 4 Genorotng Discrete Random Versbler sues Sas47. freed: Genero d. sree S: IFW = Ay set aod op. Otherwise, go 102 () What isthe dssbuton of ¥ i Sep 27 (©) Expinin wt the ago diag (©) Argue thet X isa random variable wit discrete hard ates 2) 1. A random selzoon of a balls 0 be wade fom an um hal cocaine 2 halls, oF which have color type ym =, Dseas eficent prvedacs for salting %,-.-. Xp, waar X deter the number of witha Dells tht ave cle pe i | Generating Continuous Random Variables Introduction ach ofthe ehniqus for generating discrete randoms vrable bast analogue Jn he continous eae. Ta Soeons 5.1 and 5.2 we potent the iaveretaneorm, spproach and to rejecton approch for oneratng cntnaoys random vals [Section 53 we consider a posertalapproad or geserng nal anion ‘ibs, now asthe poar etd. Fal i Sesion Sa 5.5 we consider the problem of gezeratng Polson anénockomogeneas Poison proces, 5.1. The Inverse Transform Algorithm Consider a coatouous random variable avg distibation netin FA genera ‘betod fr geacang such arandom visble—clld tis invereaeonmaton ‘mets bed onthe flowing proposition Proposition Le: U bea uniform (0,1) random variable For any continuous Alertbtonfnton F te random arable K defined by xeP'Y) as dsribution P. [Pu defined to be hava of such a Fs) Proof Let Fy deoos the dissbutionfnsion of ¥ = F(U), Then Fx) = P(X 2) =r" ss) 6p 9 585 Generating Continuous Rondom Verables Now sioe Fs « dtbton tetion flows at Fe) 2 montone sarang Snes of und wo te egal “a <0” bequvact tote inequaiy “P() =F)” Hen, rom Egon (51), wes a FMR) =F) =RU SRO) since RENO) =" sie Vi wnierm(0,1) ‘The above proposion tus shows tat we cin eae a random varsle X ‘tom the coatinuousdsibatoefastion F by generating evapora suber sd thea sting X = F-'(0, Example Sa Suppote we wanted to gener a random vrsble X havieg ‘isrhtion fenton Ader, oer! welt r= PG), then = FG) =o equvalendy, = wi!" ‘The inverse wansorm method yess poner! apronc operating pO etinl edom vais ends fn the ne cna ‘Example Sb If X isan exponestial random vrse with rate I, then it «isrihton fenton ie given by A= welt x= PG), then we Ro)=inet taking Yogurt, 5.1 Thelnverse Transform Algorithm 7 ‘Hence we can generate an exponential wit parameter 1 by generating & adam. be U and en seg x “(Uy = log) ‘Asal savings ia tne can be btn by noting hat 1— Ue also afer on (0.1) and ths —Tog(1= 0) bas the sane distiuton log U. That ye ‘egal logartm of srandom namber is exponetllygintbted with te fh adon, note ttf i exponent! with meen | then, for any postive ‘consant,eisexponatl wi ean e Hence an exponential ao Yara {Yih ste A (aan 1/2) can bo generated by generaing 2 random munbet ‘nd seg og ° Remark ‘The cdot also provides us with another sgerthm fbr generating ‘Polson random vatbl. Te besa, eal that a Poison process wit ate Feals wen the nies betwesn saczssie events ae independest exponents ‘ith me A. (See Section 2.9 of Chapter 2) For such a proces, N(), te amber ferent by tim I e Pian datiboied with mean. wove, if we let Zyfm ly. donot the mecosive ieranival dee, tha the mh ove will, ‘tourette $5, Xyands0 the mmber of events by ne cat bo expesied as penta fesx. 0,a > 0, and K-= A/T). The prceng is the density fueton (fs penn random avole With pacumets and A and is Known to fave mesa e/) ‘Suppers we pin fo gente the preceding type random variable by dhe rejection mand base cn the axponetl dens with ate. Bera Kemet, x50 HE) REMI Korot em ve seta wien << 1 2) Mate) ts sboming ta the ejection tcgue with an exponeatil can not bs used ia this cs. A he gamma deny rows the expenetial when = I, ets ‘pps tet 2 = Now whan pe 10) FL) soso we anes tet tvs of ht eyes tan A. Wah ‘eh a value of ye mean somber of erations ofthese that Wi Bo seqaied is “To ots the vale of «at which the seceding acim oc, ede eatin nd se eg of obi Om (etry tana 75 Subsitting back yes tat conga) eo K (ant) rater Hae he, ae of ft ini (1) is hat valve tn mnsnizes Hots w Diiceaon ees aay! (a- Aaa 4 - quant ‘Seting te receding equal 00 yields bathe best val of sss pave “That i, the exponential hat minimizes the mean nome of iterations needed byte eeton method to generate 4 gum random varible wit parameters aed asthe am en the garam, ‘nr next expe shows bow the reson ecg can Be ase to generate orm rnder res Example 5f Generating « Normal Random Variable To zeus ‘ioe sndard nora undo arible 2 (se, as wits meen Oand vara 1), "ane Gt dat he csc val of 2 as probity dani fncicn Foe? gexce f= Fee” 0 6a) We sutby geseing om the preceding deayfncion by sing th eecsion mend with going he exponential Gey iain with ean dha « Oexew 75 § Generating Catinuows Random Verable Now ado the maximum vate of f(0/e(e) ooeurs a the value of tat make imies 1/2 Calculus shows Wa this occas Shen x1, apd s0 We aa ke $2) 0 ze 2a) 7 aa 7" Decssne aeof Sot in fallow that we con generate the absolute valu of standard norma indo ‘abl Ellon ster {2 Gauorts , an exponential andor vse with at 1 Ster2: Gueere a andor ember U: Stab 3: Us expl—(Y—1)/2}, set X= Y, Otani retu to Sep 1 ‘Once we have simulated a rand variable X baving density ftion a Ia FEquon(32)—and woh tanto viable Is dus dsubued ashe abla ‘edue of sanded onal ext ten oblea a sandad nom Z by leting ibe equally Ue tobe eter X or =. Ts Stp3, be vale isacepiediU (¥ = 1)/2, However, i Example b twas shown that Ing i ‘spooetil with rate 1 nd vo the above egulaleat the Foslowing Generate independent exponesas wit at 1,7; a EM > Diy2 sa X= 2, Ober, rer Sip Suppose now tt forogoiag rene in X, beingsccepted—and 0 ve know tbat 7 is hep thas (%;-1)/2. By how rec dos tht one exceod the the? "To ase ti call at Z fe enpeoeail wih ae 1, abso, gen Ga it execu soma vais the emount By wich Y, excads (Y,~ 19/2 ie, 1 “inal is" beyond the tie (= 19/2) 3 (By the meraniess propery) also expimentilly cietibated ih tte I, Tat when we accep a Step 2 ot only do we dala X (lie tole vabe of a standard normal) ba by mpting Ye—(~1)2/2 we ea alsa generate an exporeatal random Yale (Gedopendent of X) having ste see srs 2 . 5.2 TheRcjocion Mathod 77 ‘Hence, sum up, we have the flowing slot tat premtes an expo rectal with rte I and an inependee standard noraal random vabable. ss sr sats ‘Geer Yam exponential andor variable with ee 1 ‘Geoecae Yan exponential dor variable with ae 1 Y= (21) /2 > 0, set P= Ye~ (~1)/2 a go b Sep 4 Otbaewse, go 0 Step I rand: Gener random aumber U and st “The rn vrbes Z and genre by the fosgoing we adept with Zeng normal ith mean (a8 wince land Y Boing expooental wh ste 1. OF you wam te nora random variable wo have meen ye ad vaable @2, stake w-07.) 6 Remarks 1, Sine c= VIETH ~ 132, de forewing reyaies a goomeete dissbuted ‘umber of eratons of Sp 2 wih ean 1.32 2 I wo wast w goacras a seguroc of standard normal raadan vals, ‘we can use tho exponeatl sadam arab obtained a Step 3a the {nial exponusial needed in Sp I for to sex areal © be generated, ence, cn te avenge, we can simulate stadard nomel By generating 1.64(=2132~1) exposes and computing 132 squares. 5. The sguof tne santa woop canbe deter witout peering 8 new random auale (si Step 4). The Get pt faa caer tandem canbe used. Tht, an eter andr auto ry ry sud etd ooo Wid being wed domi ie ge 2 ‘Te rejedon methods prtcuarty useful when we nee smal erandon ‘able condos om i being in some region. Tai laa by our Ret cxanpls Example 59 Suppose we wnt generat panes (2,1 nom vrshe cuaioal on is value exceeding 5, Thais, we waat 10 generate a random ‘arable bavi dest Pusction wwe, Fira ae ‘whoo preceding integral wat vss by srng integration by pas. eine ‘gums 1) alam vrable has expt yale 2 we wil ws th ejection fae 78 5 Cenarating Camnvovs Randam Veriebles shod based onan expocunal with can 2 that i eonond to hes et 5. ‘Thats, we will use Now 10) ag m5 Becanie isa deretsing function of x when > 5, follows thatthe unter of eaions gested i he algorithm wil be geomet wi ean 2)-2 tye {£2 £8 55, Carola) ‘To generate en exposeval wit ate 12 thts conena w eck 5, we se the facta dh amount by wc encode Sis ly the ck of memory Prey tf expt rndom vcinbs) also exponen with rat 1/2. Therefor 1 {exponential ita re 1/2, i follows tat 5-1 Fas the same daubaon as ‘lose conditioned to exoeed 5, Therfore we have de fllewiag alg ‘mat ara vanbie X faving dens eon J sur I: Generate radar suber U, fiee2: Sa Y= 5-20) ftir Generals a random somber U. Srur 4: Iss Ye" yaee Xo ¥ aad op, therwse rt to step ® “ht oe simulate aril sadous vale in Expl SF by wing th ‘ejection mthed based on an exponetisl random variable, We cn ls fe "vel alte a noemal randoms vrais tat Is codeoed 0 He i SMe inzrval by ung the sjecton methed based on an exponeta rom Wish tis The dtl (cud the deternatoa of bet exponen moss) ae ‘Alsi ia Secon 88 5.3. The Polor Method for Generating Normel Rondom Veriobles, ‘Le Xan Y be independent standard nol random variables and et & and @ senate the ple cootdnstes ofthe vector (X, 1). Tha i (se igure 5.2). aay {53 he Peer Method for Generating Normal Random Varisbee 79 Figure $.2, Polar Conta. Since X and are intepeadent, ti ja ens is he pred of their nd ‘ia desis nai tbs given by 63) ‘To determine dso density of and ©—calit fd, )—we make Oe change cf vrales ‘Astbe Fcoban of his tesformstion—that ithe determinant of partial dive tives of d nd @ with respect o and y—is ea shown t eal 2 flows ‘ion Equation (53) tar he jit deasty foneson of Rand @is gives by aay sanalLen, vetemdebate Howes as iss equa he product ofan exponential dey hing mean 2 (eco, Le) he war easy 0 (0,20 fama, 2)" ws 2 and @ we independent being epoca wi nn 2 nd being wriformly dseioted over (0,2) oa) 825 Generating Caninvous Ronda Variables “We caa now generate a pir of independent standard numa acon vais ‘Xa Y by sing (54) to generate thr por coedats and teams ‘hc to estanglar corinat, Ths accomplished flows sree 1: Ganesto random mambers 0, sn U X= Roos = /“FiagT eos2ews) Y= Rsin = JDiegT,sinn0}) ‘The transformations given by Etions (5.5) re known athe Nox-Mler ‘emstonnatins ‘Unfarmatly, the use of the Box- Mller tansfoomaions (5.5) to penerte a pal of indepententtndard somal is capotatonlly ot very eens The ‘essa fortis she need 6 camputa the sin and coin genom ution, ‘Thee in, however, & way to ge tou this fe consuming. daly Dy an Inet computation of th sine a cosine of a andor ange (as opposed to ‘iret complttion which generates U and tea comput he sae and cosine of ev) To begin note tat U uniform on (01) tn 20 i waif on (0,2) fap 201 ulfora oo (=I, 1). Th i we poses radon ounbes snd U, aa 6 vem-1 Vn2t—1 ten (VY) is nifty dsb nde gue of tea seater at (0, D}— seo Figue 33, ‘Suppse now tht we cominually gears sch pairs (VY) anil we obtain oe tat is conned in oe ecle of radios L conte t (0, 0)—tat, ut (1, ¥) is soc tae VEE7E = 1 know fellows tht sacha par (V1) 38 ‘norm pati ho cil we lex Fand © denote the pla coors tf spi, the its tifa o vecy et and © oe adopeadeat, wih Ie sng nil dott cn (0, 1) (46 Exeese 21) and wit © bog briferniy ditrtuied over (0,29). Since @ is as w anon angle i lions {hat we can genre the sine an cosine of random angle © by gen=aning ‘dom plat (VV) the cea then seting 152. The Poor Method fr Genercting Herm Random Vorables 61 on tio L on Figure 5.3. (Vv) Unay Disioued inthe Square eno fllows foe the Bor Malo vanformaic (55) that we can gene {ndpendaat sandal nomals by gneatingaradan aoe U and sing 66) In fact, since AE = VE4V2 ie tel iformly debuted over (0, 1) and i ‘ndspendont ofthe rer angle ©, e can tse isthe rand uber ead in Equations (5.5) Therefor, leting $= A. we oii thst, ro camas ds =n( rae reng 2B ay, (88)" te independent andar normals when (VY) sw andor chosen point in the cle of a I contre the righ, aod $= Vf ‘Seuming ep, we thus ave the fllowing appre to geoscating © pu of ledependeat standard nora ster 1: Generate indom outbers, Uae SP2: SetYp=2U,~ 1, Va=2U—1, mek S21 mtume Sep 1 SreP#: Rema dhe independew tale normals nan ‘Te shove ie called the polar matt. Sine the penalty tse x andor, it inthe square wl fal itn te ce sequal 10 7/4 he are of the Sick divided by the are ofthe squire, follows tat, on average, de polar ‘method wil rege 4 r= 1273 teraons of Step |- Hence til on average, ‘ue 2546 mndom aubers 1 logit, Lac cove 1 dil, and 446 ‘nulipicadons to geuate to idependea wt normal 5.4. Generoting © Poisson Process ‘Suppose we wanted tp genere the His event dimes of @ Poison process Whip ate A. To do so We Wake we ofthe result har tbe dines tween sue- eile eveas for sucha process we indegeadet exponential anda rarables ‘och with ae A. Thus one way to gencrate ce posi it to generate these Intcarnival ue. So if we generate n andor number U, Uy, med st %X, = bg Uj then X, ean be regndod she tna between the (1) ad ie tp Gren of the Poon process. Siac heart time of he th even wi ful he sum of the Mist eteraival nes, ths lows cha the generated ‘eluce of the tn ove tmes ace 32%, ‘ Ife Wanted io geacte the ist Tims nls of te Poisson process, we can fellow the preeding prcodure of saccosivly goaering the near ‘Ses, stopping os det sum exonds 7. That, he allowing elgoitum can be sed to gent ll he event times oncing i (0, 7) of a Poem proces ving utente alga efor o time, Fis he numberof eves at uve ossued by time and Ss he most rea event ae Generating the Firt T Time Units af a Poisson Process ‘with Rate srr]: t20,7=0 StRP2° Generate aco nuber MEPS. Prt ogU. ITY > 7, sop sera: Tar4h, 30 ERS: Goto Sep ‘Tho faa wale of Fin he preceding algorithm wil epeset the aber of ‘vets eae hy tine Tyan the vats (0s. SU) wl Bethe eve times in inereing oder. “Atober way fo slat the StF dine uns of «Poison process with ae A surs by sinulaiag (7), theta} number ef eveas tat ceur by tine Beease 17) is Poisson with meen AT, tis is easly ncomplised by one of «bs approaches given in Chaper 4 If th malate vaio of (1) hea fandom pombe Uy... Uz ce generated sad (TUjy.+-yT0,) ate ken 36 ‘host of ever tits by time T ofthe Poison press. "ro very thatthe prceding method work, lt NC) equal the number of les inte 2 [TU ,--- TU) tha are less thn #. We most now ape ‘hat N().0-= f= 7. iss Poisson proses. To show Gut i has indepetdcat and Sstlooarylacremens Wt Jove be r djla Sine laterals ite itera (0:7) Say that tee Poisson cvcuisa type eve 7G les inthe of ese jin to interval, f= 1,-- =r a xy tie po 7+ doe nt Hein ty of tho rintevab-Becanc te U1 1-ae independent ais at ea ‘tie Poison sumbar of etets NT) is independetyclasid as being of one ff te types r+ 1, wth respecte prooables Py... Pye WOE Py Isthe len of te imerl J divide by T when 7, sop Sti: Gone rion sum 0 Stur5: IU EAA Se T= 141.510. SHEP6: Goto Sup 2 1b he shove ACO isthe nasi fanstion and Ais uch dat A() = A. The fina Value of 7 vepeseas the auaber of eveus tne 7, aod SCD.» SE) ae the ‘The, shove procedute, refered to a6 the thimng algorithm (besa i “thins the homogeneous oason pins), elery mort ifn inthe ene taving the fevest numberof jaca eveats tines wen A(?) nee A a+ ‘ute ier. Ths, at obvious improvement sw breakup te neva sto bineras aad thon we the procedne over ach suena. Tot i deer tine appropri Valse EO iy 2) <0, 2 th fen we cab ane ALA C/A a Be net ene i A "Wo ths have te folloming algorithm for generating the ft Tie wit of a nonhamngenenis Poison paces wit inion fencion 2(0) hen the teatins (3.7 ar said nthe alortm represents the resect tine, J the preset mienal (Len J =j when fj, St f)e/ We amber of evens 3 fr, tnd S(1,-+-» SU he ver tines. Generoting the First T Time Units of « Nonhomogeneous Poisson Process sme 1=0,J=1,1=0 fer 2:Geacateaandom oumbes U and et X= 30g Smarr X> ty go to Step & mr er Bmr6 US MO/Ay set rer: Goto Sep 2 SPR IJ =k op BERS: X= Oy DAs EPI Go Sep 3 Suppose sow tht ove soe sabimeval (4) we bave that A > 0, where Slain AGEs S4<4) 1a sch station we show not se the thinning lent recy bt rater ‘hold ft simvlate Peso pocae with ale overthsdeied ireland ‘hep simaine w nonbomogensoos Pesson process withthe itnsy funtion AG)=AG)—A, hen #€ ny 1). (The final exponential generate for the Poison process, whic caries oe heyond the dese boancary, need not Re ‘wasted bat canbe sulsbly wanformed so st beastie) The superposion| (Ge mewging) of te two poorsesyhs tbe dested process ove eines "The reason for dlog I is way i hat I saves he feed to gover wor ‘aod varubles for « Poisson ditibted ausbes, wih meat 4(¢ 4), ‘he event ine. For atampl,conir tho ease where Ants, eset 8% 5 Generating Cntinuos Rondom Variables ring th isang method with A~ 11 vonld gonente an experod numer of 1 eves, each of which woald requ a rndom puerto dterine whether oe sat it hou be accpied. On the her han, to geerate a Pine process ‘ith rate T0 and then rege it with a tentnasogenons Poison proce ih tate AG) =5,0-< 2 1 (genera by the honing alg with A= 1), would ‘iid an equal dsbuied maber of event tines but wih the expected number Teeding to be checked to deere acceptance beng equ to 'A second meod fr smalaing 3 poahomogeneos Psion proces ving ineasiyTanction N00, ito dell peaerate he sucesive ven ene So et §,Sy-++ dente to oacessve even timer of wet a proces. As tase random Vase sr ley dependent, we gonrte hem in sequence staring ‘with 5, snd dem og the generate Yale OFS to ger Sy, and 9 0, "To sa, ote hn if neve cosa at Sine tho independ of a bas cccuod pit i thease tie unt the next event has the aston sive by (2) = Plime fom sun net eve les han seven) Pioest event ie before xt sewet a) = Pleven beween sand s+-sovent at 2} Pleven beeen s and 54-2} by independent incements 1-0 events io (55-439) eo(-[“a0r8) x equvalendy, us) =H We can theefre gener the suceusve event mes Sys BY gearing radon noabers OU Exercises 1. Give ametiod for gecratng «random variable having density faction Je)=ele-), Osest 22 Give meth to generate a random variable having density fonction go ursrst FO" lem e3ers6 28 8 Generating Continuous Rondom Verabes 4. Use tte verse tmnsform method to generate rans variable beving ‘iibaon incon Pte A) 44. Giveamettod for generating endom Variable having stibuton function Fae Ieee), Dexeeo Armd sariale bavi such a distibutin ssid to be » Weibll random vse. Gives mitod for genrating a andom varble bing deny funtion f= le 6 Let X be an exponential andor variable with mien 1. Cibo an efficient ‘gor for simalsing random variable whose stbuton ito contol ‘Gatton of given tbat X-< DOS. That ys deny Fintan is eared Desew Gena 1000 such variables and use them to estimate of FL | X-< 0.05). Then ‘termine te exact veloe of £1X | X-< 005) 11 (The Composition Method) Suppose iti latvly easy to geet random ‘sabes fom any ofthe cstibetone Fé, How could we geveroe ‘random vane having the eibton fetes Fo)=Enn) whee (=... ae nonnegative mumbers whose sm 61? Using te result of Exercise 7 give algoitims or generng random var ‘Bes ws de following strbutns. © Aaa? Os53 Fem [etc a coe (RO=EeeOsssl, werea20, Ehael toes 9. vee mpi ue ig tn tan naga [Tver ses [int Tink Inte of te composition method of Exercise 7. In prix Tet denote the dstbuionfuneton of aad spose tht the condons Cision of given hat Y = yi pursxi¥ay=¥, Orsi) 10, casa insures company bas 1000 policyholder each of whos wl Tnpendetly eos lai ath ext reo with probabty 0S Assuming that the amouot of tho clans mae ae independeat exponential random vars ‘let wih san SDD, ese simon o estimate te proebily tat be a of {he cas excods $20.00. 11, Wee an algo that canbe we Wo peerte exponential endo Vari thie inst of 3. Compare the compattonal egeirmens of ia mathod with the oe presented ser Example Se which generates tne api {2 Soppowe ti xt to gece radon vari rom any ofthe dsiibution roof HOW ca We gees fom the fellowing dsabaions? pall RON) [iin If X.¢ 1,..-m, ae independent random vratles, wit X, svg ‘Sstbuton F, whi sandom vale as distribution funeog P?] 18 Using the rjton method and the els of Exercise 12, ave to other tnehods side rom the inverse fore metho, th can Be Used to genera ‘random vase faving sbi fncton Fala’, Discuss he efceny of the toe approaches wo peer fom MM, Let G be disbaton fncion wit density gan suppose, fr constnss (sb, we wa to generate a random vale fom he dsb Fitton Osxa1 Se) —aCa) *)= Ge =G@)" osreb (6) 16 X bas dstibation 6, then P is th condional dstibeon of X ‘oen what infermaton? 50 5 Generating Cominvous Random Variables (©) Stow tat the ceection mabod reduces in this case generating & Farndon vale X having distbuton G an then aceping iif ies eenece a and & 18, Give nwo mothods or generating arandom vail having dens funtion fajow", Osnee nd compare their efceay. 16 Suppose that we want to gece a random variable X whose density ‘oation sea heer 20 by wing he jection meshod wi an exponential dest bag ele A. Find ‘he vl ofA tht minimizes te expected nunber of irtion af tengo ed 0 generate 17%, Give an aortim ht geaerats a random vale having densty fa) =30(2 2062 osxsi lacus the efficiency of hit approach, 1, Give on efile method o genet a random variable X having density 1 ‘na 19, InExunpl St we smulted normal random vase by using tho jecton {estar with on exponelialdstiuton with re 1. Show tnt amoag all ‘xpovctial density fenton: g(x) = Ae-™ the numberof ierntions needed i ‘aiimized when A 20, Wie a program hat generates normal random vars by the mstod of Example 5 21, Let (X19 be ulfonnly dsbued in acs of radius 1, Show ta if Isthedsance from ti eter of th cl (X, 9 then aiforn.on (0 1)- 22. Write a program that genraes the fit tine units of «Reston press taving mle 2 Fo)= gpg) Bezel 2A. Tocomplte job worker sus go through stages in sequence. The ime ‘couplet age fs an exponen random Vrche With 6 Ay f= yok ower afer compleing sage {he worker wl ony go m the next ste with Referees 91 robsbiiy 2, =]. Tha after completing sae he worker will, lop working wit probability I~, I we eX denote the amount of tine hat, tie worker sped onthe fob, den % i called Covi undo vail, Waite fn algo for geneztag Soh x atom vara 24, Buses eve ata sporting event soaring t «Piso poces with ate 5 pec howe, Bach bei eal ly co contain either 20,21... 40 fans, with {he mbes ia the eiferent buses bing independent. Write ai algoiten (0 ‘Snatch aval of fnew he eve by tine = 1 25, (0) Wit a program tat uses the hinning algo t geoeme te ft 10 tine unis of © woninaogeeogs Poison pocets wih inten, function 4 noas+ ay (©) Give a way to improve upon te thinning slr for hs expe 2h Give an eficetsgoritm to gene he fst 10 tines wis of woabo Imogereons Poisson paces having intesity function 5 oeres Tps@-9, seret0 vo-[ References, apna Pincinof Rede Verite Generation, Cheon Pre Ox 1988 estoy Ly Hosa ond Vrte Conran Spgs Veg New Yt, 1986, oun LSPs of Diese Bon Slaton Wiley. New Ys, 198. aun, Tete Conger Peoroing O10, Samer rhs ‘hin Wes, Reig A, 200 Lam A bsand WB Rt Satin Modeling and Analy, Sl Mees Tow Ys, 197 Lavi? Wand G8, tet “Sion of Nesbacogencons Psu Poet Ting Nov es Log. Ono, 36, 408-413, 19. etapa O1 Graig ete Rncon Vrs va Ceapte" Comma. Ase Compe as 6 3138 96. org D1 Ty lon of Sbudaen, Cap an Hal, Londo, 13 ipty BD. “ompater Geerson of Rann Venables A Tut” as. Si, Si, 2-318 198 ii, ny Seat Simao. Wie, Mew Yo, 986 utes ¥ Smton ands Hore Cal tod Wily, New Yor 98 Shounen Ram Verte Gonenton Suey." 159 Mone Siaaion ont, ra Lp. 1-105 980 The Discrete Event Simulation Approach Introduction Simvlting« robaiste mode evolves generating the stchesc mechanisms ff the model sod thea cbrerng te orltant ow of ho model overtime ‘epedng the rezone fr the mlaton, thre wil be cen gusnites of neat tit we wil want to dtermine, However, beans hemo! selon ver tine ofae involves» complet Laie! structure ofits elements, tis ot ‘way appre how to Keep tic of hs evlution So ast determine tse fants of ineren. A gen Traneek, bull aroun te ide of “sorte ent” hasbeen developed help on fellow a model over tie so determing the relevant quate of fteret The eporeach to simulation bused oa is famewott i ofe refoed to ate dlsctete evant snultion approach. 6.1. Simulation via Discrete Events “The key eens nacre even simltion ae varies and evens To do the simulation sre contaud}y Keep ta of era arable. a general hee le dee type of vribes that a offen width tine varie ad the ‘ten sate vale Variables 1. Tine vibe» “This refers othe aout of (simaleed) tie hat hss elepsd 2 Coumer variables Those varies keep count of he nua of times thet eran events ve arcane by One ¢ 2, System ste (68) “Te dessrbes the "tat of the te" athe tie + vaable 8 2k 6 The Diet Event Simaion Appronch ‘Whenever an “oven occured valet ofthe above variable are changed, rupee, sad we colle at output, any rlevne dat of mere. oder 0 serine wea the next event wl cca, ver it” wih tthe eae funue event and when they ae hed 0 oocur, 5 mainaind. Wheneve: ove “occurs” we den reset ie tne and all state and counter vcabes and alles the relevant data Tats way we are able to “Tllew” the syseu I ‘rotor over tin. "As the preceing is only meant to give avy rough ica of he lemons of sree event snulaton its uefa look at some staple. Tn Secon 62 we Consider the smloton ofa single-server wang ine, o quateag systm. Ta ‘Sections 6. and 64 we consider mulple-serverquading ystems Th mode of Section 63 supposes thatthe serves are arg in srr fh, 40d ‘De ave of 64 that ey ae aranged Ina pr fasten. Ia Seeton 63 we ‘consider an inventory socing sale, 68a eaurance ak ode, ad in ‘olinachine spa poblr. In Seouon 68 we cosicers model Conering. Stock options Tall he quosing models, ne supose tat caromere ave accordance ‘wit * nonhomogeneous Poisson process witha bound tensity rintoe AG) F>0. i siaig tes models we wil make we of te following ‘ubroue wo peur the vl of mndom variable T, defined to el te Sime of he it aval fer time Let Abe aoc tha (0) © A fo all. Assuming cat AG, 0, and A re specie, te following erontine ences te val of 7, ‘A Subroutine for Generating T, ser: sur se 3 ser se mer 6.2. A Single Server Queueing Systom ‘Consider a nerve sation a which cuore ace in ecordance with» nob rmogeatous Poston pocess with nats fancion A() =O. Tere a single Server, apd upon unval customer lth ene serch seri eat thet moment rele ois te walng queue Ifthe server is sy When he sever ‘competes servings customer tien iti bezns serving the custoer at ad ‘een waiting the longest (he voreled ft cme ft served” pine) i thee ar any wating casters orf re are ao wing stones temas 62 ASingle Server Qveeing System 95 fre wil the sex castome’snival The amount of Hie i takes to service a ‘csomes i arindem variable Undepenont ofall ote service times a of tne anal proces), bving probabil disatuion G- Ln addon, ere isa fixe ine Tae whch 90 adconal eval te allowed wo ener te sysem, tough he server complees servicing al thse tal we already Ia de Syste tine 7. Suppose that ware intrested in simsating the above sytem w denise such ques a (the average tine wetmer spends inthe syn and () the verge tine pst tat the las castomes depart i, the average Ge sf when be sre ean go bore “Todo a simulition of he prosedingaysem wows the following varbles "Time Variable : Counter Variables Nc the number of aval by tine 1) ig toe nore fara byte 1) ‘he nmbet of commer fhe spe (aie 2) ‘System State Variable Sine the natn fo cage the ehove gaan is when there either an tuivl or departs we ake thee as tho “event.” Ta, ee ae 180 9S ff event val and deparres The eve Ist consis the tne ofthe Pet {cal end the tine ofthe deprere o he comer peesently n service. Tht ‘She oven Ut EL=tate ihre tthe time of he next ater) nd ithe service completion tine ofthe cusomer preserly beng served. If dere mo cosine preselly ‘eg served then fs et eal oc. “Tae opt vanes twill be alloc ar A(t acval ine of customer (5 DQ) de deparir tine of casera Ty the ne past Tht the last cestomerdepats “To ogin the simlstio, we ince the variables sed tho event tines as fallow Inititize saree, S088 =, (Gener Ty td 8 = Ty fp = ‘To upd the apstem, we eve slong the time axis uot we encom he ext event To se how dk aecoapshe, we st consider fret cass, 96 6 The Diet Event Simulation Approach depending on which member of the evest Kis smaller. Fa the flowing, ¥ refers to sevice tie rom arte Having stbaon G. time variable, Sem, EL: ase 1 fy Stonta ST Rese: =f (e move along ote 1) Reodt Ny 1, +1 (nce there ita ston val ot inet) Rest nal (caine there ino one more eater) (Generate and reset f=, (his the tie of the ext aia) n= gsarae Y apd ese fg =1-+Y (bscane the sjstem had Been empty ‘nd 5b we need vo generate he servic ine ofthe new castor) collect output dat A(N,) = (because ester aed Ge). ese 2 fy ha =O Calle he opr dat (Ny) = ase A: minty 19)> Fn =0 Calls upot da T, = max(?— 7,0). "The precoding ised in the Row digeam peesontdia Figure 6.1. Each ine ‘weave athe "stop boe we would bave coated th ats yh tal ember ‘of eival, which wil egal Nhe teal numberof departs. For eat eessBe weave AC) and B() the respective aval wd depurare nes of aoe and bos DG) —A(?) epesenathe smo oftiethateastonee spect nth sytem Finally, we wil ote 7 Be tine past 7 ahd the st cunee ‘pated achtie we cal these data we ny ht astnlaon rnb beeh, ‘completed. Afereach va ws ten eat nd generate acter run un tba te decid that ecugh daa bave ben cellctd (ie Chepter7 we consider the ‘gsstenof ben bende simafation )Theaverage fal valueso that have teen georated wil be our estimate of the mem ae ps Fd he a csr Sept; sii te averapeoal ie abuerved ales of D~A ce the average ‘ie, orerallcwmersobseredinallor simulation tba asualermer spends | i : 1 163. Aveveing System wth Two Seversin eres 97 Figure 6.1. Snug he Sigle Sere Que. inde systam) willbe caestimateo he average ine hat cuter sens inthe en Remark Ife waa 1 sive omput data ising he mums of customer in (he aya teach poi of me, all ato secessuy Isto outpu he ese ‘ice ine rable pir (3) Whsnovec en event cocrs. For ste he ‘aa, 4) a8 (0,6) ere outet thes, hn) being be aamer inthe yen a tine fw weal ow tha no nim, itAsr<6 a=0, iosred 63. A Queueing System with Two Serves in Series Conde twoserver system in which customers amve in actordarce with 2 nomogencous Piss process, a! suppowe tht cach aval must Hit be Served by sever lend upoa completion of service a! ie casomer goes ero ‘Server 2. Such a ystonn called fandom or eee queuing ye. Upon ‘vale customer ol either ener vrvice wid saver Tift ewe i ee, 98 6 TheDiserote vont Simulation Approseh co vo} Figure 6.2. 4 Tole Qua juin the queue of serve 1 teri. Smal, whoa the eusiomes complies ‘vice of acre thon sitar entrs serio wih sree 2 hat set ee, ‘role it jin is que. After being ferved at sree 2 the comer depart the aystin The sence tines st server # have dtbaion G,.(= 1,2. (See Figure 62) ‘Spee tat we re interested in wang simlatonw snd dhe stbulon of ‘os mnt of te tector pede both t server I and at server 2. To do wy we il ut the following vals. ‘hae Variable ¢ System Stat ($8) Variable (ij): there rem caromere atserer (iain both hae in queve ‘nd in service) and yw ere 2 Conntar Variables 1g the nmber of aval by Hn ¢ [Nycthe number of eparres by dane atpot Variables ‘ilo the aval ne of eastern 1 ‘Sia the anal ine of customer wa servee 2,2 1 ‘Dea: the deparare nme of eastemer ne > vent List ty here 6 hee ofthe next eva and he “ervce completion ime ofthe customer pesendy being served by server ici 1.2 I tee js 9 catorerprsenly with sree I, ea f= > 1.2. Te event it aways conto he tr able fy yf “To bepn the srulitin, we ilaize tho varihls end the event Ut as fellows 64 Aewevsing System wih Two Pera Saners 9 “To agate he syst, we move slong time ul we enecnte the next even “Wemus conicercifieent eases, cepenting on which member of he event Is ‘sss. Inthe flloiag, 7, fee to «random vaable ving seen 3. SS=(0m) ELA tatty inlet) ales outpt dats, case 2 crater ese: Rest myiy—hm =m tl m= 9) rtf cs oars, gonna Yad es Hing, gorse Y, and tet y+ Colles te expt eat 4,04) Case 3 0, gomsaieY and eet = 1+ % Collec th cpt data D(X) ‘Using the preceding updating sem join and clas the rleyant da fe wow an easy mute ost the 64. A Queueing Systom with Twas Parallel Servers Consider model in which customers aie a a sym having 120 serves, ‘Upon aval the stoner wil jon the queue i bah servers ave Day. eset tere with saror Is tot terveris ee or ener sevice wih server 2 otherwise Wien the caster completes service witha server (ao ttter which ox), ‘ta castor tea departs the sysom an te castors tht fa Bee i queue tte looget (te me any ctttomor in queue) eners serve. Tho vice Aeuitton at servers G, = 1,2. (See Figure 63.) 1006 The Dreret Evert Simulation Approach Figure 6.3, 4 Qome wi Two Peal Ses Suppose tht we want to simi the preseding model, keeping mack of te moun ie pet inthe syemby each ste, and tbe ibe of sis ‘formed by eth server, Beaute tere ave mule server it flows Ghat istomess wil ot necessarily par in the order in which ty rive lence, to now which snes departing the sstom ups «sevice compation we. ‘wll have to keep ec of whieh customers ae ia he eytem. Sots aber the castors athe ave, withthe Sat anal erg eastorer number Le few beiagnuiber 2, and toa, Because cusomers enter sevice in oer thee ama i follows that knowing whlch eustmess are being served and bow rary ae wating a qoeue eal sw iene wang users. Suppoce Ahr castomers (nd fre being served, where 0 ‘len wating in quo, Bosna all eroaars wih nimbers les han ) wold hh etre service before whereas no cusames ose mmr ishigher thn {could yet have completed serie (case 6 50 they would have a 1 ater sevice before iter ey A Foows haeustomes J= IFAM ‘re wating i quae “Yoav he system we wil se te following vaca: ‘Time Variable 1 Systm State Vaiale (88) (Palin) if tee ae catomers in the system, 6 wih serves and ‘gis’ with server 2. Not that $$ (0) when te system is expe, and $82 (1, 1.0) of (1,0, when te only castomes is sad he is being serve by server Lo serves 2 especie counter Varisles "i the nue fave by tie + Ce aumber of castomers served by J ‘output Variables "ln te aval Une of custome = Dn: the depute tine of eesomer n> 1 yen tft ‘whee fy ete te of he not arvana she service completion te ‘of te casmer presenly beng served by server t= 1,210 thexe is by ime ¢ no cunrmer preenly with seve i, hes we sat folcwing, the event it wl lays consi f the tree VED 1. ‘To begin the simulation, we az he variables and ever ist flows: Initialize GaGn0 ) Gente Ty 08 st 4 Ty fh 8s 8 “Toundse te system, we move along ne uni we encour the nex exe. Inthe felling ears, oferta anon varble having sion Gyiai2 case Resa ft Renet. My Na Genes, and reset ty = Ty llc the arp dt (N= M0) Genera Ty and ie f+, (doh (2.8) (GeacrateY, and est = 14%, BSS= (1.0.4) Reset = (2, Ny A. Genes Yat ee) 1%, Inet Reset 88 = (Lint Case 2 88 = (ni) amd 2: Let mine, i) and Reset $8 — (n= 1, 41,6) (Generate Yaad ese P+ Case 3: $8. (ri) and =f th <, "The uptings in Case 3 ae la a exerci we seal th sytem accoring te he prcsting, opring the slog tome predetermined tecamatin pit, be by ing the out varibles a8 ‘ell atthe final vas of the couingvabesC, aC, we obtin da the aia and departie mes f the ass sorte ae wl oe pombe of eves performed by ech ever, 6.5 An Inventory Model Considers shop that socks particular rpe of prodet that ale for «pice fr per unit stones demading this odo peat i ucordance Wath & Posen process it ae A, and he aroun dene by ech one nde variable having dseuon G. Ia re to meet demands te shopkeeper mst ‘Keep an aoust ofthe product oo han, and whenever the exad isveatoey becomes low, edna nite ae ondeed fou he dust, The opecpet besa socalled (5) oxdoring pole, aunely, whegover te on-hand vestry is less than s and there i no presently outtnding oréer, hen an amount ered to bring i upto S, whee = 8. Thats te preset laveatory level 1S and no onde is outstatng,then fx x he smut Ses cred Toe ost of odering y unis ofthe pada sa spect fntion ep) ed takes ‘Punisof tine vt te ode delivered, withthe payment being mae po Aelivey- nan, te shop pays an iaventry boding cos off per ut te. er uit time, Soppose free the whenever customer demands mor of he Product thn is reecly avalible eo the amount band is sold andthe retainer of the oie i at tthe hop Tetras ow we ease smaiion to exnae the shop's expected pai ‘upto some fixed ine T- To do, we sar by cefising the varies and eves ae allows ‘Time Variable? Syatem State Variable (1,3) ‘whee isthe anu of iavery on hand, sis the set on oder 66 Anlnswrance Rick Medal 102, Counter Variables he ul umount of ordering oss by # 4, he oa anoast of ven bldg 20 by & ithe total amount ef revnne eared by tne 1 ‘Even wilcontito ber acuscmer or acre avin, Theeve siete "orto rival nea he next eusomer ‘tie ine at WHE te adr ig ied wil be deivered. fess 00| ‘oustanding ode then we take the vale off tobe. ‘Tho updating is scoped by considering which of he even tines is sma. wear presently tine and we ve the wee of he peseting warble, ‘en we move along in tinea follows. case Yi 6 <% Rest: H =H $(y—‘)2h dace betwen dimes ¢ and we ier a halng cut of (51) Tor each af the = ua ia ives. Resse = (Geoesse Da random variable having dstiaton GD is be demand of he ise hat eved ute {et w=in(D, 2) be tb ameun’ of the order hat can be fled The iaventory after iling tis ree fsx. Reset Ha +6, —2e eset: =f Reset. C=C +009, Reset e=e ty Reset y= 0.4, = ‘By asing the precoding updating scodulit seas to write a sion program ‘oanly2e the model We coud ten run the simulion ul the fist event ccs ae some large pessigne tine T, and we could then use (R= C— 2/7 os fn estimate of te shop's everage pelt per wit de, Doing this for varying {alues of s nd § woul then enable ust deeomine god inventory ordering poli for he shop. 6.6 An Insuronce Risk Model Suppose thatthe frat poicholers ofa cast isuance company ge te claims according fo independent Pessonproeaee wit common te ‘td tateach cain oust ha dtchidon F. Suppo slo that sew customers 104 6 The Dace Even Simulation Approach sien ap soordng toa Poison proces with rte and that each exiting pol Sepbeler rule withthe compny for an expoentaly shied tne with ‘te aly, supp tha each polieyboldr pays the insurance firm at a aed ‘i ¢ pert i Starting with my cst imental > 0 Wa Interested in wine Sulton fo estate te pote tte i's expt, fealwayssonaepave a all ins up wo dine 7. ‘To stale the preceding, we define the vasiables nd evens as follows. “The Varlae¢ ‘Sretem State Variable (1), wher isthe numb of poi nd eth rms caren xp. ‘Events There ae thon types of evan: a now pliyhole, a Tost policy. ols and slim, The evoat lst cossist of single ele, equal othe tine which the next eve! ocr et ‘We elton te ee! cmt sly ofthe of te et eet bese east epieatilnn vir awe pened a Sexo 29. Spee ira) be sn sea une rca becne he ‘tn o pens eect vets i exc GOSa ct ct crows age 4 eh ea exon ‘sion ie wih ss 9a lara mtr wh st Sen oes wll a tm to plo, wi obey et pyle wt pace roti wh pty ‘Acclaim, with probability —"™+ — wh ba aR After detrmining wiea the next erent occur, We geucrt a andr number (o dette whch ofthe thes posites cand the event ané dea use ie Fefonaiin to desanin the new vale ofthe system sto vale the following, for given sate vable (2), wile an exponota rondo viable wih rate n-+nh, J wll be a Fandom vatable eq © 1 ‘with probably ri 2 with probably >, oF 3 with probably tec: ¥ wil Beano vireo having the cn isbuson F. Outpat Variable 1, whee pa ['s efi’ copie nonnegative tirought [0,4 = |0, sbeewise To sulin teste, we intl he variables as flows 105 Initialize se intize tien gore Xan inion teak “To upta he sysemn we move along to he next even Ast checking whether kos us past ine Update Step Case te i> T: ‘Se J=1 sad ond this un, case 2: p57: Raw ones 0) events Jetireatae ntl ezrin nt 3: Genaate F.CY> a se 10 a end ths ru: erie eet onan? Gescrate Xess y= ‘The update epi the contin repested wt ua i comple. 57 A Repair Problem A sysem ness working michines 10 be opeaion. To guard. gut ‘eco enon, loa ale se tp alate spars. Wiest {ache teas dw edly rela by spare ad sl scat ‘te rir iy wc cosas os ape paca win epi led Sukie! ove a Gis Ooc ed make fa ben e's sone {albhs av spre tbe ad whee th one ans (00 Figo 64), Al Imp ne oe Tepe random vase ving te conene dtten 108 6 the ieee Even Simon Appracch funeton G. Hac ame machine is put int we the amount of inet anctins bwfoce breaking down Isa random varbl, independent of the pst baving ‘lastbcon faction F “Thesysten is sud wo “cash” wea amschive fils and no spre ar avlable Asoumlg tat thereat inialy 2 fuetonl aachiaos of which mar po in se and sae ape as spare, ae ietarstod in simulating hs systom 0 8 ‘o apeoximae 7], where Tis he time at which tho sytem ers, ‘To sania te preceding we ule the flowing varibes ‘Time Variable ' System State Variable +: to numberof machines tht ae dowe at ie # Sine the sytem stat variable wil ctange ether when 2 working machine lweaks dove or when a epi i complet we Sy tha ax “eve” o=cus nbeaever either of thee ova. In ead Inow hen the ocx evet ll ‘seu, eee to kept ofthe tes at which he machines present inte ‘vil fl a de tine at which the maine preset teing epee (thee i {machine in epi) wil complet is repair. Becase we wil lays bed 0 ‘etm the snes of he tlre tvs, convene 10 store thes n ‘mes inn ordered Ts. Ths i convener ete ven i be ks Brew Listy £4545 whee... fe te times (nce) a which he machines preset in se ‘Wi ally ad is the dime at which the machine presen in repr will become Spertoal, er if ere tno machine presealy beng rep the f= 2, "To bop the sinalaon, we lias dese quanti 3 allows Figure 64, Repro 67 ARepairProblem 107 Generate i FOr hse values and et be the th sales one. Set Even BS fan nl J independent random varsbcs each baving distsba- ‘Upisting ofthe syem procands according to the following vo cases. +1 (becuse another machine hs failed) yes 1-scp tis nn ead collet the deta P= (loge, a6 ese are a0 1 T schines down, no spares a avalal), rr 1s getete a random vate X bevng dstabton F. This random ‘ible Wil repecsea the working is ofthe sare tht wl now be pat lito use Now fonder the wales ft... t-PX and Ie be de Hb smallest of these vaio, (1, re, poner x randora varable Ybaving ditbeson funtion G and fess = FY. (Tiss necessary becae i his case the machine tht ‘ss jst Fae he ony Tale machine and thas epi medial ‘begin on i 7 Wil be fs repair ie an so its reir wil be completed at ine r+) cave 2: 21, Reset r= Reet: p= rs O, gettie «random variable Y having dbo function Gand ‘epesating the epi tte ofthe machine ust entering servis and reset reer. irs, setP =e, ‘The shore rls for updating ae lasted in Figure 6. cn tine we sop (hich oscar wen ret 1) we sty th 9mm compled. The ou forth Tun I he value ofthe crash time 7. We hen ‘eli sn simula aother wun, In all, we 6 lf, runs With he Sccesive one variables beiag y=». Siooe ese kaon viables fre indepeoert aad each represets& crab dey tet average, Pe Ty ‘he esimat of Z[7], the mean ema tim. The queioa of deeaining when ‘o sp the simoliion-—at ia, dotemining de valve of kis considered in (Chapa 7, which pesos the methods used 1 waisticaly analyze the opt fiom stoaation ras 1086 The Dizzee Event Simulation Approach sro pee YC de wea (fl ance panel 2H eee] Figure 6.5, Siulting to Rest Mode 6.8. Exercising 0 Stock Option Lat S20 deaone te pice of specified oak ae end of ayn. A common soe if spore tat s, expt to bX J. 20 where Xs oo is a sequence of independent normal andom variables cach Seth mein andl vasa o* Thi md, wich sponse tat ach ye peetage increas in rice over the prevoos day has common dso, fated the loenorma random walk mecl Let a= y+ o"/2 Suppose now tat you own an option purchase cae ult of this sock aa fed peice K, called {be sring pricey at tbe ead of any of the net W days yon excise chs option when the ek’s pie is $ tea, Because you ony py the amu K, ‘3 wl eal hs gin of S~K (Since you could theoretically medi tr ‘mound aoc sl the stock athe pice). The expect gain in owning eosin (ohich ceatly wou ever te exercised ithe stocks pice des nt exons Ainge te paid of interes) depends cn de option exercising poy you ‘employ. Now, itean be shown Unt f= O then the optimal policy to writ ‘at! de lt pestle moment and then exercie the option if dhe price exo I sod ne ext otarvise. Since, f= Ky ie normal andor vale ‘th can Nj and varance Nom snot difoult we expsly compete te 68 tering Sloe Option 109 ret fom this policy. However, its nt atl easy 1 barca Ota fof even 2 near opimal,paiey whe a = 0, and for any reasocily god policy {tie oot pose to explicidy eval Be expected gain, We wil ow give pile tt ean ie employed when <0. This poy, altho ar fm eng a9 ‘otal ply, spent be reasonbly good lt calls for exercising the option ‘visa there are ays fo go wheseer, fo each = you tat acon lead {ora bigher exposed pay than Iting exact day po by and en eller ‘xarsing (the pice at tat pont greater tan K) cr ging Up on exe ‘eer. Let Py = Sy denote the price of the stock when the ane mays 0 50 Tore he opin expe. The obey we suggest ss flows ‘Policy are sem days too, thon exes the epson at his daw iF eed sna were) the standard norma dstibarion funeon and canbe acutely ‘resin by the Tolowing focal: Fors =O BOI ely tag? ayer? Per s<0,0) Ba} we eee Teaser ay = 04061836 4,=-0.1201696 a, =09372980 Let SP denote th price ofthe Mock when the opin f exer i xsd, ald kt SP be ifthe option is never eerie, To deine he ‘xpeted worth of the preceding poliey—that so determine ESP] — Kit nesetary torso © simalation, For piven parameters NK, Spit i 5) ‘noagh to silt the price of te stock on separate ays by penering X, 8 06 The rot vent Simulation Approach sormalsavow viable with wean and sundae deviation 0, and thn wing the relation Pars Pal ‘Thus, if Ps Be price wit m days w go and te poly does ot call for cvercsing the option a Gis tine, thew we would goterie X and derive th now pice Py and have the compar chock wt the policy ells for ‘sercsing atti pon. s, the for that simulation wo SP = Py. if 3, then we wool determine the pe atthe end ofthe west day, and 6 on. The averags valu, over large number of silane runs, of SP— & would ten ‘eo eime ofthe expeted vale of omning th option aon yu eng te preceding pole. 6.9 Vexifcotion ofthe Simulation Medel The ead prods of he diet ere approsch to simulation i compute program that one hopes is fie of eer. To vey thst dee ate indeed 20 bigs inte progam, ene shoul, of couse, us ll he “andr” reeigaes of deboasing compe programs. However thre sr seve tchaiqus Bat ‘se partevlay appeal in cobagging sisation mackl, sl we sow cscs tome of hem "AF sith all age programs one shold stem to debug in “mous” or subroutines. That 9 should atempt 1 beak Gown the program ito smal, tad manageable enites that ar geal winks and dea att Osbug hese ‘tits, For example a sation model he geacenon of rade variables ‘outinate one auch toda, nd thee module boul be chosked sopra. "The simulation shuld alieay be waton badly wih lang numberof inp varios Oftunties by chosing lable values ve can ede the scala ‘aoe wo ose thr can bo evs aalyclly oF tat bas eon previonsy xoenively sade, so ot compare our sina sults wit Koown answers. Tn he exng stage, he progam shouldbe waten o give ab ouput all the ‘dom quanties it geueaes. By suitably checsngsaple special cases, we ‘antes compa th isles ort wth the ans worked tb band For ‘tame, uppos we ce simulating theft Time ani of 4H server queueing Sytem. Afr isting te vales 78 (pent Rea stall pmber) an = 2, "tnpore the snmlaien program generate he folowing dab Comers 1 23 4S ‘snl ne 1s 36 39 $2 64 77 Serie tie: 34022 51 24 33° 62 feordsne 111 snd sappos ht the program gives a ouat tat he average ie pet in the sytem Bytes six cstomers is 312 weve, by going trough tbe calculations by band, we se du he fst, astomerSpet 34 te nts in the Stee te secend spent 22 (eal eee two server) be td aed tine 39, entered servi at tine 49 (wen he fist cose Ie, and sper 5.1 Sax ws ia sevise—dns, eastomer 3 peat ‘ime 6 isthe stem: customer 4 aived a ao 52, ened sorce a tine 58 (when suber 2 doprted), aud departed afr an ditoal time 24th, festomer 4 spent atime 3.0 Inthe stem: and so on. These calealaons ste prosered below: Ava dine: 1536 39 52 64 77 ‘Tim when sevice began: 15 36 49 58 82 100 Deputies 49°58 wo k2 M5 162 ‘Toe nso 3422 61 30 31 as Hence the op fo the average ime seat nthe sem by al ails up time 7 = soa ave boon 4422 461580451485 6 hur sowing tar toe isan enor ia tho computer program which gave the pa value 3.12 2 tse technique whon Searching for anos in the computer program is to ule trace, a tee, tbe sas vale, tho eveat Ustad the counter ‘eben ot aor each eat ccc. This lows one to Tallow the sma sytem over tine so a to detriae when ig me peor os Interiors ao apparent when following such «uae, ose should het ‘hock he cleclaem ean fo te output Yarbls) 16565, Exorcises 1, Wete program to generte he dese output forthe model of Section 6.2. ‘Use ito ostinate the average time thats cust sped in he sym an the sterage mont of ofrime pin bythe server nth ase wha she aval ress is a Pisson process wit ate 10, the service ime dey ale) =20e-® (0 x20 Rett 100 rus and hen 1000. 1126 There vent Simulation Approach 2 Suppose in de mods of Setion 6.2 that we alta vated obi infos tio abu te senate tine server would expenence in a day. Expl ‘ow ths could he aezompishe. ‘3. Suppose that fps ive ats sng server queeing sytem according 0 onbomogenanus Polson pccss, whose fa inl per Dnt, acess Sadly ut his [9 pr bow aftr 8 hous, and tn decreas stud wl Teh 4 pir bour ater ts adanal hous The rate thea repeats editly| this fshion—that i, ¢-+10) = AG). Suppose ta the service dstibuton ' exponeatal with re 25 per hour. Suppose also that whenaver the server ‘conples a sevice ad find 90 eb wang be esc teak fra tie tat ‘is ufo dstibuted on (6, 0.3), 8 upon retrain fon bis beak thee ae ti Jobs walog, then beset on another trek. Use simulation f etnate te expected srount of tne tt the erver iron bee int Bt 100 ours of pertion. Do 500 simaition rans. 44 Fillin he updating scheme fr Ces 3 ia the modelo Seaton 64 Conder single server queuing model in which customers sive ecard ing to-a noahomogsneous Poisson proces. Upon aving thy eis ei: Service ithe eve sie or ele ty Join he gueve. Suppose, however, da ‘ac cuter wil coy walt randoonstount of tine, having disuibaton FF a que tcf leaving the system, Let Q dete the svicedstibuton. ‘Dilin sabes and evens 80 abt analyze hs model, ad ve he updating rocedurs, Suppose we ae inecsted in eluting the average nutber of let ivtones iy tine. whee coer that depts before enwering service i ‘cnsdered leet. (6 Supposeia Exes sath sv procesis Polson proces withrae Ib de unfors distibution on (0,5 and is an exponent eam are with ‘4 Do $00 simula at etme the expected ner fla custome Tyme (0D. Asumethatcutomors ar seven ioe of ava. ‘7. Repeat Exorise 6, this te supposing tat each tie the sever completes ‘ srvite, the next cusiomer tobe served he one wo asthe est queue spare time. That i if Wo casomors se wating an ne would depart he ‘qos hls sevice hay us yet gu Dy Hand te ber ber servic: ad ft yet kegon by tise the he former woul ene svi if (jf ade te thew, De you ik is wl oceae oe decrece the average ater that apart before ede servce? In the moda of Sostion 6, suppose that Gi the exponential dsibton with rte and Gi exponential wth rte 3. Suppose th the aval ae cording wo « Poison process wih rate 6. Write a simulaton program © seer da corespondig wo the fist 1000 aval. Use en esinae (0) the average ime peti he sytem by thse cose frends 113 (2) he proportion of services pecformed by serve (@) Do e second simolaon ofthe frst 1000 eivals and we itv answer ‘anand. Compace your answers othe ones provnaly Shine, Suppose ia tho tvo-sorver paral model of Section 64 bt ach server has town gneve, and that wpon sel ceteris the shortest one. An ea Sinding hh queues atthe same siz (r finding both verers erp) oes 10 (@) Decrmine appropiate vrahes and evets to ealye this erode ard ie the upting procedure. ‘Ung the some dssbtons and parameters asin Execs 8, fad (0) she average dane spent in the sytem by the fs 100 custome (6) he proportion ofthe fst 100 services ecormed by server fore asning your program, do you expct your answer inp (h) snl) tobe lagr or shal than th comesponing aswers in Bees 8? 10, Suppose in Exercise 9 tat each rival it sent server 1 with rally prindopendent of any els. (6) Datenine sppropiate varices and eveats to analyze his model and sive the updating procedure (&) Using the paramers of Etecse 9, nd taking p ein your eae ofp) otha preem, staulue the tes west the quate ‘fine npr (0) of Eerie 9 Do you expect your ae be let ‘rsmale tan ht obtained in Exess 9? 1. Suppose htclans are nd oan instance company according a Poe ssn proces tb rate 10 pe dey. The amount of x claim is «random vale ‘ha has an exgoneael dscibution with mean $1000, The insure company secuives payee continously i mest constant ate of 11,000 pe dy. ‘Stating Wiha ial capital of $2500, ose simulation 0 estimate he peobe- ‘lly athe fire's capi is away posive Groogbou i fit 365 day, 12, Sippone in the mnvel of Section 6.6 thst, condom on the event hat the firm's apa pose nove lor eT, ear al inresied nth tune a ‘which becomes negtive andthe moun’ a he shortfall Hep bo we can ‘He th gen sito aethodoiogy To obi lavas cat 1 Fe the repair mode presented in Section 67: (4) Weitea corpate program for this model (@) Use your program to eimate te sean cat time in the case where andres Aa) =1 ean Gl) =I 116 ThoDiseote Event Slaton Appranch |Mk_ In he mol of Section 67, suppose that the reps acy consists of feovers, each of wom kee aandom enka of tn having ston Go fenvce fad machine, Draw a flow dgram foc bis sytem 1S._A system expericaces Socks tat cur in aoconlace ith «Poisson pce~ ‘tsbavigga rats of Ione Each shocks acatan amount of damage asecated ‘vith These damage ste sertned te independent rndom vie which ‘teak ndepensent ofthe times which the thks cco), ving the ero enity funtion fe)=x6 ‘Danases diigats in tine at on oxpeneial rato aut, ebook whos ial nage wl have emaning damage val -* a ine v after it oer. a ‘lio, te damage values are cami. Ths, for example, 7b tie hee Inve been total of two shcks, wich orgie ames 20d fad had iti, ates anda hea tert damage a toe i L,xe"™"Y. The system Tals wheat wil dame exceeds see Bxed constant C a0 (@) Soppose we are intrested in alsng a simulation study wo estate ‘he mei ine at which the system als. Deine the “evets™ and "Savabee of this model an dew «lew agra ining How te simulation ober, (0) Wee a progam tht woud genet krns. {e) Verify your progam by comparing output witha by-hand eae, (@) Wits @=05,C—5, sn 1000, nm your program and ae the cpt to estimate tbe expected tine ins he systems als 16. Messages are a consnunestion fact in ecodance wit Poison rocot hivng arte of hour The facility consists of tee chanel ad a ‘Sivag mesg wil ce gotoa fienchamel fany theme fcr se will, bolet fal chanoas re by. Tho amauatof eve at amine es upacunsl ‘taandom vale that depends on he weather ood tthe tne the esage slvr. Spniealls i the mestpesves when the weather it “god,” then 5 rceising tie saatdom varablehaving dsibuin ation Fajax, O on}Ja~Pl\Z|> where Z x8 sandal normal =11-91@) a ‘were & i the stad normal dsriaton fenton. For example, sine ‘2(i06) — 0595, Equation (13) sme tat the probabil thar de samplo Ines ds fra by mor than 196z/4/m ie spproxmatly 0.0, whereas the maker Che ey on et hs eb a 170.96) = 0.2808, ‘Te clly wit detyuslag he value of &/n as an indi of bow well he samp mean of dt Vals estates dhe population mena is tht he opalionverinceo eno sally nowa, Ths, We alo need vo eimai Since PHO] ts the sverige ofthe squire of the diference between a dam Yale and is (atom) meen, itnight em Upoa using X atthe estimate ofthe mean at mtr estimator of 0? would be 2. (%,—2)" me average ofthe squared ‘Extanes between the data values and the etinated mean, However, make the evtimatorusblasd (nd Yor fer tenia sens) we prefer divide ie sm of squares by mL rahe dam Definition The quanti S,defined by 2 Baltic! rele te sore vara. ‘eg he gh ientiy yaw on bose proof fe Ie aa exerci, we now chow tet he sample vance san Sabisee estima of Proposition As |= 1207 Statin Analyse of Sloed Data Proof Using te eat (14) ne ott = Das I=. sex] net) ane [x] na es) whee the ast equality follows sine the Xl ave te same deribton Recall ‘ng hat foray random variable ¥ Vas) = £1] ~ (E[Y) o,oqialenty, AP = van ey? ve ia EUG] = vec ate eae var) + (BCE See teaoason ‘Thus, from Equation (75), we obtain det ae (oes (40) Sar) mtv which proves the es, 8 We we th samy and we ow $= ote. ‘Suppose now the, af ia 2 simalation, we Bev the option of ccniaully seneaing aon ata values, If or objective i to ctmate he value of 82%; when sould we tp generating new data values? The answer os ‘question is Oat we sould fast ehoove an aecpable vale d forte standard Avision of oor esmator—fr ifs the snarl doviion ofthe cai 5, then we can for expt, bo 08% eertsn ht X will not dif fom @ by inowe tan 194, We shoud then conti to gonerte new data srl we Bave feet dath ves for which oar etinate ot fname, 5) tes than he aeeeae vale Since the sample stn evation Say ot et pricey good estima «(aor may te orl appro be a) what the sample ze smal, We dus secommend the following pocaie 10 otumise when wo op geneting new daa alas. le vaiance Sas our etter of te popalition variance a, he so-called sample standard deviation, a ot estintor i: | 1 / | | i | | | 1 | | | es 74 The Sample Maan and Sample Verionce 12 ‘A Method for Determining When to Stop Generating New Dota 1, Choos aseeptale value d forthe Standard deviation of the estimator, 2, Generate a ast 100 ata ales. 3. Continue fo gears ado! dats vals, stopping when you have gea- cated k value and S//k~ d, wie Slo co sample senda deviation aed on thoes aioe 4, The sia of is gven by T= DL Xk Exomple 7a Consider « service system in whi no pew susomers ce ‘lowed ter after 5 rat. Soppoe that 2c ay follow thes pechblity Taw and tht wo ae intersted sn esmang che expected time nt whi the st aster departs the som. Puthemore, sppore we wt (0 De a kat 93% erin hot nr eta answer Wl not cfr fom de ee va by mare Chan 3 seconds. "To saty the above rerereat itis acess that we continly generate kt vavos ing the Ee tic the Jat coor pars (coh me By {fing asain rs) vol we have generat a tot of vals, sere € ‘leet 109 and sch at 1.968) 13-—ehere Sis the sple sad ‘vision (measred in sesons) of tese data values. Our esate of te ‘cpt te at which the last caston=r depas wil be the average of k aa vals. 5 In err wo the shove technigus for detaining when to sep generating new vis, ould fe vase We had a math for recursively computing the euccesive sample means and sample variances, aber tentang 1 (econ pte from crac each dna ow dun vu is genet. We aw sow how fis ean be done Consider te nequene of dam ales Xy Nay ad lt not, nape he ame un an eagle rice of hf te ‘Stan eeowag eeanan sad be me to sss emp Cen cof te seman sige rice ‘wi Hye cc) 1227 Statist Analyse af Simulotd Date Ss, am Example 7b te fst sve ca vaoes ae X; Equations (76) and (79) ye st S404 De a= Fa( ‘The anys i comewhat modied when he da velba ce Bemouli 0, 1) sandom variables, sis the case when we ar estimating pba. That |S suppose we can peer adam vasa X, ech tht 1 with roby» [Oth probity I~ p td suppose we are intrested in estimating EX] =. Sine, i hit station VarGi) = 201~p) thee ud ne te spl visit Vat). ed i ‘eta gn vals ke tee stm af plo ex, trl estas of Var) is K,(0~YX,). Hence, inthis ase, weave she folowing method for dein wea tos. 1 Chea mente vale de sds sian of e inate 2 Sern oe 10d sae 5. Comino gnc eo vale, sopig when you te g- seve vas ae EK) AT = i 4 TReetone tpn ee see eda vs 7.2. Intrvl Einar ofa Population Mean 123 Example 7¢ Snppois in Example 7a, we were intrested in etimsting the obubliy tit tee wae stl x carpmer i these at 530. To do 0, 86 ould suet sccessve days et et sgn {tite ise euorer presenta 53008 dy "To aterise ‘We woud smut at lett 100 daye dl contin to simulate at the th dy, ee ibm ha [orp /A] dere py =X, i te popaton of ‘here & day i which hve ita customer preset st 5:30 ad where dis an ceptable vale for he sndard devia of the estinar py 5 7.2. Interval Estimates ofc Population Mean Soppose again that Xa. %y ame independent radon vals om sommon dsetuion bivlogieaa ad vatinceo.Atbogh the spe mean Keri an fective estinstr of 8, we do notreally expat tht ¥ wil in cqul to 9 bt rather that wil be “lg” Are eis omnes mee ‘able to be able to specify an interval Tor wich we have «cern degree of fidence tht ie iin, "To obtain such an itera we ad the (appocimste)disituion of the setter Xo dlemine thi, st eal fers Equations (71) and (72), dat a vat) ad ths from he cea li theorem, oo that forage (0.1) ster h(0,1) meant approsimatly dsuibued asa stenda! nal” In “ion, i we replace the sntwown sandra deviation & by ts esimaor 5, the sample standard devon, hen leans ease Ey resi kw fr Slusy’s there) tn te resulting quasity Is appeinatelyw seed focal Fat wen age VAG 0/5=NO.1) os, [Now foe ay 0,0 <1 Jt zy Be sc at Pza shoe 124. 7 Stincl Anal af Simulated Bate rte-a a>) Figure 7. Sani sored doy. here 2 isa stndurd moral vadom varie, (Fr szanle, ts = 1.96) It follows fem the symmety of te tundard sonnel dena fonction aout the tigi hat, th pola a which co ares nde he dest tight soil (0 Tay is sch that 02 Figure 7.1) ‘Therefore (se Figize 71) Pligg <2 was fined when in the shove fitaton the samples i ley random verale depending te data 127 Statincl Analy of Snot Dota Value peered. Ths, however, can be justified whon the sample is Is, ‘a so from the vewpoin of sbouletion We ean safely ignore is subset. ‘As mtd in the previo ston the saat are Berout rn Veblen eich et rmotiied ten Xie e ia if ‘with probability p [with prohaiey 1—p Since inthis case Var(X) can bo etinutedby ¥(1—), it oows tats eq loot tase fo Bgation (7.8) dat when i large 7.19) ox equivalent, oft sn( Hi Hf RDA ewe, if te obverved vale of Xs py we sty ds Ue “100(1—a) percent sonisoce irl estimate” ofp Patan Da PTE 7.3. The Bootstrapping Technique for Esimating Mecn Squore Erare Suppose now that %,-..,X, ar independant random variable having com ‘man estibatonfutccn’F aad sappse we am need in wn them 10 stn some paramesc @(F) ofthe istebaton Fr example, (F) could be (ain he pevous sens of this chap) te mean of Fa coud be ie saelian or te atace of Fo any ober parameter of F. Sigpose fuer ‘estimator of 6(F)—eall ft g(y,--.,X,)—bes ben poposed, aad in eet 78 TheBocttrappingTechiquefortstmatingMeanSqueretrers 1 to jadge is worth as an esimatcr of O(F) we ace ies in esimating its ‘meen syuae ere. That, we ae ineeted in estimating the valve of MSEC) = By llaXy---) 8] [where cur choice of notion MSE(F) suppresses te dependence on he esti tor gan where we have used the seisien Ec Inde hat the expecta tobe taken under te soumpon ta the adm vl al hae estbuson Now sets oh nlite or of aoe MSE nay Stjx—ntan O(F) = FLX] an g( Xen -yXy) = Xi otal at apart ow ican be estimated thei. We naw present 9 wef technique, now the neretap tectmige, er exiatng this ean sane ee. To tegn, note titi the dtbavionfanton were known thn we could tieoetialy compe He expeced square ofthe diference between 9 aad is smal, tat swe cou compute the mean square eae, Hower, fe We ‘hsv the valacs ofthe n dom pont, we have » prety good ier what Be ‘nding discnin os ike. Inded, spose hat he Cbserved aloes of be 1 We on nw estimate the wong eistion function # bythe sated empirical dsebuton faction F, where Fe). stimu of F(2), he probably tat datum value sles than o qual 1.5 Sst he propordon f the dat values thet ar eve tus or equal =. That snber of #2, ‘Alita of iking aout je iit dst ection fads ‘eral B wich weal ie watson any often aes ay sev {Uide vey weal die, ie ts shove tobe nae an Gia, wil egal te ake a va arotniliy opal ee ber of sch that soy ed by wea eile and sy ray ie Ry {et cdrn vale ta kes the vate Twi pcb} and? i rronbiy 1) TNO i “cn” a so be when age (den, es te of gs ners pis hat wid pbs 1, £2) eooeges Fa) {So or and ent eu, Known ase Ciel ee, sen ‘that this convergent will, with probability 1, be uniform in x), then 6(F,) will probly be ceo (F) arog tt On ane seem cron ineton of daubator—and NSEC) sl epee be eel EM Xd EI) In the above expression the, a to be rep as being independ ratom ‘cables ving eituton fonesion Fy Te qvanicy MEGA) felled the Iectrap appro te moan square eror MSECP) xe MSEC): 1287. Stata Analysis of Simoloted Data "To obtain «fel forthe effetvenss of the Sooitsp appoinsion Yo the mean square err let us case the ona eae ers ue is nt metry amsly, when estimating te mean of aszboton Oy the sample mean (s tk i ct ocean hs cape Because thee aleady i an efeatne Wy OF stating de mena sun err ZX —6)] = 0° mene, by using te (ksered vale of S/n) Example 7d _ suppose we a istered ineinating OF) ‘he sample mean X = 51 K/n. I the oberved ata ae, ‘he emplicel dstibuuiyF, puts weight I/n on each ofthe po (Goatining weighs I th ‘jae not ll dsc), Henee be mean of Fb O(F,) =F Shy, and thy the booap esimte of the mean sgore Tame GF] MSE(r &, [= x]. et se : Vat 00) = Bp 8,0") = EAA -FF] >] 73 ThetoottoppingtecmiquotortaimatingMean SquareErors 127 hich compares quite nicely wih $/n, th wal esate of the ney sq ‘rr. Indeed barman the observed val af $2) la n(x —3) fale the boots approtimation act iad a 1 te dts vale are X= hen the empire! disribaton funtion F pos weight 1/t on each of the pots x, Ht usally easy (0 compute the vate of €(F,) for example, ifthe rameter of meres (7) Was the verano ofthe dsuibton ten OF) = Vat (2) = So (5-—)' fa. To ‘dein the boca approximation to the mean sere err wo then hae compa MSE(F,) = Fy [G(X o---0¥,)~ME))] However, since the above expectation is oe competed under the assumption ‘hat XZ, independent random variables Astute secrsing 0 Fit Tolls tithe vector (X;,-.2,) egually ely ro tke on any of he Doss vales (84.48) (Pent ne Toes, dare oe mse =5--5 shee etch J, gos from Ito» and oth computation of MSE(R,) eis, in goer, sommng 9” femas—an impossibe task when w is ape ‘Heer af we know there isan efletive way to approximate he average of large aumer of es, eamel, ty using simulation, Ee, we cou ettate set of indepen random variables Xu, exch having dsibtion function and then sot Y= [e(Rh..-.) RP (Next, we generate a second set X},..., X2 and compute He [eh 8) 0a and soon, until me ave cole the vtables YY Y- Bees those te independent eandam varios bving moan MSEC?) fellows ta we a ‘wether erage So, Hr a a tna of MSEC). Remarks 1. Ics quite easy to gonsnte random varthle X having ditrbutin F, ‘Hesmoe such a ranaom vale shou be agpally Wkly 16 Be x, 5 jt generates random umber U and a4 X =p, where [= aad + {itr eay to chk tot ts wl sll work even when the 6 oe al asic.) 1307 Sotto Ancyss of Simulated Dota 2. The ave sinus allows ws to appacimate MSE(F), which i elt 1a aprocition to the desire MISE(P). As such, it ts beew reported "int rovthly 100 sinalton usa 5 choosing + = 100—is wally soficeat o ‘The following exp lloseates the us ofthe bossap in analyzing the cout of «queeingsmutaton, Example Ze Suppor in Example Ta tat we ae ined ia estinating Belongs average smoot of de a cstmer spends athe spe. That, Iehlag Wb the amount of ine the theming cstmer spends i te system, Fe ly ve ao intrested in “Toshow tht the shove limit dace indod exist (ote tthe rendom vale W, svete dependent nor deatellydsubated), lt N dence tbe mamber cofestomers hat arb on de and let DoW, Dye Wyss tt Wig and ia greed for i> 2, r= Wagycangn bot Miya 1 words, Dis he sum of te ties in the system ofall aia on day 1. We ca abe express 80s Dye Dytent Dy cates ers ‘wher the above folie bcs th ao jus the average time in the sytem fall cntomerseivng fo the fst m dj. Upon ving sumer and ‘nominator by mw obi (DypD,)/m Gibb Nm ow aca day fle the sme probability ln i follows that the random saris Dy, Date al aaspeadst and Wentally tuted, ab ae he Tandon vaiog Myo Mge Hence, bythe song Lao lage umber. 1 follows tha the average of he sm ofthe D, wl, With proba 1, converse 7.2. Theectropping Tachnguefortsimating Mean Squarsfrers 13 ' their common expectation, with a simlar sttameat being tu for the ‘Therefore, we soe tat #10) ae here BD is the expected mumber of exsiomer to aie ine dey, and ED) is the expected sum of hemes the castomers speed in be ya, "o estimate @ ve ca thos soln the syste ove dys, calecting on bo fa an the data 2D, whee isthe maber ef casters aivng on cy ¢ fl, be sum ote times ey spend in he system, (= yf, Becanse the quantity £{D} can thea be estate by a DibDatt ADs Sac snd EU by NbN = ¥ ‘a llows tat #= #{D]/ £10] can e estimated by D_Dybtd, eae whic, it stout be noted, jst the average time in he system of lavas ig tet & days, "Toestinae | (Zn2_0) aN we enploy te tottay appeench, SuREOE the observed wate of DM, 58 Gig Iyonnk That stpooe thatthe snlaion ested inn, avs 0 diy ¢speadag a trl time dio the sysien. Thos, tbe enpitza jit ‘dusibaton fection ofthe rmndom Yet D,N puts eqal Weight on tek pas donpin..ns That, ander he empirical Gstbatonfnstion we ave Estimate of Msi P,[D=4, "=n. Heres, Sas. 1327. Staitiat Analyse of simulotd Date an us, mr) Hence, nha) ELM wenen( ‘whose the above fs o be computed wader the assusion thatthe & pis of ‘and verlom Dj ® am ndepensenlydistibued acosng 0 Fe ‘Since a exact competetion of MSE(P,) woul gute comping te Sum ‘of tems, we now perfor + simulation expecnoal to approximate it We [steae ndependent prs of random vectors DE, fm yy, sanding tothe enpinen iter fincbon Fan then cote (S44) We then geet a secant sot DE. and compte the conesponding Ys. This nies unl we ave generated the r vases .. (whee r= 100 sald Sic), The avenge of ewer vabes, Fy Y/r i tea wed to esis USE(F), whieh is tse? our estinue of MSE, the mean squre or of out fstnnes ofthe average antount of tie «cusner apes inthe system. Remark TheRegenerative Approach Tisfreolaganelsisseced Shr each day icapensndy flowed be ae probatshtLla cvtn a0 ‘on, te au probably Taw deserbes tbe system aot ove days of ad Teng tater over eyes wove engl random. Fr example, conser 2 queeing gts in whic cesomes are fn aco Wid PUN BO- Gets, 200 suppose tha he fit eastomer aves a tie Ot updo Ge T represeat the ex! ath an eval ids he sytem emp, then We tat tbe tne fem Oto comstiues he fit cyte The second cyte would te th ne fee 7 unl the fst tine pet flor 7 at an arial ids the ‘yee emp, se 20 on easy To ae, in mcs rode hat the ve "ens fhe proces over each cee independent anette debe. ‘eee if we regia cyl a being 8h." hen lf he preceding anays ‘min valid For example eso of ie at cstoer pees ne Stems gen by 0= E{DY/EM, wee D isthe sum teins ine ysecn fallacies ina cjeleand Nis hema of such rival Iweow search ‘syle ouresimats of iso EDy/ i Me nso te mesngons omar freee 153 sf ts eum apron ying te oop seonch ato The tchngueofanlyzing a sso by snulating “yces" thas random Inervals da whieh the proses fellows the re palit li ele Uo remnertive sprcee Exercises 1, Foca set of mumbees 2.25, ove sgl ht Sow afg-mt whee F= Bian probabilistic proof of te rest of Execs 1, by feng X dente ‘avandon varible that i eal ly to take oo yf the ves. and then by apg the Senity Var) = EL} — CELA) ‘3. Wite «progr tha uss the carson given by Equations (7.5) and (7.7) ‘a calalae the sample mean ad sample vanance os dat st Come to gener sss normal random vrs uatl ou have ge ‘acd of them, where n= 100s seh hat St < 0.1, where $1 the sap Standard dian ofthe data vai, () How many oomals do you think will be oneat? (@) How many nomals dd you genre? (6) Whats the sample meus ofl the sorsais penete? (@) Whats he sample varance? (@) Comment on the ests of (6 and (8). Were they suprising? S. Repeat Breite 4 wit the ection that you sow conime generating ‘Brod onl un f= 001 6 Pai exp(") dx by geverating random munbors. Genet atFas, 100 values and! stop when the standard deviation of your eximmicr is less than 01 1%. ‘Toestinas LX, XX bave bee salsa wih he ellovng vas resin: 10, 11,105, 115,148, 13,6, 15, 10,115, 105, 1,8 16,5, Based ‘a the da, if ve wan the stardard dvition ofthe esimstor ef E[X] to Be Jes tba O.sously ow many adona simulation ros wil be ended? Frerciser 8 and 9 are concemed wit extinating 124 7 ‘Stoica Analyis of Simulated Bote {Tecan be shown th if we ad random numbers el ir sum exceads 1, thn he expected number ods gual oe That ten FIM (a) Une thi procetig to etme, sing 100 simulation uns (b) Eninste the varsmce ofthe etinstor in (@) and give a 95 percent ‘onfcene itera xiao 9. Consider a sequence of dom oumbers and et A denote the ist oe tha ists than he predeseer. Tt, inn: =U, (o) Argue tae P(t > n= 2.220 (6) Use the ideauty EUAA = 5°25 PM > n) to show tha BL] = (6) Use par () to estimate tatag 1000 sulin mas (G) Eniaae the vananse of the exinator in @) snd give « 95 pecent ‘onfdens interval ainse of « £Ue4> Ooh 10, Use he approach hati peste in Example 3 of Chapter 3 ots an letra of si Tess than 0. which e can ase wit 85 percent cones, conuins Hew many rs wee necessary? 11. Repeat Exercise 10 whoa we want the interval tobe ao grote than 0.0 TE, To-esnate 8, wo gnsrated 20 independent vals having mean 8 UC the cessive values cbuined were 102, 112, 131, 107, 4,98, 138, MS, 9,117 5, MM, 124, 122,136, tat, 9) 122,181,148 tow many oon random varbls do you hak we wil ave ro generate if ‘we want fo be 9 percent eran da ou fn estinate of @ is eet wo Wiha vost BA Let Kyo be adepondeat and eal dst random ea= thles ving wrown map. Foe gen coaans 8} Nov iis clear that evel [S| wil excod B and so te process wil be ecard out of con) even i ti sl woking propery is, eveo whe the is values ae being generate bya wandand bora bation. To mae Shee thi ths des ae oon ho feguety, ti radett choose aad 9 thes, when the, re indeed soming frm & standard normal station, BQ i lage. Sippoue ait as been decided ha, under these consis, ‘ale for #{N} of $0 Is socepabie. Suppose Frher that ts cled ts he ales = 0.9 nd B= 08 schieve 8 vale of EN] of ound 800. How ex bre eek his ln? ‘Onc way of reiyng the above Claim Is by simalition, Newey, we cin suet standard normals Xp #2 Lunt |S, exceeds O8 (where a= 09 ia {he deflang anton for STN, daoos ho aumbe f oral edd unt ‘his occurs ten for ovr fit simlsin ras, we hve bo ouput variable ‘We thn genre oer ris, an our estimate of SIN] 8 be average vale ‘he opt i tind ovr ars. ower le us suppose hut we want fo be 99 percent confident that oot ‘state of EIN, une lnenatl assumption, is aca 1 win 0.1 ‘Hence since 99 poco! of de tne a nomal rand vari ie win 22.58 Sundar deviations of is nen Ge qh = 2.58), it follows that he sume of ‘ote needed—eal nis euch Da He 01 vi ‘wie isthe simple stand devioon bused on he fst data vale. Now 1, wil agproximiely equal (8), he stand dovition of Nand e na 8.1 Tha Ure of AnitbteVaiablae 139 argo hat this ie approxinataly qual w ZN]. The argumeas mis a lows: ‘Since We ae assuming tha he proces remins in convo toagheat, rast of the ne the vale of te exponentially weighed moving avcage i wear the ‘ig Occasoualy,by chance, igi age and appre, abso value, At such tines {may go beyond B and e rub etds, or thre may bet suing of somal daa values Which, eee a shot tie, eliminated fac tht the moving average a ho large (iiss becouse te ld vals of 5a eotaually muiptied by 09 and so lose ther effec) Hone, if we know tht {Ge proces hes ot yet gone cur of etl by some fed tine k hea, nO tmoter wa he val off ie would soem that he val of 5 is eonnd te ‘igi. In er words, itivey appears dat the disbodon of newt he Inovigg average exceeds the contol limits is approximately memories thet 4s) approximately cxpencatal random vale, But fron expel ‘dom Vatale Y, VertY) = (E[7) Sine the standard devinton ide que {bot ofthe vance, hoe seemsintve tha, when in conta roost, ‘(N) P10 Heace fe ecginal tai that FLA] 00 is comet, the meee fof rns needed is sch hat i958 900 nw (58 800) -04.26 108 Je aditon, because each rn egies approximately 80 nora rand yar- shies (agaia assuming te clam is ughly comet), we se tattoo this Snilton would reqie apposinarly 800 «4.26 x 10341 x10" nonaal ‘anor vaables—e formidable ase = 8.1. The Use of Anithetic Variables ‘Suppose we ste interes in sing sbmuition exist = IX] and suppose weave generated X; andy, dentally dist random varies Baving rein @ Theo ve ($5) = men vay 2000-80 ‘Hence it would be advantageous (in the sense that the variance would be reduced) ‘ear deer ey REE Shieh ary Ee comer ori samc sna nal ox apes +a) y= HU Uy 14) 8 WorianceRedueton Toehnques where Uj Uy Ate dependent randoo: sames. Now if U i random Tuber th iy 1 ufemty dseatod on (,1)—then soe 1— 0. Hence fhe random aris x ste sme distbaion ts, In an, since 1—U is clay neatly onelted with, we mlaht hope that pm be negatively cored with ‘Eran indod thot rest can be proved in the spc cate where ie @ Inotose (ther inressing o dcrcesog) fein ofeach of ts coon, [his el follows from acre genera rll wich sams tat wo ineesing (Grdeccasug) fnetios of of independest random vaabes ate postvely ‘related: Bat els poseated inte Appa to his ptr] Hens. (his coy afer we bave genrtod Uy...» Uy 0 8 fo comput X, rater han iperaings wow independent et of m room numbers, we do bate by st thing the set TU. I~ Us to compute Jn adion, shoud be ted, tat we cbinin double bene manely, not only dos our eng eximetor fave sales vatince (et est waen is a wontons Faction) bat we ate ls ‘ved the tng of goneaing a mcond eof random suber, exemple 8b Simulating the Reliability Function Consdecasysien of ecomponent each of whieh i ober foncoaing of filled. Leting Wo Oy 1 Uy Ue) : 1 eomponet# weeks : JO oberwise wecalls= (6, the sate veto. Sopgso also thet tee ia nonecres- Ing fncon oe 2) suc it | [1 tthe sytem works under sate vero 5 Hood [t ee “Tne Fnction 6.) 8 aed he strc non ‘Some come site fnctios ae the flowing (9) The eres sacar: For the series svete g Por) Mg ‘Tae serie system works only ial its component feneton (@) The paral srurore: Fore parallel etre Heo) Mi, ‘ese hepa system works if east oe ofits components works 1.1 The Use ofA “I (9 Te kofn qotene The seus faneton Hoecage lt, ebaee ‘sealed fot sous neti. Since F repesents the number ‘of fonctonng compenets, a kof system Wks if flee af te components are ering ‘toad be sod dat sroe system ie an wen sysom, whowas «| pull sytem ina Loin sje, (@) The dpe prenie: A Rvecomponent system for which Hy 88) = Ma 8 0 in saido haven side star, Sch sys canbe epost shea izally by Pigue 8. The des of the ding stat he system faresions ifs sige an go, fom Tet orig, trough the sate. The signal ea io rough any pea one | pod that compet fis unetones. We Teves an etoreige forthe rade 1 vey the formula piven forte ‘edge sre fineton. 1a oppose now ht estes of he componente hen $f 41.0, are independent random variables such that oe PSN m1, =0) Fata La 10, “SJ=0b 5) "Tee fenton {pin zy) i ealad tho relat funen. 1 oes he ‘obabliy tte pa wl work when the composts are independent vith ompones fnctoing with probably p= Ln.» Reduction Tecknlques Ua) 8.1 TheUse of Antec Vernbles 145 PW n= P= CEB OA) at whee the fal coast flows bec all posible ndings of Uy tre equally ely. ene, P{W =n) = PU > n—1}— PEN we FIM Say ~* Ao, “Loa Lona hoon wmEglgew sto Var(v) =3e—2 0.7658 ee, ec be estimated by generating random numbers and stoping te st tine on exceeds ida predecessor "we employ ante vara then we coud also let minum =2,1-U,>1-U,..)=min(a:m2 2.0,

You might also like