Simu Unit 5

Download as pdf
Download as pdf
You are on page 1of 18
ONTT-5 Random Numbers The numbers gornraded. & process , whose. cntdeome 48 unipredichalbe, ah wthich. can eb spprkoly rebel vroduced ane called. random, numbers, Random. numbers aro. kere sngredient an the. strmuladion of almost all descrebe Sysbems, Compucen. dan shawe a subnovbine. 3 beck, or funchin. thal will oe vandom. number, @Properdies of vartem numbers: cng, Random numbers rave. duo smporbanl properties: BU ntforrathy : (we, they ane. equally on one a. Inde penderee.: Gt, the. eumren value of ran fom. vaniable Inas ro “Becca nari wills the, previews vadied), ch. random number & 98 ar sndeperderd che drason from lypdé ve qren by; S()= ft of x44 © otherwise. Lyexpecdation 4g, gre. by: a Ly variance. tg er. by M= fete [ef = £ spSome consequences of tho witformthy and. andepardence properties Ly the pal Co) de sande ‘ahr Py “equal, Length, a) ‘tonal NA “alone N28 be ul rime, wreck No. N hes tp be suffics ch shan Hp ci bathe. pablo a ay A a& value. ma, eulry. tnterval ey sndependend bh the previous valiex drawn, . A 2 ny a8 D in vtoneylsfrole se) ®. Differences bebweon fue ancl pseudo vavitlomn. numbers: =D Peeudo-vandorn a ext ti, of DI 48 an exthad rardornnels ee (po shed plnmon oi nko ooclabnely bes | onl ce tt nba pre ning code,, computer, mb at tas slo <3 ee 7 mM porerating ‘aaa. In Hus, 5 ence, of nub mt ts, s once of Pie be ‘npledoced. “ number canned be saeproduce, rp ta Ws, sequence of muntbers| +> Hhis, cequance ofnumbes 4B nepedded, will or will not gel cated, TL 42 deberamtelic WIL 49 non-deleoommetic, ®. Medhods of. generation, ef Random Numbers DD lnoad. Cogent Methods Cy , The Linean con; ential omethod, discos a Sequence salons, Wsxd, - bcbocon 240 sunt and to the { recursive. nelabioshio: (ax%+C) rod.on, 420452, 04. ay) X% 48 called the setd, 24% called. the consfau mubbtplien , c 48 the merement, and m 2g the modulus, et Thc "®, the - call ac con vit Cosel Tf #0 tt eg fore 48 called’ mived, igrvenal “GaseD! When e=0):the form 13 boon 28 the wulliplicadire carver oa rime of tev for 2c, and’y, dr offechs the shabedrea) fnelg he ye get peepee tid 43. Bxampleds Use. Phe Linear. cmpruertial mebhod, +o merabe. a Sequence. of random numbers with %=2%, att, 024%, and. mM=10D, ae sen ir aiden ely Here.) fhe values, genenccbed, wll all be bebseen oO and. 99 becauge of the value of the rods, Yhose random. arlegors Should, appear ty be wonaforry dredrtbubed. belween Lhe © 4552, Radom. numbers bebiwen Dard 4 con be generated. by Ry=%i/m 2 424,2,5 06 > the Sequance of Xy and éubsequend values 4 led, 28 follaoes S Frrmla. Yyy= (aXe) med mm Xo= 2 5 aa wshene 42 D1 /2s-+ Xa o(44 x2 +45) mod 400 S : #22 aa) a raed, 100 Ky ame J Xa 2 (44X24-42) mod 100 = 44 mod, 100 =¥F Ry = Ft 20,47 10D Xa (14%¢9-+443) mod 160-1252 rod 100252 Re 25% 20,52 aes v2 i Lae eis Wake Ficomplet: lel =45%46,80%, ona 251-41 = 20144483, 644 (a prime numbed), and cH0. these choices cadbtefy Lhe cmdifias that +nsunea period af Pom—te Further speci a speed. X,=193 145%, Calculate /Grenerade Aequomce, of TANdOW. yj) OAS, obubios.- Gaven, Ao45 »m=(234-4) C20 di Xp=193, 45%, ‘The fins# few numbers generaded art. ag fillovs: ¢ Xa =(F5)(193,45P) mod. (234-1) = 2,074,941,499 mal (931-1) Of) Xy= 20445944 493, B Ry = 2)0%4)944,799 = 0,966 a velit ait . On1-4 5499) Yo.= 45) (21044,9445499) ynod. (231-1) = 584,992,460. Roz BE = 0.2603 Xa, = G5) (859, 872)360) med, (231-4) = 1645, 535, 613 R= Xs - 0.4662. 221-1 Square Method: = Mid. Suan yuthed. 23 aleo used fo genorele pseudo veander numbers, Fr Hug we tallow Fillrargs sheps: -+ Selec! a seed number, (X% wille n digtde [a Rat bt Xn % 45 Hee amtbial random number, plole: ov 48 even. Sune X dp obbatn mumber(Y) with rnaditls. Ya Yar Yon = BX% eo Xyy™ PAA, zeros to the Left of Y Lo form Z munber wilh (on) digits Aika Dy = 00. OYANy 6 Yon Echelle it aly Riko. R= Zen /2) Faye aa “+ Zoupy BE Se: Calculate. Lhe f. om. Vil we equcie mebhad, ae eee ad ions wa (UsavP 3686400, 03696400, Shon Re = 6964, 6864, (6864)? 444114496, 44114496 , then Rea 1444 1444, (1144Yo4308%%6, 04308926, then Ry Fost, — (3087)%=9509569, 09529569, thon Ry 52.95, (8295)"= 28087025, 28037025, thon Re 43, @rests for Randowmness: eetty > Ontfornady tesdings oF dal mn ta Deer 7 Kobrnoperev-Smetrnoy_(K-S deals ramp Je “eo Cas, tn ‘thas teal companes the condinusus cdd, FOX), of the dunilovis helt “Hs dhe dearteal cdf, 6) 148 dhe Somnple of N observadtions, ile tom: R(=ex, OF NS1, ial Tf the sample fom the random-number generator 8 7 ResRayrcky, then Lhe onotrteal cdf, oe defined. bye Syld2 (number of Ra, Roy 0+ Ra hide ane Lea) /N.” As N becomes dager 6 (0 should, hecome a bebller ayprectinabin ho F(a), provided, hack “he a obhest8 95, Prue. +> D= mace | Fe) Sy (xD). When the got disdubucinn D 48 knoon, +4 24 tabulated ag a funclion of N ge Table. Chet ae Slept: Rank the daba fom swallest to arpest. Lol Ry denode the sth smalless observation »so thal han Re ee Sep2+ Compute, Dt= mar} 4/N-R3 ee Ny Sheps: Compute Damax ja*, x} Shept: Debermine the evrbteal value, De From Table, Sheps +1 the js. babiodte reader. Value De, ae heats shat Lik lied soer: fom a untforn drebarubien 14 qected, Sheps: 1g DL=Ne seonclude thal no Atfference hag behoeot He due dtslrabubin of $Ra Re r+ Ra? pres wttform. dredosbubion. Hence Lhe mull hypodhest a3, accephed, le: Suppose. that the five numbers 01440184, 0.14, 0.05, 0.5 were. generated, and a} 18 clesined, fo por anomaly the Kobrneporov-Sinarviov dead wth a devel of styntyicanwe of 0,05, aunt pled ‘ ‘ / ain abn BNE SY hick YL zallies gad ve I ee idle Ranking numbers fom swallesd ty t ve gel 6.05, 0,44, 0.44, 0815 0.9%, ji ‘the. cabeulabons can be. Laethabed, by ge. of tbh bebo: [Ri os T 0.16 [Ota] ona | oe 4/N O.% | O44 06.) 0.8 4.0 4N-Ry | 0.45 | 0.96 O46 ~ *| 0.04 R-Gayn] 0.05 — [004 | 091 }.04% a Now, | ok 0195 and . 0,06 values Gs) Da mx f ing hid on aide 0.05 = Max f0.1550:26, 0,16, 6.02% 0 0193 6 vefed = 026 Daman {Rr —(4-tYIng FMMAX F085; 0.04 0,21 0438 * % so = O2L bs De mar {or ar} amas 70.96,0.21% = 0.26. ye — MeO The crtbreal value of 9, chdamed. foo fable. fo =0.05 and GS) NB 46 0.566, ey re he on % teas Pra the tabulated Nat, B-565 , the. Jnypabhests had: the oltedstbubten of the generale numbers ao dhe untform. anes 4 viol, rected, 2) Chi Spuare Tes): a a The chi-square. des) uses the sample sdadh Lh vig Wek (0)-8,)° ae = 1G : the dpc Lhe, ath dss, § 48 a wunnber mm the 9 ) and. $he muinthen, Yor the Unter dishubuion Fy ie expeded a sales he 2E)= N/m. for tal paced chasges whore Ae sera oe tal at lo ra Srey the ci-spume dell eee et a tfelon, Use the chi-.sou, with 9, he dala, shoo. bb Sern dediial ee Oho O84 0.83 O96 “Oey OMS" 0.99.- 078% On2 0.06 0,28 ishow, O; te 0:90 OF 6,89 080 gas OF O54 O45 DAB 0,26 O25 O49 -- O42 O14 0.93 0.99 054 0.5¢ 0.94 09% 0.89 0.6% 0.67 — 6.92 0-49 Ong O01 O54 0.24 0.98 0.87 O40 0:56 0.56 092 05 0.81 O50 0.40 Ob. 0.44 081 0.44 0,05 93 O66 028 O94. 0.64 0,49 0.12 0.94 052 0.45 oes 40 0469 0.96 0,49 0.60 094 OF4 O93 O34 OF 0.42 OS O58 6,19 0.44 O48 0.2 099 O48 O59 048 O45 043 O49 0.99 O6F OF4 o.02 0,05 O42 0,43 0,49 005 0.69. oF soubor Sable for cht quane, shadtcdicg 48; Oy er Chas trdowal (2) | & | O-§) -ayo-ays rae 3 40 = 4 Ou Dy 3 40 -2 4. 0.4 3 ao 4.0 Oo lo loon A z a sl a Po 5 42 10 = ; [| Ber eee ae ¥ 40 40 de ro 00 ¢ 3 vs 40. ay 46 [rote] Q 40 40 o o 0.0 Ge ad 10 a L Ot i> 40 N=100 2:(01-8/E 34 = ak ao 2 34 ° ~ $00 Ry Hee value af Xs 84, L Piggy 168 Hence He dale, guere ane wif debra, PrTdepondond Teshiyg: Pap - esd courts the number of di fe Had pean pre rl cane dice ke lah d py Seolel nll $1 ote, wees ght oy 4445355, 1,4,09, 0,4,9,453.55) 2, 4,944.6, 3,3, 9,65 B 54,8, 23 ,4)9,45476,34, L3- ‘hore ane 4 threes 80 ouy b gaps car occur. the first 4 of tonal 9, secovd, oer of length +, thivel ae of devigth mm, ( Zoo and “so Exanple:posed. on ihe fegeg with wld gap occ y analyze he 140 digi belno 4> es a. Higy ane trdepondent, Use. o620,05, 45 4)3,54,4,2)8) 230, % 9) 1) 3,5,2)4,9,4)1,6,3,3,956, 3,4)8)2,3,1)° 954,46 8,453,3,8,9,5,5,7,3,9,5,9 BS) 3,2s2)3;4)4,4,6,3,6,3)5,3,9,555,5 50,4 4 24) 0, 5 1518 50)4,63,0, 4,4, 0)3,3,10)3,5, #,9,5, 4,6, 63,8,8,8,9,2)9,4,3 a 4. 505235954 12, 03,653, ree tubronvop, 0 of i ee) eel 1s 43 He numb, ‘dala values yalnug Yoo vung at ae 5 the MeN Ao = 409 * off MUM er3, Ss ASSotk wth ' ‘ aa fala: OF He. vorroux digths De O. Noo, gaure We oe firsh finding for 2220, 50, look at clata. and ve find nd def + witl root POW a8 1)2,3,0+ (eek Wp noe afer. 47 dtl), Sry Balt Dyk | \/ berglh of rap lia came % | 4¥%9,3,0,2,01,6 x 4 | 2,4) 6,10, 6,45,9,40 3 2 | 1,6,42,99,0,38, 84 8 3B | 40,4, 0, 2)3,8,5,5,2,4,4, 44,09, | 4# 44,5)4 4 44,4,5,0, 2)18,42,3, 2350 10 5 40,26, 0,5) 242 12) 0j0)12)2)49,2 | 43 6 B59) 24 9,14 0, 22 ie FZ | 49) 26,10,1)16, 622 & 8 [49,,4,3, 8,24 16,0) 054 34 3 [55,484 11140144, 014,218,459 14 ine Pegueneg is given 2 7 of legdh gap ma phe ra! Foy gemewal O85 oa 2, ands a0 J BS Himes, S01 frequeny of jnlew 0-3 43 6.5m thes, 2a Damax. [Pes - SG) 10 vod: rec: of ih “beak fhe hypothe ob opendence ov the hages of ‘the caleubabiorr for deoh 28 shown am Slee dable 1 fA he Tack ve. mt en [Gar Requayey tua) Frequonsy SC) Requony FC) Dz|Rex)-569) | eo-3 =| 35 0.35 035 0.3439 0.0064 4-4 20. 0:22 O.S# 0.5695. 6.0005 gu | Ont ond OHH 0.0224- [ss | 0.09 0.83 0.844% [0.0153 16a | 5 O05 0.88, 0.8784 0.0016 20-24 6 0,06 0.94 0.9202. 0,019 24-041 3 0.03 OOF 0.949% 0,0223 23-31 0 } 0.9% DGS % 0.0043 — S285 | © ° 0194 0.9775 [0.0035 26-39 | 2 0102, 0,99 0.9852 |o.0045 [40-43 | 0 ° 0.99 0.9908 010003 \aa-49 [ 0.04 4.00 0.9936 0.0064. | The cattreal value of > 48 gtven by Deos= 136 [eps pene Lm = 00824 eg has than Doon, 0 Pabe = sa tt 8 obebicbical esd Lhal pons whether a yandom. number generator BZ) pro on Ph vandom number. + a sequence. The fest ‘for on correlation 43 concerned with the ‘alopendlence behosen numbers 24 seuene, ‘the vanlables snvelved. en’ this ead anot ath bebocen tre number belng Lested, ca. ri wie oe nual, from whide we toe. N-st4 4a the ‘umber of ae mums pererabed Moab 48 the lawess sfrlegen such tha F-(Mit)mZ=N, ae athe judocorelatin behoean RQ, Reem Ravan, + 9 Re (don 8 Comp : : M Sm = Fad 4 Risen Rested] = 0.95 Novo the desl shodishes 8, 7 : Sinn a Jrsm44 Aft. computing Z, accept the thesis af mdepenclence. Ba eae OS te dal of Si inte Excournyles OAS, 0.46, 0182, 0,65, 0.04, 0146, 0.%, 6,92, 4,98,,0.48, 0,23, 0,56,0,44, 0.05, 0.81, 0.38, 0,89, 0.34, 0,45, 0,43, 0.99045, 0,67, 0,2%,0,2,0,14, 0.64, 6:5, 0-43, 0.15, 0.00, 51495086, 0,94, 0,4, O44, OAL 0108, 096,042, 0,16, 0.235 0. #4, 0.08, 0.69, 0,46, 0,390.18, 0.21, 0.98, Take.-¢=0.05 , 26d manberg af postln rd ath ayth a — correlated, : ee 420 and mas Now, we -hawe, H+ (Mat) m4 N => 2+ (M+1)5 450 => 2+ 5M4+5450 > 5SMZ43 > MERE oy M=8 eo 2 hae -008 tim ag a Rast’ lke) : oS aw! [3 SBF [ERs Roatiada B26 = 3 [BR RyRy + RigRayt Ray Rast RoaRo Raakgat Ras Rex Rag! Rygt Rao Rye ]-o. 28 FS [016 x05 +0/3XO5640.56 40.59 40,590.45 + 0,45 KO.64 E0+64KO.AS £0.49X 0.41404 XO.23-+0,23%035] 0,95 =! 0.442 Again, estat eS tamed) = disx342 19. (344) = 0.0945 ia %o= as O42 <4 Os 010975 The dabubaded. value of Zpsjp=426 Smee —Zeeje ZZ FZoujo* Therefore eer endont , D> Poker. = Cinpl, with: salle Ihe (poke, tl dg 3 are She phen de a AU TEL Se of mands od hr gi eT sit te. 288, 0.544 0/331; 0,414, 6,228, Os 03,0, 203, 0.001, « D+ Tr dee. digal Pike cl eg ge pt Whe India winbes care all ke. WP Mhete ean be oe ne al The vobabili. ageoclated. with each of these. serbrlsltes prone by duis followi iY ; a i jh Phe drffoud dpa) = r(secoel defloent fom the fired) x PCthird different: fort the first ard sevend) = (0:5) (0.9) = 0.42 : : mA P(three ele ditls) = Plsecond. ged same 4g the rsd) x P (thtvd, digtt same, ag the frre) = (0:1)(0.1) = 0,04. ap (exaclly me patr)= 1-0,42—0r61 = Qt Br Pon dil: there are five pesssbtitiess RPCfen. defer dah) =C(4,#) Pls deferen fe fr) xf (thnd alfferent fern Firsh avd send) Peat diferent frm 288 Mayda) = 1%019% 0.9 KO,F = 0,504 P(e. parr) = ((s2)4(seeond atrrtlan a3 fiver) % PCHhird different fora firsh) xP(fomble deffererd from first and, thtrd) = 6X01 019X008 = 0432 wpP(three deel of ay kind) =C(453) xP{setondl same. as first) Phind sane ag Sisk) xP( fourth nod same. ag fivst) = 440.1 %04%09 qr] = 0036 oe MAP (four. digtls of a Kenl) = C(t) Plseiond. samme a fusd) xP(thtrd, sameag ; first) xP (foul. carve, 0g first) = AKL KOOL =. 0,001 ' VAP Ewe pars) = 4-P(foun detfork diatts)—P (three dep Plfon. dig fl Ford) — Plone. fede nb =4-0.504-— 9,036 — 9,001 0.432 =0, 004 : ‘ 25, Beample: (Three dig): i A sequence. of ye threendigeh rumbes tas been eroded and aw andyers indicates thal 680 have dhree differed Atgtis , 285 ombam exacdly one, pain of debe digihe and. 24 conlatn tree Like chptds, Basel. on, poker. sesh, ave Me runbers -trdependerd a bb ors 0,05, othegis Hp! Rj © Independerd Has Rene tndependerd. Caleulabion: fe Ohserwed ExpecTed, 7B Combination. Srequany (9) Pleptenc (E) (05-83 Three dtfferent digtt 880 /o#axs0=790| 2,99. aon One. palr 289 loatxi0m2240) 4.33 Thee like digit | 24 Oudtxs000= 19 | 44-4 Ba 4h65 | Heng, Nez 4B6S . find, Tabuleded 2, = Nnvosy3 = 599 Stace. Caleulabed, > tabulated, ie So, Hy 28 rejecded. and, We Con numbers ane. en Example... (ew digtls): BZA sequence. of A000 four digas mumbers ave, been generabel and an analysts sndtaleg the ang combina and. froguenciea, f Combination, | Obs frequency Oy Fou. drffownt digths : 560 g tad the Theo pal at trdependence Three digtls of Kin a5 [ Foun. digtks of kend | a | ile: — Define Hypothesis Hos £y ~ Sndependort Hat Ryo Hance ig 7 Observed Expecled (Oy-Ar¥ Combination. Feguency (01) | Pequony Ey) = Four defferent digtls 560 0504x1050 6,92 One pain. 394 0.432x10002439| 3,434 Two pains Be O.nextord= 24 | 0.926 “ree digits kind | 1% 0.036x1000236 | 24.694 fre digils of kind |= 4 lo.oo1xt000-4 | 0 > Za 25,465 Hee, Xs 95,148 And. Talouladed. 92 ‘ot Med = Xoo 472049 Sire. Caleulated, value y refecled , Hene n a ace Sebel vibe sold & Random Voniale Gonenabion: 4> Thverse Transform. MeLhod The tnverse Frorelon vablal can boil bs le che exp montial , wuatformn s cbr an. ee fee hig tana eh red, ny desler bef ne balla form Hed ah co fe pa cally A af Uniform. Drsbed button: auie. ‘the pa for rardom variable X 4 aly debi 48 ghor ly fz ie > aZxeb * Oo, otherwise and, the df 3 gre bys Oe Fl= Be, aZaeb = 4,1) ide ob. Now, Seb BOX)= aie =R. Sat wage 58 he eae veitihe ear § for ander “Tabiledin 2X Acceptance / Rejeclion. Method: a na) oe pee When. gnverse a ie not ests ty, to thtak eh a abe ft ding yandena. pry elit x uniforrdy dehrbdlel bh a One. wo4 do proceed. ‘would be dofollow Hose. Sheps: Generale a, yandom number, Sikep2 a) TE RDA, acept X=R, thon pote steps, kw Hf RL1/4, reject R, and, bss she 4, eps f anobhe wuform random vantade on Ja/4 54 ue needed, oe the Procedure beptnntng af step, Tf nod, shop. fe choy, of an acceptance rjechion techni ae be cn ml ipua depen beng +o wre he manda of dg 24, Gy Wik a computer program: sn.C that will perterate foru . an cal sons Ui the mulltplicative con ential 7 ethod. Allno the, Wer co Snput valves af Xoo Aye adn. Solution Hinde ceddinby Hindude Leomio n> PEE TIT, tome | at A a La x0, x45 /x0=seed , X42 nerd mm ve, dhed Sn ayeyms, Pracunstand multiplier , c=dnerement, ae : mevnoduluig ¥/ ant An; L2 for herp eonkel 5 n for no. random numbes* M43 /*Guven tn question 9/ and amay a0] J by shove, rotdom numbers generale Tear! the seed value Xo: 5 Sunt (%d”, Axo H panty ote ; prin (“Euler the costal vnlyplien ats seanf (“%d>, da): prink-f (XW), prot (“Ender the ancre mend ct »)s Seont ("ZAP , dye) print Cn), printf (« Brter the ynodubug ms », . Sean$ (“%d”, dim) pink (!\n); UA, For (4205 3205 44+) /*exp te generale ander ruumbers ¥/ X42 (aX x04¢) %ms array] = x15 ey 3 pendf (The. generated random. numbers De, »), for (1205 420.5 a+) prin ("“xed”, amay C1); prin ( ms 2 Os rel (0) 5 5

You might also like