Chapter1.mws
Abstract Algebra with Maple
Chapter 1: Preliminaries
by
Alec Mihailovs
Preface
This manual is intended to be used with
Contemporary Abstract Algebra, by
J. A. Gallian, 5th ed., Houghton Mifflin (2002). It was inspired by
Abstract Algebra with GAP by
J. G. Rainbolt and
J. A. Gallian, Houghton Mifflin (2002). The latter manual is available for free downloading from the book's web site and from the authors` websites. I highly recommend, in addition to this Maple manual, solving exercises from both the textbook and the GAP manual.
1: Preliminaries
Properties of Integers
It is easy to factor integers in Maple:
>
ifactor(2^57-1);
The greatest common divisor and the least common multiple can be evaluated in Maple as follows:
>
igcd(715,1001);
>
ilcm(843,216,51);
The next example shows how to find integer solutions of equations:
>
isolve(7*x+15*y=1);
To find a particular solution, one can replace the unknown
by any integer value, for example, by 2:
>
subs(_Z1=2,%);
Modular Arithmetic
Maple can do modular arithmetic, too:
>
345 mod 7;
It can be used for checking the validity of money order numbers, UPS pickup record numbers, ISBN numbers etc.
>
isMoneyOrder:= n -> n<10^11 and trunc(n/10) mod 9 = n mod 10:
This function first checks if the number contains not more than 11 digits and then if the number formed by the first 10 digits is congruent to the last digit, i.e. check digit, modulo 9.
>
isMoneyOrder(39539881642);
>
isMoneyOrder(39559881642);
The similar construction works for air ticket numbers and UPS pickup records numbers, just by replacing modulo 9 to modulo 7:
>
isUPS:= n -> n<10^10 and trunc(n/10) mod 7 = n mod 10:
>
isUPS(7681139992);
>
isUPS(1213731473673);
>
isAirTicket:= n -> n<10^15 and trunc(n/10) mod 7 = n mod 10:
>
isAirTicket(1213731473673);
For the UPC code, one needs to use a dot product, so we have to load the Linear Algebra package first:
>
with(LinearAlgebra):
>
isUPC:= n -> evalb(Vector[row](12,convert(n,base,10)) . Vector([1,3,1,3,1,3,1,3,1,3,1,3]) mod 10 = 0):
>
isUPC(021000658978);
>
isUPC(012000658978);
A similar construction works for bank checks:
>
isBankCheck:= n -> evalb(Vector[row](9,convert(n,base,10)) . Vector([9,3,7,9,3,7,9,3,7]) mod 10 = 0):
>
isBankCheck(13);
For ISBN numbers we need a slightly more sophisticated method, because inputs can include the letter X:
>
isISBN:= proc(str) local s;
with(LinearAlgebra);
if type(str,integer) then s:=[str]; else
s:=sscanf(str,"%d%[Xx]") end if;
evalb(`if`(nops(s)=1,Vector[row](10,convert(s[1],base,10)),
`if`(nops(s)=2 and not s[2]="", Vector[row](10, [10,op(convert(s[1],base,10))]),Vector[row]([1,0$9]))) . Vector([$ 1..10]) mod 11 = 0) end:
>
isISBN(0618122141);
>
isISBN("618122141");
>
isISBN("6x");
As you can see, ISBN numbers without an X can be entered either as integers, or as strings, inside quotes. ISBN numbers with an X at the end must be entered inside quotes, because it is not one of the data formats that Maple recognizes.
Mathematical Induction
Maple can evaluate many sums:
>
sum(i,i=1..n);
>
simplify(%);
>
simplify(sum(i^10,i=1..n));
>
sort(%);
The answers can be proven by mathematical induction as follows:
>
f:=n->1/11*n^11+1/2*n^10+5/6*n^9-n^7+n^5-1/2*n^3+5/66*n:
>
f(1)=1 and simplify(f(n+1))=simplify(f(n)+(n+1)^10);
Also, Maple can find formulas for many polynomial sequences, for example, sums of squares, 1, 5, 14, 30, 55, ..., using interpolating polynomial
>
interp([$1..5],[1,5,14,30,55],x);
Since formula is known, Maple can easily continue the sequence:
>
f:=x->1/3*x^3+1/2*x^2+1/6*x:
for N from 6 to 10 do f(N) od;
>
>
Exercises
-
1
. Factor
.
-
2
. Find the greatest common divisor and the least common multiple of
,
,
, and
.
-
3
. Find integer solutions of the equation
.
-
4
. Find the last digit of the ISBN number starting from 1-894511-01.
-
5
. Find the formula for the sum of 9th powers of integers from 1 to
n
.
-
6
. Find the formula for the elements of the sequence 3, 17, 81, 255, 623, 1293, ... and find the next 4 elements of the sequence.