PeterO.RandomGenerator.NegativeBinomial C# (CSharp) Method

NegativeBinomial() public method

Conceptually, generates either 1 or 0 the given number of times until the given number of 1's are generated, and counts the number of 0's generated. Either number has an equal probability of being generated.
public NegativeBinomial ( int trials ) : int
trials int The number of 1's to generate before the /// process stops.
return int
        public int NegativeBinomial(int trials)
        {
            return this.NegativeBinomial(trials, 0.5);
        }

Same methods

RandomGenerator::NegativeBinomial ( int trials, double p ) : int