[GAP Forum] changing right- to left multiplication
Erik Postma
epostma at win.tue.nl
Tue Aug 29 13:53:38 BST 2006
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
> From: David Romano <romanod at math.grinnell.edu>
> Date: 25 August 2006 22:40:36 BDT
> To: forum at gap-system.org
> Subject: changing right- to left multiplication
>
>
> Hi,
>
> I'm very new to GAP, and am for now primarily interested in using
> GAP as a pedagogical tool for teaching group theory (and possibly
> ring theory).
>
> At the moment, what I would like to be able to do is have students
> use standard cycle notation for permutation groups, but have
> multiplication reflect composition of transformations being read
> right to left. Is there any way to do this?
>
> I searched through the GAP manual and did a few searches on the
> forum archive, but have not been able to make any headway.
>
> Thank you for any help you can provide,
> David Romano
Hi David,
I could see four ways to do this, but I'm afraid none will be really
satisfactory for you; it is quite possible that somebody smarter than
me will chime in later with a better solution. Of course there is the
'cheating way':
gap> mul := function (x, y)
> return y * x;
> end;
function( x, y ) ... end
gap> mul ((1, 2), (2, 3));
(1,2,3)
or a bit more sophisticated:
gap> mul := function (arg)
> local result, i;
> result := arg [1];
> for i in arg {[2 .. Length (arg)]} do
> result := i * result;
> od;
> return result;
> end;
function( arg ) ... end
gap> mul ((1, 2), (2, 3), (3, 4));
(1,2,3,4)
So this involves using a different function for multiplication. I
guess you'd have thought of this solution yourself.
Another way would be something like the following. I haven't worked
this out, but it wouldn't be too difficult: Do some tricks with new
families; introduce a function rmp (for right-multiplying permutation);
then:
gap> p12 := rmp ((1, 2));
rmp(1,2)
gap> p23 := rmp ((2, 3));
rmp(2,3)
gap> p12 * p23;
rmp(1,2,3)
So this involves using a different function for construction of
permutations.
However, to be able to use '*' to multiply permutations entered
in the normal way, which is what I guess you want, seems to me to be far
more difficult. One way would be to hack the GAP parser to understand a
right multiplying permutation whenever you enter a permutation, but
then all of the library code suddenly becomes invalid. So you'd have to
have the library code parsed by a parser that understands permutations
the way they are understood now and a different parser for your
students' input -- a can of worms I would rather not open.
The last alternative that I can think of would be to write a layer in
between GAP and your students' input -- a small shell application that
waits for students to enter their computations, then feeds this into
GAP, and feeds the output back to your students, making multiplication
work the other way round in every translation. This might be easiest if
you'd want your students to do a limited set of computations only. Then
it'd be easiest to inverse the permutations for every translation,
since (a^-1 * b^-1)^-1 = b * a.
Hope this helps,
best wishes,
- --
Erik Postma
This message should be signed with the key at /
Dit bericht zou ondertekend moeten zijn met de sleutel:
http://www.win.tue.nl/~epostma/gpg.key
More info / Meer info (in het Engels):
http://www.win.tue.nl/~epostma/signing.html
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.1 (GNU/Linux)
iD8DBQFE9DjVDmbL6DhzfRwRAqAuAJ9/y4FE8sSbRVi6WyM860MSqvE+/ACgqnRD
foazo0jR6eBYjUNLRnYNtd0=
=9FNk
-----END PGP SIGNATURE-----
More information about the Forum
mailing list