# Functions for "Using Schreier Elements to Compute the Order of a Group" ORBIT := function(S, x) # Input: S : A set of generators for a finite group G, a # subgroup of the symmetric group on {1,2,...,n}. # x : An element of {1,2,...,n}. # Output: Y : The orbit of x under G. local Y, y, s; Y := [x]; for y in Y do for s in S do if not y^s in Y then Add(Y, y^s); fi; od; od; return Y; end; STABILIZER := function(S, x) # Input: S : A set of generators for a finite group G, a # subgroup of the symmetric group on {1,2,...,n}. # x : An element of {1,2,...,n}. # Output: Sx : A set of generators for the stabilizer of # x under G. local Y, Sx, y, T, s, P; Y := [x]; T := []; # T is defined to be a list with no elements. T[x] := (); Sx := []; for y in Y do for s in S do if not y^s in Y then T[y^s] := T[y]*s; Add(Y, y^s); fi; P :=T[y]*s*T[y^s]^(-1); if not P in Sx then Add(Sx, P); fi; od; od; return Sx; end;