**'edu.rit.numeric.NormalPrng'**Java class

edu.rit.numeric

## Class NormalPrng

- java.lang.Object
- edu.rit.numeric.DoublePrng
- edu.rit.numeric.NormalPrng

public class NormalPrngextends DoublePrng

Class NormalPrng provides a pseudorandom number generator (PRNG) that generates random numbers with a normal distribution.Every two calls of the

`next()`method result in two calls of the underlying uniform PRNG's`nextDouble()`method. More precisely, the first of a pair of`next()`calls does two`nextDouble()`calls, the second of a pair of`next()`calls does not call`nextDouble()`.Class NormalPrng uses the Box-Muller method to generate a standard normal distribution. Let

*x*_{1}and*x*_{2}be drawn from a uniform distribution between 0 and 1. Then*y*_{1}and*y*_{2}, defined as follows, are drawn from a standard normal distribution.*y*_{1}= sqrt(−2 ln*x*_{1}) cos 2π*x*_{2}*y*_{2}= sqrt(−2 ln*x*_{1}) sin 2π*x*_{2}*y*_{1}) and (μ + σ*y*_{2}) are drawn from a normal distribution with mean μ and standard deviation σ.*Note:*While slower than other techniques, this technique does a fixed number of`nextDouble()`calls to generate each normally distributed random number. This behavior is important when parallel programs generate random numbers.

**Warning:**You cannot see the full API documentation of this class since the access to the DatMelt documentation for third-party Java classes is denied. Guests can only view jhplot Java API. To view the complete description of this class and its methods, please request the full DataMelt membership.

If you are already a full member, please login to the DataMelt member area before visiting this documentation.