11.07.2015 Views

Advanced Programming Guide

Advanced Programming Guide

Advanced Programming Guide

SHOW MORE
SHOW LESS
  • No tags were found...

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

138 • Chapter 3: <strong>Programming</strong> with Modules> return Symmetric( n )> end if;> a := [ $ 2 .. n, 1 ];> b := [ 1, op( lreverse( [ $ 2 .. n ] ) ) ];> D := PermutationGroup( n, { a, b } );> D:-order := () -> 2*n;> eval( D, 1 )> end proc:Exercises1. Use the fact that the alternating group A n of degree n >= 3 isgenerated by the set {(123), (234), (345), . . . , (n − 2, n − 1, n)} of 3-cycles to write a constructor Alternating for this class of groups.Dimino’s Algorithm Dimino’s algorithm is used to compute a completeenumeration of the elements of a finite group, given a generating set forthe group. Suppose that you are given a generating set {g 1 , g 2 , . . . , g n } fora finite group G. The idea behind Dimino’s algorithm is to enumerate,successively, the elements of each of the subgroupsof G, which form a chainG k = 〈g 1 , g 2 , . . . , g k 〉〈g 1 〉 = G 1 ≤ G 2 ≤ · · · ≤ G k ≤ · · · ≤ G n = G.These elements can be enumerated by forming products of the generatorsg 1 , g 2 , . . . , g n in all possible ways, until all the elements of G have beenfound. Dimino’s algorithm does this in a careful way, avoiding unnecessaryproduct computations.Use the following utility routine to determine the entries assigned toa table. It can be used when you are certain no entry is a non-NULL expressionsequence. Since it is sufficiently simple, it is defined with optioninline;.> Entries := proc( T )> description "return a set of simple table entries";> option inline;> map( op, { entries( T ) } )> end proc:Here is the code for Dimino’s algorithm.> Dimino := proc( G::Group )> description "enumerate the elements of a finite group";> local s, g, ord, elements, i, j, prev_ord, rep_pos,

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!