[GAP Forum] Question

Max Neunhoeffer neunhoef at mcs.st-and.ac.uk
Mon Jul 19 09:34:42 BST 2010


Dear Lisette,

if you want to save typing, simply define a function making the group:

MyCycGrp := function(n)
 return Group(PermList(Concatenation([2..n],[1])));
end;

(this can simply be typed in or saved in a file and read with the
"Read" command).

Then a simple

gap> MyCycGrp(100);
<permutation group with 1 generators>
gap> Size(last);
100

does the job.

I hope this helps.

Cheers,
  Max.

On Mon, Jul 19, 2010 at 10:27:11AM +0200, Lisette Brillemans wrote:
> Dear Dan, dear Forum,
> 
> Thank you for your reply.
> This does it indeed. But:
> 
> gap> G := Group(PermList(List([1..10], i->(i mod 10)+1));
> 
> is a very long and complicated line. Furthermore, what does NOT work (of
> course...) is:
> 
> gap> G := SymmetricGroup(PermList(List([1..10], i->(i mod 10)+1));
> 
> So I would like to ask the forum again: Is it possible to do something
> like (and how??):
> 
> gap> G:=Group([1..10]);
> gap? G:=SymmetricGroup([1..10]);
> 
> etc.
> (and especially with 100 instead of 10 and so.)
> 
> 
> with regards,
> 
> Lisette
> 
> 
> > Dear Lisette, Dear Forum,
> > 
> > On Mon, Jul 19, 2010 at 8:57 AM, Alexander Hulpke <ahulpke at gmail.com>
> > wrote:
> >         Dear GAP Forum,
> >         
> >         On Jul 18, 2010, at 3:15 PM, Lisette Brillemans wrote:
> >         
> >         > Is there a command to enter a group like
> >         >
> >         > S:=Group((1,2,3,4,5,6,7,8,9,10)); at once.
> >         >
> >         > For instance a command like:
> >         >
> >         > S:=Group([1..10]) or so?
> >         
> >         If you just want a cyclic group you can use
> >         CyclicGroup(IsPermGroup,10);
> >  
> > Alternatively, you could use "List" to construct a list describing the
> > permutation you are interested in:
> >         gap> x := List([1..10], i->(i mod 10)+1);     
> >         [ 2, 3, 4, 5, 6, 7, 8, 9, 10, 1 ]
> > (this list means that 1 goes to x[1]=2, 2 goes to x[2] = 3, etc. Then
> > use PermList to turn it into a permutation:
> >         gap> PermList(x);                          
> >         (1,2,3,4,5,6,7,8,9,10)
> > see http://www.gap-system.org/Manuals/doc/htm/ref/CHAP040.htm#SECT004 for the documentation for PermList. We then use Group to construct the group generated by that permutation:
> >         gap> G := Group(PermList(x));
> >         Group([ (1,2,3,4,5,6,7,8,9,10) ])
> >         gap> Size(G);
> >         10
> > 
> > 
> > Hope this helps.
> > 
> > 
> > Kind regards,
> > Dan 
> > 
> 
> 
> 
> _______________________________________________
> Forum mailing list
> Forum at mail.gap-system.org
> http://mail.gap-system.org/mailman/listinfo/forum

-- 
Max Neunhoeffer              http://www-groups.mcs.st-and.ac.uk/~neunhoef/
> > > > > > > > > > >  May the Source be with you! < < < < < < < < < < < < 
The University of St Andrews is a registered Scottish charity: No SC013532




More information about the Forum mailing list