[Tutor] determining whether a set is a group

Sheila King sheila@thinkspot.net
Sat, 28 Apr 2001 23:31:42 -0700


On Sun, 29 Apr 2001 00:57:06 -0500, "Julieta" <julieta_rangel@hotmail.com>
wrote about [Tutor] determining whether a set is a group:

:Hello everyone!  I took a modern abstract algebra class this semester and there is something that caught my attention, and which I think would make a neat program.  I would like to have a program in which given any set and the table accompaning the set,
 the computer would display a message stating whether the set is a group or not.

OK, you made me go look up what a group is. (I couldn't remember for
sure...and couldn't find my abstract algebra text.)

For the benefit of others, who may not know, I found this definition on the
web:

The axioms (basic rules) for a group are: 
( where the dot (•) symbolizes some operation...)

   1.CLOSURE: If a and b are in the group then a • b is also in the group. 
   2.ASSOCIATIVITY: If a, b and c are in the group then (a • b) • c = a • (b •
c). 
   3.IDENTITY: There is an element e of the group such that for any element a
of the group
     a • e = e • a = a. 
   4.INVERSES: For any element a of the group there is an element a^(-1) such
that 
          a • a^(-1) = e 
          and 
          a^(-1) • a = e 

:  I guess I would have to get the computer to ask for the amount of elements in the set, say 6, and then have the computer generate a 6 by 6 matrix, in which the user would enter the corresponding table, so the computer can figure out, after testing for
 the required properties, whether the set is a group or not.  

Well, it sounds like an interesting project. It only would work for discrete
sets, with a finite number of elements. But writing the program would help you
learn a number of things. You'd have to define your operation, symbolized by
the dot (•). I suppose you'd have to write a function to handle checking
(1)Closure, and another to handle checking (2) Associativity. As far as
checking for an identity element and inverses, though...I can't think how
you'd get the computer to do that, except (possibly), by exhaustion (try all
possible combinations until you find one that works?).

I don't know that a matrix would be necessary. A simple list of the elements,
and then iterate through the list, checking each element of the list against
all others (so a nested loop).

:You might think that I'm very lazy to want the computer to do this for me, and I guess you are right, this is probably the reason why computer programming is becoming more interesting by the minute.  You do the work only once and then the computer does 
it for you.  It is beautiful!  I have so many little projects that could make my life much much
:easier, that I don't know where to start.  My only and biggest problem is that I'm a computer illiterate and have no clue as to where to start, however, I'm willing to do what it takes to learn.  I know that some help over the internet might not do mira
cles for me, but I guess it would be a start.  I have the book Teach Yourself Python in 24 Hours and I'm reading it, but I guess I need more help.  Can you help me.

Yep, I've got a list of projects, too. Computer programming can be great. Here
are some websites that have Python tutorials aimed at non-programmers:

For non-programmers:
Non-programmer's tutorial for Python
http://www.honors.montana.edu/~jjc/easytut/easytut/
Learning To Program
http://www.crosswinds.net/~agauld/
Python Baby-steps Tutorial (crashed my NS but viewable in IE)
http://www.coolnamehere.com/z/programming/python/pythontut.asp
How To Think Like a Computer Scientist
http://www.ibiblio.org/obp/
Instant Hacking
http://www.hetland.org/python/instant-hacking.php


--
Sheila King
http://www.thinkspot.net/sheila/
http://www.k12groups.org/