Encoding of symmetric groups
Template:Particular IAPS encoding
The symmetric groups can be encoded in two main ways, namely:
- Using the cycle decomposition of permutations
- Using the one-line notation for permutations
Encoding using the one-line notation
We describe the encoding over a three-letter alphabet, with two of the letters functioning as bits (0 and 1) and the third letter serving as a comma, or a separator.
Encoding a group element
Let be a permutation on the set of elements from 1 to . We encode as follows.
- From left to right, first write in binary. Then put the comma separator.
- Now write in binary. Again, put the comma separator.
- Keep going on like this till you reach . Put a comma separator after that.
Maximum length of a code-word
Since each is not more than , its length in binary is not more than . There are also separators. Thus, the total length of a code-word is not more than .
This is proportional to the logarithm of . Thus the encoding is dense,
Algorithms for inverting and multiplying
Given the codes for permutations and , we can compute the code for as follows. We first compute by looking at , and then locating of that by counting the relevant number of commas. We then compute .
In this process, the tape head for moves linearly (that is, it moves from left to right) while that for has to keep moving back and forth. Also, the writing tape keeps moving from left to right. So on the whole, the algorithm takes quadratic time in the length of the maximum code-word.
Similarly, the algorithm to compute the inverse of an element takes quadratic time in the length of the maximum code-word.
Algorithm for block concatenation
Given the code for and , we want to compute the permutation in whose action on the first elements is like and whose action on the next elements is like . To do this, we proceed as follows. To each of the numbers (between the commas) in the one-line notation of , we add (addition of binary numbers). We now concatenate this altered to the right of .
Combining all these, we find that the one-line notation gives a polynomial-time encoding. This, along with the fact that it is dense, tells us that the one-line notationi s a log-size encoding.