13.07.2015 Views

Mathematical Methods for Physics and Engineering - Matematica.NET

Mathematical Methods for Physics and Engineering - Matematica.NET

Mathematical Methods for Physics and Engineering - Matematica.NET

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

NUMERICAL METHODSon (0, 1) <strong>and</strong> then take as the r<strong>and</strong>om number y the value of F −1 (ξ). We nowillustrate this with a worked example.◮Find an explicit <strong>for</strong>mula that will generate a r<strong>and</strong>om number y distributed on (−∞, ∞)according to the Cauchy distribution( a)dyf(y) dy =π a 2 + y , 2given a r<strong>and</strong>om number ξ uni<strong>for</strong>mly distributed on (0, 1).The first task is to determine the indefinite integral:∫ y ( a)dtF(y) =−∞ π a 2 + t = 1 y 2 π tan−1 a + 1 2 .Now, if y is distributed as we wish then F(y) is uni<strong>for</strong>mly distributed on (0, 1). This followsfrom the fact that the derivative of F(y) isf(y). We there<strong>for</strong>e set F(y) equaltoξ <strong>and</strong>obtainξ = 1 y π tan−1 a + 1 2 ,yieldingy = a tan[π(ξ − 1 )]. 2This explicit <strong>for</strong>mula shows how to change a r<strong>and</strong>om number ξ drawn from a populationuni<strong>for</strong>mly distributed on (0, 1) into a r<strong>and</strong>om number y distributed according to theCauchy distribution. ◭Look-up tables operate as described below <strong>for</strong> cumulative distributions F(y)that are non-invertible, i.e. F −1 (y) cannot be expressed in closed <strong>for</strong>m. Theyare especially useful if many r<strong>and</strong>om numbers are needed but great samplingaccuracy is not essential. The method <strong>for</strong> an N-entry table can be summarised asfollows. Define w m by F(w m )=m/N <strong>for</strong> m =1, 2,...,N, <strong>and</strong> store a table ofy(m) = 1 2 (w m + w m−1 ).As each r<strong>and</strong>om number y is needed, calculate k as the integral part of Nξ <strong>and</strong>take y as given by y(k).Normally, such a look-up table would have to be used <strong>for</strong> generating r<strong>and</strong>omnumbers with a Gaussian distribution, as the cumulative integral of a Gaussian isnon-invertible. It would be, in essence, table 30.3, with the roles of argument <strong>and</strong>value interchanged. In this particular case, an alternative, based on the centrallimit theorem, can be considered.With ξ i generated in the usual way, i.e. uni<strong>for</strong>mly distributed on the interval0 ≤ ξ

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!