GAP Instructional Material

Return to Index


GAP code is shown like this.

[Press ?? to see GAP output]

You can also choose to see a page showing ALL GAP output.


Group theory

The theory

The GAP command Order(G) will find the order of the group G and Elements(G) will find the elements of G and put them in a list.

To apply a function to the list called examplelist we use List(examplelist, function).

To sort the list examplelist enter Sort(examplelist) and the list examplelist is sorted into ascending order.

Length(examplelist) will return the number of elements in the list.

For example, defining G to be the cyclic group of order 12 we have:

G:=CyclicGroup(12);      ??
Order(G);      ??
els:= Elements(G);      ??
listords:=List(els,Order);      ??
Sort(listords);
listords;      ??

If we wanted to see all the different orders of elements we could convert listords into a set using

Set(listords);      ??

or we could use the GAP function Collected which gives a list of the elements of the set together with how often each occurs in the list.

Collected(listords);     ??

The questions

  1. Orders of elements of symmetric and alternating groups.
    Define G to be the symmetric group of degree 3.

    G:=SymmetricGroup(3);      ??

    Use GAP, as indicated above, to find the orders of the elements.
    Do the same for the symmetric group of degree 4 and the one of degree 5.
    Now do the same for the alternating groups of degrees 3, 4, and 5.

    G:=AlternatingGroup(3);      ??

  2. Identifying groups of orders 8 and 12.
    In GAP the dihedral group D4 of order 8 is called DihedralGroup(8) so entering

    D4:=DihedralGroup(8);      ??

    into GAP will assign this dihedral group to D4.
    Find the orders of the elements of D4.

    Now the command

    GG:=AllSmallGroups(Size,8);      ??

    will return a list GG of all the groups of order 8.
    Use Length(GG) to find how many groups of order 8 there are.
    The groups are now GG[1], GG[2], ...

    To find if GG[1] is abelian, type

    IsAbelian(GG[1])      ??

    To check if it is cyclic, type

    IsCyclic(GG[1]);      ??

    Find the orders of the elements of each of the groups in the list GG and hence identify which of the groups in the list is D4.

    Investigate groups of order 12 in the same way. Identify the dihedral group of order 12:

    DihedralGroup(12);      ??

    and the alternating group of degree 4:

    AlternatingGroup(4);      ??

    in the list of groups of order 12 by looking at the orders of their elements.

  3. Groups of order p2
    Examine how many groups of order 52 = 25 there are and whether they are abelian or cyclic.

    p:=5;;
    GG:=AllSmallGroups(Size,p^2);
         ??
    List(GG,IsAbelian);      ??
    List(GG,IsCyclic);      ??

    Do the same for other squares of primes 72 = 49, 112 = 121, 132 = 169, ...
    Can you guess a general result?

  4. Groups of order 2p, p > 2
    This question is similar to the previous one but here you are asked to examine groups of order 2p where p is a prime.

    p:=5;;
    GG:=AllSmallGroups(Size,2*p);
         ??
    List(GG,IsAbelian);      ??

  5. Groups of order 3p, p > 3
    The general theorem for groups of order 3p is more complicated than that for groups of order 2p. Try the following for different values of the prime p and try to guess the theorem.

    p:=11;;
    GG:=AllSmallGroups(Size,3*p);
         ??
    List(GG,IsAbelian);      ??

  6. Prime residues mod n
    The set of integers less than n and coprime to n forms a group. The aim of this question is to try to decide when this group is cyclic. The following puts the integers less than n and coprime to n into a list U (we give an example of n = 18).

    n:=18;;
    U:=Units(ZmodnZ(n));
         ??

    How many elements are there in the group?

    Size(U);      ??

    Here is how to list the orders of these elements.

    List(U,Order);      ??

    Since there is an element of order equal to the number of elements in U then U is a cyclic group.

    GAP can verify this

    IsCyclic(U);      ??

    Is the group cyclic for n = 12 ?

    Try other values of n and guess for which values of n the set of integers less than n and coprime to n forms a cyclic group.
    GAP can save you some time, either by writing a loop, or using its list-handling capacity.

    Filtered([1..40],n->IsCyclic(Units(ZmodnZ(n))));      ??

    Filtered([1..40],n->not IsCyclic(Units(ZmodnZ(n))));      ??

    If that doesn't give you enough evidence to guess what is happening, look at even more values -- and factorise!

    lis:=Filtered([1..400],n->IsCyclic(Units(ZmodnZ(n))));      ??

    List(lis,FactorsInt);      ??

    Now can you spot it?


JOC/EFR January 2003



Home   |   Members   |   Pre-prints   |   Library   |   Reports   |   Seminars   |   Conferences   |   Research   |   Publicity   |  Pictures   |   GAP   |   Webmail