Internatonal Conference on Appled Scence and Engneerng Innovaton (ASEI 205) Several generaton ethods of ultnoal dstrbuted rando nuber Tan Le, a,lnhe,b,zhgang Zhang,c School of Matheatcs and Physcs, USTB, Bejng 0008, Chna a carolneletan@6.co, b heln@6.co, c zzgcyf@26.net Keywords: ultnoal dstrbuton, pseudo rando nuber, Gbbs saplng, sulaton Abstract.The paper ntroduces three dfferent ways to generate pseudo rando nuber of ultnoal dstrbuton and also descrbes the pleentaton process n detal wth the odel of sall ball and bo. We anly consder the generaton usng Gbbs saplng n MCMC ethod. In the paper, we ntend to fnd the hgh-qualty generaton of pseudo rando nuber of ultnoal dstrbuton. Introducton To soe etent, ultnoal dstrbuton can be consdered as a generalzaton of the bnoal dstrbuton. Bernoull trals of bnoal dstrbuton only have two opposte possble outcoes AA AA 2 and the result of each tral s ndependent. In Bernoull trals of bnoal dstrbuton, let rando varables stand for the results of trals, pp stands for the probablty of the event occurs. So, n n testral, the probablty of kk tes occurrences P ( k) C k k ( ) n k n p p,so that X~ Bnp (, ). In ultnoal dstrbuton, there are several resultsaa, AA 2,, AA, AA + and ther probabltes are + pp, pp 2,, pp, pp + whch satsfy pp. Therefore, the probablty thataa occurs tes, AA 2 occurs 2 tes,, AA occurs tes, AA + occurs + tes,s + 2 + p p2... p p+ and!... +! n. Therefore, lke bnoal dstrbuton, we defne the jont dstrbuton prncple and other equatons n ultnoal dstrbuton, thus, we get the followng forulas. 2 n ( +... + ) 2 n ( +... + ) PX {, X }... CC n n Cn Cn p p2... p ( ( p+... + p)) 2 n ( +... + ) () p p2... p ( ( p+... + p))!!...!( n ( +... + ))! + 2 + p, p p and n, n + + Hence, we defne X ( X,..., X ) ~ M( n,,[ p, p2,... p ]) as ultnoal dstrbuton. Generatons of pseudo rando nuber of ultnoal dstrbuton When studyng the ultnoal dstrbuton, we consder the proble of throwng nn sall balls nto boes. The probabltes of the sall ball nto the tth bo separately are pp pp 2 pp. Hence, the probablty satsfes the approate forulas., X2 2,..., X ) 2 n ( +... + ) (2) p p2...( ( p+...+ p ))! 2!...( n ( +... + ))! However, when the nubers of the sall balls and boes are large, there s hgh probablty of boundary volaton n coputer s calculaton because of the large factoral ter. Hence, we apply the logarthc transforaton n the above forulas. 205. The authors - Publshed by Atlants Press 98
PX X X p p p 2 ln (,,..., ) ln(... ) 2 2 2! 2!...! (ln n+ ln( n ) +... + ln) [ln( ) + ln( ) +... + ln] + ln p In the sulaton, we choose the eperent puttng 20 sall balls nto boes 00 tes. In the eperent, PP,the probablty that sall balls fall nto the frst bo each te s 0.. Analogously, we can defne that PP 2 0.2, PP 0., PP 0.. () Separaton nto ultdensonal 0- vectors Dvde X ( X, X2,..., X ) nto X, whch represents the nuber n the tth bo. Hence, we separate XX nto nn 0- rando vectors wth dens. We put nn sall balls nto boes one by one. Defne 0- rando vectorsyj ( yj, yj2,..., y j, ), Yj as the result of the jj tth ball. And, the value of yj,... y j, s only 0 or and yj +...+ y j,. For eaple, f y j, t shows that the nn jj tth ball falls nto the frst bo. Accordng to the defnton, we can get XX jj yy. Because each ball falls nto boes ndependently, Yj s ndependent fro each other and PY ( p, p,..., p ). j 2 Usng Inverse Transforaton Method, we can deterne whch bo the sall ball falls ntoaccordng to the unfor rando nubers. Repeatng the tral nn tes we can sulate the ultnoal dstrbuton. Fg. : The sulaton accordng to separaton nto ultdensonal 0- vectors. InFg., the abscssaof the top left dagrarepresents 00 eperents and the value of the ordnate separately stands for the nuber of sall balls n one of these boes.the dagra n the top leftdynacally dsplays the nuber of sall balls n each bo n each eperent. The dagra n the lower left shows the dstrbuton law of sall balls n each bo, the frequency and the average value of nuber of dfferent balls appearng n each bo n 00 eperents. The dagra n the lower rght dsplays the stuaton of bnoal dstrbuton n each bo wth gven dstrbuton probablty. Multplcaton forula of the jont dstrbuton The ultplcaton forula of the jont dstrbuton:, X2 2,..., X ) () ) X ) X, X )... X,..., X ) 2 2 2 2 99
In the Eq... n The condtonal probablty forula: 2 2 2 2 ) X ) 2 2 2 n 2, X ) ( n )! p p p! n! p p 2 2 p p ( p p )! 2! ( n 2)! n p ( p)!( n )! p2.e. X2 X ~ Bn (, ) p Accordng to the forulas (5), we can dervate the forulas below.,..., X, X ) X,..., X ),..., X ) ( + + ) 2 2 2 p p... p ( ( p +... + p ))! 2!...! ( n ( +... + ) )! 2 p p2... p 2( ( p+... + p 2))!!...! n (... )! 2 n 2 2 2 2 n ( +... + ) 2 2 n ( +... + 2) n ( +... + )! p ( p +... + p )! n ( +... + )! ( p +... + p ) ( p +... + p ) 2 n ( +... + ) 2 2 p.e. X X,..., X ~ Bn ( ( +... + 2), ) ( p+... + p 2) Frstly, we consder the stuaton of the frst bo. When the nuber of sall balls n the frst bo s deterned, we consder the stuaton of the second bo. Lke ths, we can deterne the nuber of sall balls n the second and the thrd bo separately. Fnally, we put all reanng balls nto the last bo. Accordng to the defntons above,rando vector satsfes X ~ Bnp (, ) and the condtonal probabltes of rando vectors XX 2, XX satsfy bnoal dstrbuton. Usng the saplng n bnoal dstrbuton, we can get values, 2, and 20 ( + 2 + ) s the nuber of sall balls n the fourth bo. (6) (5) Fg. 2: The sulaton accordng to ultplcaton forula of the jont dstrbuton. When we coparefg. 2 wth Fg., the dfference s that the grd eshes flled wth yellow shows the nuber of sall balls n each bnoal dstrbuton. In the result of the sulaton, we can see each denson of ultnoal dstrbuton stll satsfes the bnoal dstrbuton. 00
Gbbs saplng Usng Gbbs saplng, we can get an approprate ltng probablty dstrbuton of Markov chan. The ntal condton, 2,, s set to any rando vector ncludng four non-negatve ntegers wth the su of the s 20. And represents the nuber of the balls n the tth bo. Then, we change condtons n the followng way, choosng two nubers fro,2,, randoly to deterne the net condton. For eaple, f we choose,, let s + and keep the value of 2, constant to sulate the new value of,. We control one of the varables, to ps deterne the other. We can presue that varable ~ Bs (, ) and,..., s. Accordng p + p s to nverse dscrete transforaton ethod, we can get the value of varable as v so that s s v. Hence, we obtan the value of, 2,, n the net condton. If we allow the bo s epty, the nuber of balls n each bo can be 0. Frstly, we use the followng ethod to obtan the ntal condton 2 : ) Generate a nteger rando nuber unforly dstrbuted n [0,20] as. 2) Generate a nteger rando nuber unforly dstrbuted n [0,20 ] as 2. ) Generate a nteger rando nuber unforly dstrbuted n [0,20 2 ] as. ) Let 20 ( + 2 + ). After we get the ntal condton, let 2 as the frst colun of array XX. In the sulaton usng Gbbs saplng ntroduced n secton 2., we set nuber realzaton as 00 and track nuber as 20 for ore stable results. Fg. : The sulaton accordng to Gbbs saplng. Coparng wth otherfgures above, the dagra n the top rght offg. s qute dfferent fro others. These yellow sall crcles and green sall crcle stand for the two boes, whch are chose to change ther value n ths track. The abscssa represents track nuber 20, n other words, we get a stable result after 20 echanges. Acknowledgeents Ths work was fnancally supported by the Innovaton Progra of Unversty of Scence and Technology Bejng(520067) Reference: []Chen LanXang, F 一 Mna Estators of the Paraeters of the ultnoal dstrbuton, Journal of Matheatcal Research and Eposton,Vol.9,No., p.89-9(989) 0
[2]ShFeng Xong, GuoYng L: Test of the Mau Probablty of the ultnoal dstrbuton, SCIENCE IN CHINA Ser. A Matheatcs2005 No. 07,p.86-80,(2005) [] Melnkova, Y :Hstory Matchng Through a Sooth Forulaton of Multple-Pont Statstcs, MATHEMATICAL GEOSCIENCES,Vol 7, No,p.97-6(205) [] Baker, S.,Cousns, R.D:Clarfcaton of the use of ch-square and lkelhood functons n fts to hstogras,nuclear Instruents & Methods n Physcs Research, Secton A,Vol.22,No.2,p. 7-2,(98) [5] Hadfeld, JD: MCMC Methods for Mult-Response Generalzed Lnear Med Models,JOURNAL OF STATISTICAL SOFTWARE,Vol.,No.2,p.-22,(200) [6] HU Yue:Multnoal dstrbuton and ult-posson dstrbuton, Journal of Zhejang Unversty of Scence and Technology,Vo l.7 No.,(2005) 02