PREP - Professional Enhancement Programs of the MAA


Abstract Algebra with GAP

A PREP Workshop

GAP log - Wednesday July 16, 2:30 pm - 4:00 pm

gap> x:= 6;
6
gap> x;
6
gap> x:= 8;
8
gap> x;
8
gap> j:= [];
[  ]
gap> Append(j,2);
AppendList: <list2> must be a list (not a integer)
not in any function
Entering break read-eval-print loop ...
you can 'quit;' to quit to outer loop, or
you can replace <list2> via 'return <list2>;' to continue
brk> gap> Append(j,[2]);
gap> j;
[ 2 ]
gap> R:=Integers mod 15;
(Integers mod 15)
gap> e:=Elements(R);
[ ZmodnZObj( 0, 15 ), ZmodnZObj( 1, 15 ), ZmodnZObj( 2, 15 ), ZmodnZObj( 3, 15 ), ZmodnZObj( 4, 15 ), ZmodnZObj( 5, 15 ), 
  ZmodnZObj( 6, 15 ), ZmodnZObj( 7, 15 ), ZmodnZObj( 8, 15 ), ZmodnZObj( 9, 15 ), ZmodnZObj( 10, 15 ), ZmodnZObj( 11, 15 ), 
  ZmodnZObj( 12, 15 ), ZmodnZObj( 13, 15 ), ZmodnZObj( 14, 15 ) ]
gap> h:= x-> x^0;
function( x ) ... end
gap> f:=MappingByFunction(R,R,h);
MappingByFunction( (Integers mod 15), (Integers mod 15), function( x ) ... end )
gap> IsRingHomomorphism(f);
false
gap> h:= x-> x^1;
function( x ) ... end
gap> f:=MappingByFunction(R,R,h);
MappingByFunction( (Integers mod 15), (Integers mod 15), function( x ) ... end )
gap> IsRingHomomorphism(f);
true
gap> h:= x-> x^2;
function( x ) ... end
gap> f:=MappingByFunction(R,R,h);
MappingByFunction( (Integers mod 15), (Integers mod 15), function( x ) ... end )
gap> IsRingHomomorphism(f);
false
gap> h:= x-> x^3;
function( x ) ... end
gap> f:=MappingByFunction(R,R,h);
MappingByFunction( (Integers mod 15), (Integers mod 15), function( x ) ... end )
gap> IsRingHomomorphism(f);
false
gap> h:= x-> x^4;
function( x ) ... end
gap> f:=MappingByFunction(R,R,h);
MappingByFunction( (Integers mod 15), (Integers mod 15), function( x ) ... end )
gap> IsRingHomomorphism(f);
false
gap> h:= x-> x^5;
function( x ) ... end
gap> f:=MappingByFunction(R,R,h);
MappingByFunction( (Integers mod 15), (Integers mod 15), function( x ) ... end )
gap> IsRingHomomorphism(f);
true
gap> h:= x-> x^6;
function( x ) ... end
gap> f:=MappingByFunction(R,R,h);
MappingByFunction( (Integers mod 15), (Integers mod 15), function( x ) ... end )
gap> IsRingHomomorphism(f);
false
gap> h:= x-> x^7;
function( x ) ... end
gap> f:=MappingByFunction(R,R,h);
MappingByFunction( (Integers mod 15), (Integers mod 15), function( x ) ... end )
gap> IsRingHomomorphism(f);
false
gap> h:= x-> x^8;
function( x ) ... end
gap> f:=MappingByFunction(R,R,h);
MappingByFunction( (Integers mod 15), (Integers mod 15), function( x ) ... end )
gap> IsRingHomomorphism(f);
false
gap> h:= x-> x^9;
function( x ) ... end
gap> f:=MappingByFunction(R,R,h);
MappingByFunction( (Integers mod 15), (Integers mod 15), function( x ) ... end )
gap> IsRingHomomorphism(f);
true
gap> h:= x-> x^10;
function( x ) ... end
gap> f:=MappingByFunction(R,R,h);
MappingByFunction( (Integers mod 15), (Integers mod 15), function( x ) ... end )
gap> IsRingHomomorphism(f);
false
gap> h:= x-> x^11;
function( x ) ... end
gap> f:=MappingByFunction(R,R,h);
MappingByFunction( (Integers mod 15), (Integers mod 15), function( x ) ... end )
gap> IsRingHomomorphism(f);
false
gap> h:= x-> x^12;
function( x ) ... end
gap> f:=MappingByFunction(R,R,h);
MappingByFunction( (Integers mod 15), (Integers mod 15), function( x ) ... end )
gap> IsRingHomomorphism(f);
false
gap> h:= x-> x^13;
function( x ) ... end
gap> f:=MappingByFunction(R,R,h);
MappingByFunction( (Integers mod 15), (Integers mod 15), function( x ) ... end )
gap> IsRingHomomorphism(f);
true
gap> h:= x-> x^14;
function( x ) ... end
gap> f:=MappingByFunction(R,R,h);
MappingByFunction( (Integers mod 15), (Integers mod 15), function( x ) ... end )
gap> IsRingHomomorphism(f);
false
gap> h:= x-> x^15;
function( x ) ... end
gap> f:=MappingByFunction(R,R,h);
MappingByFunction( (Integers mod 15), (Integers mod 15), function( x ) ... end )
gap> IsRingHomomorphism(f);
false
gap> List(Elements(R),x->x^5);
[ ZmodnZObj( 0, 15 ), ZmodnZObj( 1, 15 ), ZmodnZObj( 2, 15 ), ZmodnZObj( 3, 15 ), ZmodnZObj( 4, 15 ), ZmodnZObj( 5, 15 ), 
  ZmodnZObj( 6, 15 ), ZmodnZObj( 7, 15 ), ZmodnZObj( 8, 15 ), ZmodnZObj( 9, 15 ), ZmodnZObj( 10, 15 ), ZmodnZObj( 11, 15 ), 
  ZmodnZObj( 12, 15 ), ZmodnZObj( 13, 15 ), ZmodnZObj( 14, 15 ) ]
