![]() |
VOOZH | about |
This function is defined in header randomRandom. Negative binomial distribution is Random number distribution that produces integers according to a negative binomial discrete distribution (also known as Pascal distribution), which is described by the following probability mass function.
The value represents the number of failures in a series of independent yes/no trials (each succeeds with probability p), before exactly k successes occur.
Syntax :
template( class IntType = int ) class negative_binomial_distribution
Template Parameter :
IntType : The result type generated by the generator.
Member Types
Member type & Definition
| result_type | IntType |
| param_type | The type returned by member param |
Member functions : public member function
Distribution parameters : public member function
Non-member functions : Function Templates
Below program to illustrate the above template
Output :
Negative binomial distribution with ( k = 4, p = 0.5 ) : 0: ***** 1: ************ 2: **************** 3: *************** 4: ************* 5: ********** 6: ******** 7: ***** 8: *** 9: **
Below program with distribution parameter of 1 and 20%
Program 2:
Output :
Negative binomial distribution with ( k = 1, p = 0.2 ) : 0: ******************* 1: *************** 2: ************ 3: ********** 4: ******** 5: ****** 6: ***** 7: **** 8: *** 9: **