Article View: sci.math.num-analysis
Article #696Re: 2D random numbers
From: dch
Date: Thu, 01 Oct 1992 10:31
Date: Thu, 01 Oct 1992 10:31
13 lines
1104 bytes
1104 bytes
In article <3638.9209301031@rfsparc.essex.ac.uk> jenum@essex.ac.uk (Mohamed Jenu M Z) writes:
>
>Is it ok to generate a 2D Gaussian distribution (mean 0 and variance 1)
>pseudorandom numbers from a 1D pseudorandom numbers (Gaussian, mean 0,
>variance 1) by arranging them into rows and columns?
>
Since you want pairs of random numbers, you may find it more efficient to use the Box-Muller
scheme:
x = sqrt(-2 log xi) cos(2 pi eta), y = sqrt(-2 log xi) sin(2 pi eta),
where xi, eta are successive pseudorandom numbers uniformly distributed on (0,1).
(- unless you already have a more efficient Gaussian generator available)
David Handscomb (dch@comlab.ox.ac.uk)
Technical Details
Message-ID:
<1992Oct1.103154.2103@nagp12.comlab.ox.ac.uk>Path:
arc1-ca.pugleaf.net!sparky!uunet!mcsun!uknet!comlab.ox.ac.uk!dchReferences:
<3638.9209301031@rfsparc.essex.ac.uk>Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!sparky!uunet!mcsun!uknet!comlab.ox.ac.uk!dch From: dch@comlab.ox.ac.uk Newsgroups: sci.math.num-analysis Subject: Re: 2D random numbers Message-ID: <1992Oct1.103154.2103@nagp12.comlab.ox.ac.uk> Date: 1 Oct 92 10:31:54 GMT References: <3638.9209301031@rfsparc.essex.ac.uk> Sender: dch@comlab.ox.ac.uk Organization: Oxford University Computing Laboratory, UK Lines: 13 Originator: dch@nagp12.comlab