/// <summary>
 /// Initializes a new instance, using the specified <see cref="RandomSource"/>
 /// as underlying random number generator.
 /// </summary>
 /// <param name="random">A <see cref="RandomSource"/> object.</param>
 /// <exception cref="ArgumentNullException">
 /// <paramref name="random"/> is NULL (<see langword="Nothing"/> in Visual Basic).
 /// </exception>
 public BernoulliDistribution(
     RandomSource random
     )
     : base(random)
 {
     SetDistributionParameters(0.5);
 }
 /// <summary>
 /// Initializes a new instance, using the specified <see cref="RandomSource"/>
 /// as underlying random number generator.
 /// </summary>
 /// <param name="random">A <see cref="RandomSource"/> object.</param>
 /// <exception cref="ArgumentNullException">
 /// <paramref name="random"/> is NULL (<see langword="Nothing"/> in Visual Basic).
 /// </exception>
 public BinomialDistribution(
     RandomSource random
     )
     : base(random)
 {
     SetDistributionParameters(0.5, 1);
 }
 /// <summary>
 /// Initializes a new instance, using the specified <see cref="RandomSource"/>
 /// as underlying random number generator.
 /// </summary>
 /// <param name="random">A <see cref="RandomSource"/> object.</param>
 /// <exception cref="ArgumentNullException">
 /// <paramref name="random"/> is NULL (<see langword="Nothing"/> in Visual Basic).
 /// </exception>
 public CauchyLorentzDistribution(
     RandomSource random
     )
     : base(random)
 {
     SetDistributionParameters(0.0, 1.0);
 }
 /// <summary>
 /// Initializes a new instance, using the specified <see cref="RandomSource"/>
 /// as underlying random number generator.
 /// </summary>
 /// <param name="random">A <see cref="RandomSource"/> object.</param>
 /// <exception cref="ArgumentNullException">
 /// <paramref name="random"/> is NULL (<see langword="Nothing"/> in Visual Basic).
 /// </exception>
 public ArbitraryDistribution(
     RandomSource random
     )
     : base(random)
 {
     SetDistributionParameters(0, 1.0);
 }
 /// <summary>
 /// Initializes a new instance, using the specified <see cref="RandomSource"/>
 /// as underlying random number generator.
 /// </summary>
 /// <param name="random">A <see cref="RandomSource"/> object.</param>
 /// <exception cref="ArgumentNullException">
 /// <paramref name="random"/> is NULL (<see langword="Nothing"/> in Visual Basic).
 /// </exception>
 public ErlangDistribution(
     RandomSource random
     )
     : base(random)
 {
     SetDistributionParameters(1, 1.0);
 }
 /// <summary>
 /// Initializes a new instance, using the specified <see cref="RandomSource"/>
 /// as underlying random number generator.
 /// </summary>
 /// <param name="random">A <see cref="RandomSource"/> object.</param>
 /// <exception cref="ArgumentNullException">
 /// <paramref name="random"/> is NULL (<see langword="Nothing"/> in Visual Basic).
 /// </exception>
 public ParetoDistribution(
     RandomSource random
     )
     : base(random)
 {
     SetDistributionParameters(1.0, 1.0);
 }
 /// <summary>
 /// Initializes a new instance, using the specified <see cref="RandomSource"/>
 /// as underlying random number generator.
 /// </summary>
 /// <param name="random">A <see cref="RandomSource"/> object.</param>
 /// <exception cref="ArgumentNullException">
 /// <paramref name="random"/> is NULL (<see langword="Nothing"/> in Visual Basic).
 /// </exception>
 public LaplaceDistribution(
     RandomSource random
     )
     : base(random)
 {
     SetDistributionParameters(0.0, 1.0);
 }
 /// <summary>
 /// Initializes a new instance, using the specified <see cref="RandomSource"/>
 /// as underlying random number generator.
 /// </summary>
 /// <param name="random">A <see cref="RandomSource"/> object.</param>
 /// <exception cref="ArgumentNullException">
 /// <paramref name="random"/> is NULL (<see langword="Nothing"/> in Visual Basic).
 /// </exception>
 public DiscreteUniformDistribution(
     RandomSource random
     )
     : base(random)
 {
     SetDistributionParameters(0, 1);
 }
 /// <summary>
 /// Initializes a new instance, using the specified <see cref="RandomSource"/>
 /// as underlying random number generator.
 /// </summary>
 /// <param name="random">A <see cref="RandomSource"/> object.</param>
 /// <exception cref="ArgumentNullException">
 /// <paramref name="random"/> is NULL (<see langword="Nothing"/> in Visual Basic).
 /// </exception>
 public StableDistribution(
     RandomSource random
     )
     : base(random)
 {
     SetDistributionParameters(0.0, 1.0, 1.0, 0.0);
     InitDistributions();
 }
 /// <summary>
 /// Initializes a new instance, using the specified <see cref="RandomSource"/>
 /// as underlying random number generator.
 /// </summary>
 /// <param name="random">A <see cref="RandomSource"/> object.</param>
 /// <exception cref="ArgumentNullException">
 /// <paramref name="random"/> is NULL (<see langword="Nothing"/> in Visual Basic).
 /// </exception>
 public ChiDistribution(
     RandomSource random
     )
     : base(random)
 {
     _standard = new StandardDistribution(random);
     SetDistributionParameters(1);
 }
 /// <summary>
 /// Initializes a new instance, using the specified <see cref="RandomSource"/>
 /// as underlying random number generator.
 /// </summary>
 /// <param name="random">A <see cref="RandomSource"/> object.</param>
 /// <exception cref="ArgumentNullException">
 /// <paramref name="random"/> is NULL (<see langword="Nothing"/> in Visual Basic).
 /// </exception>
 public StudentsTDistribution(
     RandomSource random
     )
     : base(random)
 {
     _standardDistribution = new StandardDistribution(RandomSource);
     _chiSquareDistribution = new ChiSquareDistribution(RandomSource);
     SetDistributionParameters(1);
 }
        /// <summary>
        /// Initializes a new instance of the <see cref="DiscreteDistribution"/> class, using the
        /// specified <see cref="RandomSource"/> as underlying random number generator.
        /// </summary>
        /// <param name="random">A <see cref="RandomSource"/> object.</param>
        /// <exception cref="ArgumentNullException">
        ///     <paramref name="random"/> is NULL (<see langword="Nothing"/> in Visual Basic).
        /// </exception>
        protected DiscreteDistribution(
            RandomSource random
            )
        {
            if(random == null)
            {
                string message = string.Format(null, Resources.ArgumentNull, "generator");
                throw new ArgumentNullException("generator", message);
            }

            _random = random;
        }
 /// <summary>
 /// Initializes a new instance, using the specified <see cref="RandomSource"/>
 /// as underlying random number generator.
 /// </summary>
 /// <param name="random">A <see cref="RandomSource"/> object.</param>
 /// <exception cref="ArgumentNullException">
 /// <paramref name="random"/> is NULL (<see langword="Nothing"/> in Visual Basic).
 /// </exception>
 public ExponentialDistribution(
     RandomSource random
     )
     : base(random)
 {
     SetDistributionParameters(1.0);
 }
 /// <summary>
 /// Zipfian generator with a default <c>skew</c> equal to <c>2</c>.
 /// </summary>
 /// <param name="random">A <see cref="RandomSource"/> object.</param>
 public ZipfDistribution(RandomSource random)
 {
     this.skew = 2d;
     this.random = random;
 }
 /// <summary>
 /// Initializes a new instance, using the specified <see cref="RandomSource"/>
 /// as underlying random number generator.
 /// </summary>
 /// <param name="random">A <see cref="RandomSource"/> object.</param>
 /// <exception cref="ArgumentNullException">
 /// <paramref name="random"/> is NULL (<see langword="Nothing"/> in Visual Basic).
 /// </exception>
 public HypergeometricDistribution(
     RandomSource random
     )
     : base(random)
 {
     SetDistributionParameters(2, 1, 1);
 }
 /// <summary>
 /// Initializes a new instance, using the specified <see cref="RandomSource"/>
 /// as underlying random number generator.
 /// </summary>
 /// <param name="random">A <see cref="RandomSource"/> object.</param>
 /// <exception cref="ArgumentNullException">
 /// <paramref name="random"/> is NULL (<see langword="Nothing"/> in Visual Basic).
 /// </exception>
 public PoissonDistribution(
     RandomSource random
     )
     : base(random)
 {
     SetDistributionParameters(1.0);
 }
        /// <summary>
        /// Create a zipf distribution with the provided skew and seed.
        /// </summary>
        public ZipfDistribution(double skew, int seed)
        {
            if(skew <= 1d)
            {
                throw new ArgumentOutOfRangeException("skew", skew, string.Format(Resources.ArgumentOutOfRangeGreater, "skew", "1.0"));
            }

            this.skew = skew;
            random = new SystemRandomSource(seed);
        }
 /// <summary>
 /// Initializes a new instance, using the specified <see cref="RandomSource"/>
 /// as underlying random number generator.
 /// </summary>
 /// <param name="random">A <see cref="RandomSource"/> object.</param>
 /// <exception cref="ArgumentNullException">
 /// <paramref name="random"/> is NULL (<see langword="Nothing"/> in Visual Basic).
 /// </exception>
 public TriangularDistribution(
     RandomSource random
     )
     : base(random)
 {
     SetDistributionParameters(0.0, 1.0, 0.5);
 }
 /// <summary>
 /// Initializes a new instance, using the specified <see cref="RandomSource"/>
 /// as underlying random number generator.
 /// </summary>
 /// <param name="random">A <see cref="RandomSource"/> object.</param>
 /// <exception cref="ArgumentNullException">
 /// <paramref name="random"/> is NULL (<see langword="Nothing"/> in Visual Basic).
 /// </exception>
 public StandardDistribution(
     RandomSource random
     )
     : base(random)
 {
 }
 /// <summary>
 /// Initializes a new instance, using the specified <see cref="RandomSource"/>
 /// as underlying random number generator.
 /// </summary>
 /// <param name="random">A <see cref="RandomSource"/> object.</param>
 /// <exception cref="ArgumentNullException">
 /// <paramref name="random"/> is NULL (<see langword="Nothing"/> in Visual Basic).
 /// </exception>
 public LognormalDistribution(
     RandomSource random
     )
     : base(random)
 {
     _standard = new StandardDistribution(random);
     SetDistributionParameters(0.0, 1.0);
 }
 /// <summary>
 /// Initializes a new instance, using the specified <see cref="RandomSource"/>
 /// as underlying random number generator.
 /// </summary>
 /// <param name="random">A <see cref="RandomSource"/> object.</param>
 /// <exception cref="ArgumentNullException">
 /// <paramref name="random"/> is NULL (<see langword="Nothing"/> in Visual Basic).
 /// </exception>
 public BetaDistribution(
     RandomSource random
     )
     : base(random)
 {
     _gammaAlpha = new GammaDistribution(random);
     _gammaBeta = new GammaDistribution(random);
     SetDistributionParameters(1.0, 1.0);
 }
 /// <summary>
 /// Zipfian generator with a default <c>skew</c> equal to <c>2</c>.
 /// </summary>
 public ZipfDistribution()
 {
     this.skew = 2d;
     random = new SystemRandomSource();
 }