[Tutor] Having Python figure out whether a set is a group

Sheila King sheila@thinkspot.net
Mon, 30 Apr 2001 21:54:38 -0700


On Mon, 30 Apr 2001 20:58:16 -0700, Sheila King <sheila@thinkspot.net>  wrote
about Re: [Tutor] Having Python figure out whether a set is a group:

:To check for associativity, for example,
:find the value of (a,b) and then take that value (which we know is ab) and
:cross it with another element (let's say, e) and see if (ab, e) is equivalent
:to
:a crossed with the result of (b, e)

I was thinking about this a bit more.
I guess you could do this:

if ( table[(table[(a,b)],e)] == table[(a, table[(b,e)])] ):
    whatever happens if associativity holds

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