A repository to introduce GAP system for beginners.
universe := 6*7;
m:=[[1,2,3],[4,5,6],[7,8,9]];
ColorPrompt(true);
LogTo("gap-intro.log");
Display(m);
> Factorial(100);
93326215443944152681699238856266700490715968264381621468\
59296389521759999322991560894146397615651828625369792082\
7223758251185210916864000000000000000000000000
> Determinant(m);
0
> Factors(2^64-1);
[ 3, 5, 17, 257, 641, 65537, 6700417 ]
> Filtered( [2,9,6,3,4,5], IsEvenInt);
[ 2, 6, 4 ]
> Fibonacci(100);
354224848179261915075
> a:=(1,2,3);;b:=(2,3,4);;
> # Next, let G be a group generated by a and b:
> G:=Group(a,b);
Group([ (1,2,3), (2,3,4) ])
> a:=(1,2,3);;b:=(2,3,4);;
> G:=Group(a,b);
> Size(G);
12
> a:=(1,2,3);;b:=(2,3,4);;
> G:=Group(a,b);
> IsAbelian(G);
false
> a:=(1,2,3);;b:=(2,3,4);;
> G:=Group(a,b);
> StructureDescription(G);
"A4"
> a:=(1,2,3);;b:=(2,3,4);;
> Order(a);
3
> a:=(1,2,3);;b:=(2,3,4);;
> G:=Group(a,b);
> AsList(G);
[ (), (2,3,4), (2,4,3), (1,2)(3,4), (1,2,3), (1,2,4), (1,3,2), (1,3,4),
(1,3)(2,4), (1,4,2), (1,4,3), (1,4)(2,3) ]
> a:=(1,2,3);;b:=(2,3,4);;
> G:=Group(a,b);
> AsList(G);
> elts:=last;
[ (), (2,3,4), (2,4,3), (1,2)(3,4), (1,2,3), (1,2,4), (1,3,2), (1,3,4),
(1,3)(2,4), (1,4,2), (1,4,3), (1,4)(2,3) ]
> a:=(1,2,3);;b:=(2,3,4);;
> G:=Group(a,b);
> AsList(G);
> elts:=last;
[ (), (2,3,4), (2,4,3), (1,2)(3,4), (1,2,3), (1,2,4), (1,3,2), (1,3,4),
(1,3)(2,4), (1,4,2), (1,4,3), (1,4)(2,3) ]
> Length(elts);
12
> a:=(1,2,3);;b:=(2,3,4);;
> G:=Group(a,b);
> AsList(G);
> elts:=last;
> elts[1];
()
> elts[3];
(2,4,3)
> IsSet([1,3,5]);
> IsSet([1,5,3]);
> IsSet([1,3,3]);
true
false
false
> a:=(1,2,3);;b:=(2,3,4);;
> G:=Group(a,b);
> Order(g);
> a:=(1,2,3);;b:=(2,3,4);;
> G:=Group(a,b);
> s:=0;;
> for g in elts do
> s := s + Order(g);
> od;
> s/Length(elts);
31/12
> s:=0;;
> for g in G do
> s := s + Order(g);
> od;
> s/Size(G);
31/12
> s:=0;;
> for i in [ 1 .. Length(elts) ] do
> s := s + Order( elts[i] );
> od;
> s/Length(elts);
31/12
> Sum( List( elts, Order ) ) / Length( elts );
31/12
> Filtered( elts, g -> NrMovedPoints(g) = 4 );
[ (1,2)(3,4), (1,3)(2,4), (1,4)(2,3) ]
> First( elts, g -> (1,2)^g = (2,3) );
(1,2,3)
> (1,2,3)^-1*(1,2)*(1,2,3)=(2,3);
true
> ForAll( elts, g -> 1^g <> 2 );
false
> ForAny( elts, g -> NrMovedPoints(g) = 2 );
false
> 1.15;
> Float(1232/3456567);
1.15
0.000356423
> E(4); E(4)^2; E(6);
> E(4)
> -1
> -E(3)^2
> AsList(GF(2)); Z(5); Z(5)^4;
[ 0*Z(2), Z(2)^0 ]
Z(5)
Z(5)^0
> w:="supercalifragilisticexpialidocious";
"supercalifragilisticexpialidocious"
> Length(w);
34
> w:="supercalifragilisticexpialidocious";
> Length(w);
34
> SortedList(w);
"aaacccdeefgiiiiiiillloopprrssstuux"
> w;
"supercalifragilisticexpialidocious"
My nickname is Max, Programming language developer, Full-stack programmer. I love computer scientists, researchers, and compilers. (Max Base)
A team includes some programmer, developer, designer, researcher(s) especially Max Base.