Loading [MathJax]/jax/output/HTML-CSS/jax.js
Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

asked 3 years ago

lijr07 gravatar image

Find the longest word in a symmetric group which satisfies a certain property.

Let A,B be two list of equal length, where A is weakly increasing. For example, A=[1,1,2,3,3,4], B=[12,9,10,15,15,14].

Define mA,B=[Ai,Bi] (this is a multi-set of pairs of integers, not a list of pairs, so the order of pairs in mA,B does not matter).

By a result in symmetric group, there is a unique element with maximal length (length of the reduced word) in Sk (k is the length of A) such that mA,w(sorted(B))=mA,B, where sorted(B) is to sorted B such that it is weakly increasing, and the action of w=si1sim on a list L is defined by: sj(L) means exchanging the jth and j+1th elements of L.

There is a method to compute the longest word w by checking all elements in Sk. But it takes a long time when k is large. The following function works fine and returns correct result.

 def LongestPerm(A,Bsorted,B):
    k = len(A)
    S = set([(A[i],B[i]) for i in range(k)])
    W = WeylGroup('A'+str(k-1), prefix = 's')

    winner = W.one()
    for w in W:
        wstr = w.inverse().to_permutation_string()
        if set([(A[int(wstr[i])-1],Bsorted[i]) for i in range(k)]) == S:      
            if w.length()>winner.length():
                winner = w
    return winner

Is there some method to compute w faster (without checking all elements of Sk)? Thank you very much.

Find the longest word in a symmetric group which satisfies a certain property.

Let A,B be two list of equal length, where A is weakly increasing. For example, A=[1,1,2,3,3,4], B=[12,9,10,15,15,14].

Define mA,B=[Ai,Bi] (this is a multi-set of pairs of integers, not a list of pairs, so the order of pairs in mA,B does not matter).

By a result in symmetric group, there is a unique element with maximal length (length of the reduced word) in Sk (k is the length of A) such that mA,w(sorted(B))=mA,B, where sorted(B) is to sorted B such that it is weakly increasing, and the action of w=si1sim on a list L is defined by: sj(L) means exchanging the jth and j+1th elements of L.

There is a method to compute the longest word w by checking all elements in Sk. But it takes a long time when k is large. The following function works fine and returns correct result.

 def LongestPerm(A,Bsorted,B):
    k = len(A)
    S = set([(A[i],B[i]) for i in range(k)])
    W = WeylGroup('A'+str(k-1), prefix = 's')

    winner = W.one()
    for w in W:
        wstr = w.inverse().to_permutation_string()
        if set([(A[int(wstr[i])-1],Bsorted[i]) for i in range(k)]) == S:      
            if w.length()>winner.length():
                winner = w
    return winner

Is there some method to compute w faster (without checking all elements of Sk)? Thank you very much.

Find the longest word in a symmetric group which satisfies a certain property.

Let A,B be two list of equal length, length k, where A is weakly increasing. For example, A=[1,1,2,3,3,4], B=[12,9,10,15,15,14].

Define $m_{A,B} = { [ mA,B to be the multiset of pairs $[ A_i, B_i ] }$ ],i \in k$, (this is a multi-set of pairs of integers, not a list of pairs, so the order of pairs in mA,B does not matter).

By a result in symmetric group, there is a unique element with maximal length (length of the reduced word) in Sk (k is the length of A) such that mA,w(sorted(B))=mA,B, where sorted(B) is to sorted B such that it is weakly increasing, and the action of w=si1sim on a list L is defined by: sj(L) means exchanging the jth and j+1th elements of L.

There is a method to compute the longest word w by checking all elements in Sk. But it takes a long time when k is large. The following function works fine and returns correct result.

 def LongestPerm(A,Bsorted,B):
    k = len(A)
    S = set([(A[i],B[i]) for i in range(k)])
    W = WeylGroup('A'+str(k-1), prefix = 's')

    winner = W.one()
    for w in W:
        wstr = w.inverse().to_permutation_string()
        if set([(A[int(wstr[i])-1],Bsorted[i]) for i in range(k)]) == S:      
            if w.length()>winner.length():
                winner = w
    return winner

Is there some method to compute w faster (without checking all elements of Sk)? Thank you very much.

Find the longest word in a symmetric group which satisfies a certain property.

Let A,B be two list of equal length k, where A is weakly increasing. For example, A=[1,1,2,3,3,4], B=[12,9,10,15,15,14].

Define mA,B to be the multiset of pairs [Ai,Bi], ik, (this is a multi-set of pairs of integers, not a list of pairs, so the order of pairs in mA,B does not matter).

By a result in symmetric group, there is a unique element with maximal length (length of the reduced word) in Sk (k is the length of A) such that mA,w(sorted(B))=mA,B, where sorted(B) is to sorted B such that it is weakly increasing, and the action of w=si1sim on a list L is defined by: sj(L) means exchanging the jth and j+1th elements of L.

There is a method to compute the longest word w by checking all elements in Sk. But it takes a long time when k is large. The following function works fine and returns correct result.

 def LongestPerm(A,Bsorted,B):
    k = len(A)
    S = set([(A[i],B[i]) for i in range(k)])
    W = WeylGroup('A'+str(k-1), prefix = 's')

    winner = W.one()
    for w in W:
        wstr = w.inverse().to_permutation_string()
        if set([(A[int(wstr[i])-1],Bsorted[i]) for i in range(k)]) == S:      
            if w.length()>winner.length():
                winner = w
    return winner

