How we can write a command in GAP for those permutations that are fixed, For instance: if we have x:=(3,4)(5,7)(6.8)(9,12)(10,13)(11,14); here 1 and 2 are fixed Moreover, if these point lies in other permutation i.e t:=(1,2)(5,6)(7,8)(9,12),10,11)(13,14);
Here point 1 and 2 are fixed in x and lies in t permutations.
I want GAP to examine these points by itself. How can we do it?
I am writing this programe like this
For i in x and i->i do
if i in t then
Print(i);
fi;
od;
but it does'nt work. Can anyone assist me?
Here is some code that does what you ask. It first defines a function to handle this problem in general, and then calls it for your specific
XandT. It returns the answer as a list, since lists are easier to work with later (just printing the answers is fine, but what if you want to do something with them later? It is nice if they are stored somewhere). I include links to the reference manual in the following code:If
iis a positive integer andXis a permutation, theni^Xmeans the evaluation ofXat the pointi. Soi = i^Xmeansiis a fixed point ofX. Yes, if you type this into gap it defines a function. The beginning of the function is marked byfunction, the value of the function is marked byreturnand the end of the function is marked byend.The tutorial on functions at the gap website, gap-system.org is pretty clear.