FUNCTION
Permut
Calculates the number of permutations for a given set of data.
Interface
#include <codecogs/statistics/moments/permut.h>
using namespace Statistics::Moments;
Returns the <em>number of permutations</em> for a given number of objects that can be selected from number objects.
A permutation is any set or subset of objects or events where internal order is significant.
Permutations are different from combinations, for which the internal order is not significant. Use this function for lottery-style probability calculations. The equation for the number of permutations is:
(1)
Example 1
#include <codecogs/statistics/moments/permut.h>
#include <iostream>
int main()
{
double per = Stats::Moments::permut(6, 2);
std::cout << "The number of permutations is: " << per<< std::endl;
return 0;
}Output:
The number of permutations is: 30Parameters
n
is an integer that describes the number of objects
k
is an integer that describes the number of objects in each permutation.
Returns
the number of permutations for a given set of data
Interactive Calculator
n
k
Result
Computing…
Set a range above first to export a graph.
This function's source code is only visible to registered users — documentation and the calculator above are free to use either way. Sign in to see it.