Is there a theorem that a set of binary swaps can affect any permutation?

Click For Summary

Discussion Overview

The discussion revolves around whether a set of binary swaps can generate any permutation of a sequence. Participants explore the relationship between binary swaps, permutations, and algorithms like quicksort, as well as the mathematical foundations underlying these concepts.

Discussion Character

  • Exploratory, Technical explanation, Debate/contested, Mathematical reasoning

Main Points Raised

  • Some participants assert that there is a theorem stating "the symmetric group is generated by transpositions," which implies that binary swaps can result in any permutation.
  • One participant connects the theorem to the quicksort algorithm, suggesting that since quicksort uses binary swaps to sort any permutation, it indirectly supports the theorem.
  • Another participant questions how to prove that quicksort sorts a list correctly, implying that the theorem might be necessary for such a proof.
  • A participant proposes a method involving elementary swap matrices and Gauss-Jordan reduction to demonstrate that any permutation can be achieved through binary swaps.
  • Some participants emphasize that the theorem specifically applies to adjacent binary swaps, clarifying the scope of the theorem.
  • One participant describes a straightforward method for rearranging numbers into standard order using transpositions, indicating a practical approach to the problem.

Areas of Agreement / Disagreement

There is some agreement on the existence of a theorem related to binary swaps and permutations, but the discussion includes varying interpretations and applications of this theorem, particularly in relation to algorithms like quicksort. The discussion remains unresolved regarding the necessity of the theorem for proving the correctness of quicksort.

Contextual Notes

Participants express varying levels of familiarity with abstract algebra terminology, indicating potential limitations in understanding the theorem's implications without such language.

swampwiz
Messages
567
Reaction score
83
Is there a theorem that states that a set of binary swaps can result in any permutation?

For example, the original set (1,2,3,4,5) can have the swap (24) and result in (1,4,3,2,5). is there a set of specific swaps for each net result permutation?
 
Physics news on Phys.org
I was just thinking. Since the quicksort algorithm only does binary swaps, and can sort any initial permutation order - and thus could be run in reverse to get to any permutation from the sorted set - doesn't this also prove this theorem?
 
I guess the question is how do you prove quicksort actually sorts the list at the end? I think you need this theorem to prove it, or at least to substantially prove this theorem as part of your proof of the algorithms correctness
.
 
I wonder if anyone has done a YouTube video that does this proof without requiring a lot of abstract algebra terminology.
 
OK, I think I've got this. Given a vector of indices, a binary swap can be accomplished by concatenating it with an elementary swap matrix. Since the Gauss-Jordan reduction algorithm can decompose any matrix into a set of elementary matrices, and a permutation matrix is composed only of such elementary swap matrices, and as well because the determinant of an elementary swap matrix is -1, its inverse exists. Thus, the identity matrix can have a set of concatenations of swap matrices to get to any possible permutation.
 
swampwiz said:
Is there a theorem that states that a set of binary swaps can result in any permutation?
Math_QED said:
Yes, there is such a theorem. This is worded as: "The symmetric group is generated by transpositions"

Note that this overdoes it - it proves that a set of adjacent binary swaps can result in any permutation.
 
  • Like
Likes   Reactions: swampwiz, sysprog and member 587159
This fact is much easier than it seems like you think it is. If I have the numbers 1,...,n in some order and I want to rearrange them into the standard order, then I first make a transposition to put ##1## in the first spot and leave it alone thereafter. Then I make a transposition to put ##2## into the second spot, etc.
 
  • Like
Likes   Reactions: swampwiz
Infrared said:
This fact is much easier than it seems like you think it is. If I have the numbers 1,...,n in some order and I want to rearrange them into the standard order, then I first make a transposition to put ##1## in the first spot and leave it alone thereafter. Then I make a transposition to put ##2## into the second spot, etc.
Yes, that is the idea I was getting at in a subsequent post.
 

Similar threads

  • · Replies 4 ·
Replies
4
Views
2K
  • · Replies 2 ·
Replies
2
Views
3K
  • · Replies 10 ·
Replies
10
Views
2K
  • · Replies 15 ·
Replies
15
Views
5K
  • · Replies 6 ·
Replies
6
Views
2K
  • · Replies 32 ·
2
Replies
32
Views
7K
  • · Replies 5 ·
Replies
5
Views
3K
  • · Replies 2 ·
Replies
2
Views
2K
  • · Replies 26 ·
Replies
26
Views
2K
  • · Replies 18 ·
Replies
18
Views
4K