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 1.40
sub units 3.96
+
0

fixed permutation

Calculates the number of permutations of \e n objects with \e m fixed.
Controller: CodeCogs

get GPL add to cart

Dependents

Info

Interface

C++
Excel

Fixed Permutation

 
intfixed_permutationintn
intm )
A permutation of n objects with m fixed is a permutation in which exactly m of the objects retain their original positions. In more formal terms, consider the following permutation

then \sigma has exactly m fixed objects if

If m = 0, the permutation is a derangement, while if m = n, the permutation is the identity.

The number of permutations of n objects with m fixed is given by

or

where D_{n - m} is the number of derangements of n - m objects.

This function calculates the value of F(n, m) based on the above formula.

References:

SUBSET, a C++ library of combinatorial routines, http://www.csit.fsu.edu/~burkardt/cpp_src/subset/subset.html

Example 1

#include <codecogs/maths/combinatorics/sequences/fixed_permutation.h>
#include <iostream>
int main()
{
  std::cout << "The number of permutations of 10 elements with 5 fixed is: ";
  std::cout << Maths::Combinatorics::Sequences::fixed_permutation(10, 5) << std::endl;
  return 0;
}

Output

The number of permutations of 10 elements with 5 fixed is: 11088

Parameters

nthe size of the permutation
mthe number of fixed objects

Returns

the number of permutations of n items with m fixed

Authors

Lucian Bentea (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.