Statistics › Moments ›
Combin
Calculates the number of combinations for a given set of data.
Controller: CodeCogs
Contents
Interface
C++
Combin
doublecombin( | int | n | |
int | k | ) |
Example 1
#include <codecogs/statistics/moments/combin.h> #include <iostream> int main() { double com = Stats::Moments::combin(9, 5); std::cout << "The number of combinations is: " << com << std::endl; return 0; }
Output:The number of combinations is: 126
Parameters
n the total number of items. k the number of items in each combination. k must be less than n.
Returns
- the number of combinations for a given number of items
Authors
- Anca Filibiu (August 2005)
Source Code
Source code is available when you agree to a GP Licence or buy a Commercial Licence.
Not a member, then Register with CodeCogs. Already a Member, then Login.