gap> List(Elements(R),x->x^9);
[ ZmodnZObj( 0, 15 ), ZmodnZObj( 1, 15 ), ZmodnZObj( 2, 15 ), ZmodnZObj( 3, 15 ), ZmodnZObj( 4, 15 ), ZmodnZObj( 5, 15 ), 
  ZmodnZObj( 6, 15 ), ZmodnZObj( 7, 15 ), ZmodnZObj( 8, 15 ), ZmodnZObj( 9, 15 ), ZmodnZObj( 10, 15 ), ZmodnZObj( 11, 15 ), 
  ZmodnZObj( 12, 15 ), ZmodnZObj( 13, 15 ), ZmodnZObj( 14, 15 ) ]
gap> List(Elements(R),x->x^13);
[ ZmodnZObj( 0, 15 ), ZmodnZObj( 1, 15 ), ZmodnZObj( 2, 15 ), ZmodnZObj( 3, 15 ), ZmodnZObj( 4, 15 ), ZmodnZObj( 5, 15 ), 
  ZmodnZObj( 6, 15 ), ZmodnZObj( 7, 15 ), ZmodnZObj( 8, 15 ), ZmodnZObj( 9, 15 ), ZmodnZObj( 10, 15 ), ZmodnZObj( 11, 15 ), 
  ZmodnZObj( 12, 15 ), ZmodnZObj( 13, 15 ), ZmodnZObj( 14, 15 ) ]
gap> List(Elements(R),x->x^4);
[ ZmodnZObj( 0, 15 ), ZmodnZObj( 1, 15 ), ZmodnZObj( 1, 15 ), ZmodnZObj( 6, 15 ), ZmodnZObj( 1, 15 ), ZmodnZObj( 10, 15 ), 
  ZmodnZObj( 6, 15 ), ZmodnZObj( 1, 15 ), ZmodnZObj( 1, 15 ), ZmodnZObj( 6, 15 ), ZmodnZObj( 10, 15 ), ZmodnZObj( 1, 15 ), 
  ZmodnZObj( 6, 15 ), ZmodnZObj( 1, 15 ), ZmodnZObj( 1, 15 ) ]
gap> S:=Integers mod 25;
(Integers mod 25)
gap> e2:=Elements(S);
[ ZmodnZObj( 0, 25 ), ZmodnZObj( 1, 25 ), ZmodnZObj( 2, 25 ), ZmodnZObj( 3, 25 ), ZmodnZObj( 4, 25 ), ZmodnZObj( 5, 25 ), 
  ZmodnZObj( 6, 25 ), ZmodnZObj( 7, 25 ), ZmodnZObj( 8, 25 ), ZmodnZObj( 9, 25 ), ZmodnZObj( 10, 25 ), ZmodnZObj( 11, 25 ), 
  ZmodnZObj( 12, 25 ), ZmodnZObj( 13, 25 ), ZmodnZObj( 14, 25 ), ZmodnZObj( 15, 25 ), ZmodnZObj( 16, 25 ), ZmodnZObj( 17, 25 ), 
  ZmodnZObj( 18, 25 ), ZmodnZObj( 19, 25 ), ZmodnZObj( 20, 25 ), ZmodnZObj( 21, 25 ), ZmodnZObj( 22, 25 ), ZmodnZObj( 23, 25 ), 
  ZmodnZObj( 24, 25 ) ]
