Combin
Calculates the number of combinations for a given set of data.
Controller:
CodeCogs
Interface
#include <codecogs/statistics/moments/combin.h>
using namespace Stats::Moments;
| double | combin (int n, int k)
Calculates the number of combinations for a given set of data. |
Use the following HTML code to embed the calculators within other websites:
| Name | HTML Code |
|---|
combin
Calculates the number of combinations for a given set of data. | |
Combin
Returns the number of combinations for a given number of items. Use
Combin to determine the total possible
number of groups for a given number of items. A combination is any set or subset of items, regardless of their
internal order. Combinations are distinct from permutations, for which the internal order is significant.
The number of combinations of
n items with
k items in each combination is given by the following formula:
where:
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.
You must login to leave a messge