I have forgotten
my Password

Or login with:

  • Facebookhttp://facebook.com/
  • Googlehttps://www.google.com/accounts/o8/id
  • Yahoohttps://me.yahoo.com
get GPL
COST (GBP)
this unit 0.10
sub units 0.00
+
0

Permut

Calculates the number of permutations for a given set of data.
Controller: CodeCogs

Interface

C++

Permut

 
doublepermutintn
intk )
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:

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: 30

Parameters

nis an integer that describes the number of objects
kis an integer that describes the number of objects in each permutation.

Returns

the number of permutations for a given set of data

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.