gap> h2:=function( x ) return( k*Int(x) mod n ); end;
Syntax error: warning: unbound global variable
h2:=function( x ) return( k*Int(x) mod n ); end;
                           ^
Syntax error: warning: unbound global variable
h2:=function( x ) return( k*Int(x) mod n ); end;
                                         ^
function( x ) ... end
gap> h2:=function( x ) return( 5*Int(x) mod 25 ); end;
function( x ) ... end
gap> f:=MappingByFunction(R,S,h2);
MappingByFunction( (Integers mod 15), (Integers mod 25), function( x ) ... end )
gap> IsRIngHomomorphism(f);
Variable: 'IsRIngHomomorphism' must have a value

gap> IsRingHomomorphism(f);
false
gap> h2:=function( x ) return( 10*Int(x) mod 25 ); end;
function( x ) ... end
gap> f:=MappingByFunction(R,S,h2);
MappingByFunction( (Integers mod 15), (Integers mod 25), function( x ) ... end )
gap> IsRingHomomorphism(f);
false
gap> h2:=function( x ) return( 10*Int(x) mod 25 ); end;
function( x ) ... end
gap> List([1..15],x->x^2);
[ 1, 4, 9, 16, 25, 36, 49, 64, 81, 100, 121, 144, 169, 196, 225 ]
gap> List([1..15],x->x^2 mod 15);
[ 1, 4, 9, 1, 10, 6, 4, 4, 6, 10, 1, 9, 4, 1, 0 ]
gap> h2:=function( x ) return( 6*Int(x) mod 25 ); end;
function( x ) ... end
gap> f:=MappingByFunction(R,S,h2);
MappingByFunction( (Integers mod 15), (Integers mod 25), function( x ) ... end )
gap> IsRingHomomorphism(f);
false
gap> h2:=function( x ) return( 0*Int(x) mod 25 ); end;
function( x ) ... end
gap> f:=MappingByFunction(R,S,h2);
MappingByFunction( (Integers mod 15), (Integers mod 25), function( x ) ... end )
gap> IsRingHomomorphism(f);
false
gap> g:= Group( [(1,2),(1,2,3)]);
Group([ (1,2), (1,2,3) ])
gap> KnownAttributesOfObject(g);
[ "LargestMovedPoint", "GeneratorsOfMagmaWithInverses", "MultiplicativeNeutralElement" ]
gap> HELP("GeneratorsOfMagmaWithInverses");
Help: Showing `Reference: GeneratorsOfMagmaWithInverses'
gap> Size(g);
6
gap> KnownAttributesOfObject(g);
[ "Size", "OneImmutable", "LargestMovedPoint", "NrMovedPoints", "MovedPoints", "GeneratorsOfMagmaWithInverses", 
  "MultiplicativeNeutralElement", "Pcgs", "GeneralizedPcgs", "StabChainMutable", "StabChainOptions" ]
gap> IsCyclic(g);
false
gap> g:= DihedralGroup(IsPermGroup ,16);
Group([ (1,2,3,4,5,6,7,8), (2,8)(3,7)(4,6) ])
gap> obj:= [g];
[ Group([ (1,2,3,4,5,6,7,8), (2,8)(3,7)(4,6) ]) ]
gap> code:= ApplicableMethod(IsCyclic, obj, 1);
#I  Searching Method for IsCyclic with 1 arguments:
#I  Total: 6 entries
#I  Method 4: ``IsCyclic: generic method for groups'', value: 19
function( G ) ... end
gap> Print(code);
function ( G )
    if HasGeneratorsOfGroup( G ) and Length( GeneratorsOfGroup( G ) ) = 1  then
        return true;
    elif not IsCommutative( G )  then
        return false;
    elif IsFinite( G )  then
        return ForAll( Set( FactorsInt( Size( G ) ) ), function ( p )
                return Index( G, SubgroupNC( G, List( GeneratorsOfGroup( G ), function ( g )
                              return g ^ p;
                          end ) ) ) = p;
            end );
    else
        return AbelianInvariants( G ) = [ 0 ];
    fi;
    return;
endgap> 
gap> R1:= Integers mod 7;
GF(7)
gap> P1:= PolynomialRing(R1);
PolynomialRing(..., [ x_1 ])
gap> x:= X(R1, "x");
x
gap> g:= x^2-2;
Z(7)^5+x^2
gap> Int(Z(7)^5);
5
gap> Factors(g);
[ Z(7)+x, Z(7)^4+x ]
gap> Int(Z(7)); Int(Z(7)^4);
3
4
gap> R2:= Integers mod 11;
GF(11)
gap> P2:= PolynomialRing(R2);
PolynomialRing(..., [ x_1 ])
gap> y:= X(R2, "y");
y
gap> h:= y^2-2;
Z(11)^6+y^2
gap> Factors(h);
[ Z(11)^6+y^2 ]
gap> R:= Rationals;
Rationals
gap> z:= X(R, "z");
z
gap> z^2 - 1;
-1+z^2
gap> f:= z^2 - 1;
-1+z^2
gap> Factors(f);
[ -1+z, 1+z ]
gap> IsIrreducible(f);
false
gap> R1:= Integers mod 3;
GF(3)
gap> R2:= Integers mod 5;
GF(5)
gap> R3:= Integers mod 7;
GF(7)
gap> R4:= Integers mod 11;
GF(11)
gap> x:= X(R1, "x");
x
gap> y:= X(R1, "y");
y
gap> x:= X(R1, "y");
y
gap> x:= X(R1, "x");
x
gap> y:= X(R2, "y");
y
gap> z:= X(R3, "z");
z
gap> z:= X(R4
> 
> , "w");
w
gap> w:= X(R4, "w");
w
gap> z:= X(R3, "z");
z
gap> Factors(x^2-1);
[ Z(3)^0+x, -Z(3)^0+x ]
gap> Factors(y^4-1);
[ Z(5)^0+y, Z(5)+y, -Z(5)^0+y, Z(5)^3+y ]
gap> Factors(z^6-1);
[ Z(7)^0+z, Z(7)+z, Z(7)^2+z, -Z(7)^0+z, Z(7)^4+z, Z(7)^5+z ]
gap> Factors(w^10-1);
[ Z(11)^0+w, Z(11)+w, Z(11)^2+w, Z(11)^3+w, Z(11)^4+w, -Z(11)^0+w, Z(11)^6+w, Z(11)^7+w, Z(11)^8+w, Z(11)^9+w ]
gap> IsIrreducible(x^3+ (2*x^2) +1);
true
gap> R:= Rationals;
Rationals
gap> z:= X(R, "z");
z
gap> IsIrreducible(z^3+ (2*z^2) +1);
true
gap> IsIrreducible(x^4+x^3+x^2+1);
true
gap> IsIrreducible(z^4+z^3+z^2+1);
true
gap> Factors(z^6-1);
[ -1+z, 1+z, 1-z+z^2, 1+z+z^2 ]
gap> Factors(z^8-1);
[ -1+z, 1+z, 1+z^2, 1+z^4 ]
gap> Factors(z^20-1);
[ -1+z, 1+z, 1+z^2, 1-z+z^2-z^3+z^4, 1+z+z^2+z^3+z^4, 1-z^2+z^4-z^6+z^8 ]
gap> Factors(z^40-1);
[ -1+z, 1+z, 1+z^2, 1-z+z^2-z^3+z^4, 1+z^4, 1+z+z^2+z^3+z^4, 1-z^2+z^4-z^6+z^8, 1-z^4+z^8-z^12+z^16 ]
gap> Factors(z^60-1);
[ -1+z, 1+z, 1-z+z^2, 1+z^2, 1+z+z^2, 1-z+z^2-z^3+z^4, 1-z^2+z^4, 1+z+z^2+z^3+z^4, 1-z+z^3-z^4+z^5-z^7+z^8, 1-z^2+z^4-z^6+z^8, 
  1+z-z^3-z^4-z^5+z^7+z^8, 1+z^2-z^6-z^8-z^10+z^14+z^16 ]
gap> Factors(z^105-1);
[ -1+z, 1+z+z^2, 1+z+z^2+z^3+z^4, 1+z+z^2+z^3+z^4+z^5+z^6, 1-z+z^3-z^4+z^5-z^7+z^8, 1-z+z^3-z^4+z^6-z^8+z^9-z^11+z^12, 
  1-z+z^5-z^6+z^7-z^8+z^10-z^11+z^12-z^13+z^14-z^16+z^17-z^18+z^19-z^23+z^24, 1+z+z^2-z^5-z^6-2*z^7-z^8-z^9+z^12+z^13+z^14+z^15+z^16+z^
    17-z^20-z^22-z^24-z^26-z^28+z^31+z^32+z^33+z^34+z^35+z^36-z^39-z^40-2*z^41-z^42-z^43+z^46+z^47+z^48 ]
gap> LogTo();
Back to Home Page
 
 

This PREP workshop is made possible by the NSF grant DUE: 0089005