In the example that

A=[1, 1, 2, 3, 3, 4]
B=[12, 9, 10, 15, 15, 14]

we have $w=s4s5s4s2s1$.

Is there some method to compute w faster (without checking all elements of Sk)? Thank you very much.

Find the longest word in a symmetric group which satisfies a certain property.

Let A,B be two list of equal length k, where A is weakly increasing. For example, A=[1,1,2,3,3,4], B=[12,9,10,15,15,14].

Define mA,B to be the multiset of pairs [Ai,Bi], ik, (this is a multi-set of pairs of integers, not a list of pairs, so the order of pairs in mA,B does not matter).

By a result in symmetric group, there is a unique element with maximal length (length of the reduced word) in Sk (k is the length of A) such that mA,w(sorted(B))=mA,B, where sorted(B) is to sorted B such that it is weakly increasing, and the action of w=si1sim on a list L is defined by: sj(L) means exchanging the jth and j+1th elements of L.

There is a method to compute the longest word w by checking all elements in Sk. But it takes a long time when k is large. The following function works fine and returns correct result.

 def LongestPerm(A,Bsorted,B):
    k = len(A)
    S = set([(A[i],B[i]) for i in range(k)])
    W = WeylGroup('A'+str(k-1), prefix = 's')

    winner = W.one()
    for w in W:
        wstr = w.inverse().to_permutation_string()
        if set([(A[int(wstr[i])-1],Bsorted[i]) for i in range(k)]) == S:      
            if w.length()>winner.length():
                winner = w
    return winner

In the example that

A=[1, 1, 2, 3, 3, 4]
B=[12, 9, 10, 15, 15, 14]

we have $w=s4s5s4s2s1$.

w=s4*s5*s4*s2*s1

Is there some method to compute w faster (without checking all elements of Sk)? Thank you very much.

Find the longest word in a symmetric group which satisfies a certain property.

Let A,B be two list of equal length k, where A is weakly increasing. For example, A=[1,1,2,3,3,4], B=[12,9,10,15,15,14].

Define mA,B to be the multiset of pairs [Ai,Bi], ik, (this is a multi-set of pairs of integers, not a list of pairs, so the order of pairs in mA,B does not matter).

By a result in symmetric group, there is a unique element with maximal length (length of the reduced word) in Sk (k is the length of A) such that mA,w(sorted(B))=mA,B, where sorted(B) is to sorted B such that it is weakly increasing, and the action of w=si1sim on a list L is defined by: sj(L) means exchanging the jth and j+1th elements of L.L, and for w,wSk, ww(L)=w(w(L)).

There is a method to compute the longest word w by checking all elements in Sk. But it takes a long time when k is large. The following function works fine and returns correct result.

 def LongestPerm(A,Bsorted,B):
    k = len(A)
    S = set([(A[i],B[i]) for i in range(k)])
    W = WeylGroup('A'+str(k-1), prefix = 's')

    winner = W.one()
    for w in W:
        wstr = w.inverse().to_permutation_string()
        if set([(A[int(wstr[i])-1],Bsorted[i]) for i in range(k)]) == S:      
            if w.length()>winner.length():
                winner = w
    return winner

In the example that

A=[1, 1, 2, 3, 3, 4]
B=[12, 9, 10, 15, 15, 14]

we have

w=s4*s5*s4*s2*s1

Is there some method to compute w faster (without checking all elements of Sk)? Thank you very much.

Find the longest word in a symmetric group which satisfies a certain property.

Let A,B be two list of equal length k, where A is weakly increasing. For example, A=[1,1,2,3,3,4], B=[12,9,10,15,15,14].

Define mA,B to be the multiset of pairs [Ai,Bi], ik, (this is a multi-set of pairs of integers, not a list of pairs, so the order of pairs in mA,B does not matter).

By a result in symmetric group, there is a unique element with maximal length (length of the reduced word) in the symmetric group Sk (k is the length of A) such that mA,w(sorted(B))=mA,B, where sorted(B) is to sorted B such that it is weakly increasing, and the action of w=si1sim on a list L is defined by: sj(L) means exchanging the jth and j+1th elements of L, and for w,wSk, ww(L)=w(w(L)).

There is a method to compute the longest word w by checking all elements in Sk. But it takes a long time when k is large. The following function works fine and returns correct result.

 def LongestPerm(A,Bsorted,B):
    k = len(A)
    S = set([(A[i],B[i]) for i in range(k)])
    W = WeylGroup('A'+str(k-1), prefix = 's')

    winner = W.one()
    for w in W:
        wstr = w.inverse().to_permutation_string()
        if set([(A[int(wstr[i])-1],Bsorted[i]) for i in range(k)]) == S:      
            if w.length()>winner.length():
                winner = w
    return winner

In the example that

A=[1, 1, 2, 3, 3, 4]
B=[12, 9, 10, 15, 15, 14]

we have

w=s4*s5*s4*s2*s1

Is there some method to compute w faster (without checking all elements of Sk)? Thank you very much.