回复:(leeco)回复:(HJin)回复:(leeco)回复:...
The permutation group can be represented by matrix A
of size 2n by 2n with
A(2,1)=A(4,2)=...=A(2n,n)=1;
A(1,n+1)=A(3,n+2)=...=A(2n-1,2n)=1;
A(i,j) = 0 if (i,j) does not belong to above cases.
I believe you can show that it is a cyclic group. You may need to study
the theory of groups.
Although leeco gave a counter-example for odd number (here we have 2n),
I believe that we can move the first number back to position 1 with all
other numbers simultaneously back to their original positions.
Following C++ code verifies that this observation holds for 1<=n<=10^3.
==========================================================
#include <iostream>
#include <iomanip>
#define N 1000
using namespace std;
int a[2*N+1], b[2*N+1];
void shuffle(int*a, int *b, int n)
{
int i, i2;
for(i=1; i<=n; ++i)
{
i2=(i<<1);
b[i2] = a[i];
b[i2-1] = a[n+i];
}
}
int count(int n)
{
int i, c=0, n2=(n<<1);
bool bOrig = false;
for(i=1; i<=n2; ++i)
a[i] = i;
while(!bOrig)
{
shuffle(a, b, n);
++c;
bOrig = true;
for(i=1; i<=n2; ++i)
{
if(b[i] != i)
{
bOrig = false;
break;
}
}
if(bOrig)
break;
shuffle(b, a, n);
++c;
bOrig = true;
for(i=1; i<=n2; ++i)
{
if(a[i] != i)
{
bOrig = false;
break;
}
}
}
return c;
}
int permute1(int n)
{
int a=2, c=1;
while(a!=1)
{
if(a<=n)
a<<=1;
else
a=2*(a-n)-1;
++c;
}
return c;
}
int main()
{
int n;
for(n=1; n<=N; ++n)
{
// If you have access to nice computing service, change N to a big
// number and run it.
//
// If you are a math graduate, show it mathematically that there eixsts
// k s.t. A^k = I.
if( count(n) != permute1(n) )
cout<<setw(6)<<n<<setw(10)<<count(n)<<setw(10)<<permute1(n)<<endl;
}
return 0;
}