ASPN ActiveState Programmer Network
ActiveState
/ Home / Perl / PHP / Python / Tcl / XSLT /
/ Safari / My ASPN /
Cookbooks | Documentation | Mailing Lists | Modules | News Feeds | Products | User Groups


Recent Messages
List Archives
About the List
List Leaders
Subscription Options

View Subscriptions
Help

View by Topic
ActiveState
.NET Framework
Open Source
Perl
PHP
Python
Tcl
Web Services
XML & XSLT

View by Category
Database
General
SOAP
System Administration
Tools
User Interfaces
Web Programming
XML Programming


MyASPN >> Mail Archive >> python-Tutor
python-Tutor
Re: [Tutor] determining whether a set is a group
by Benoit Dupire other posts by this author
May 1 2001 7:25PM messages near this date
Re: [Tutor] determining whether a set is a group | Re: [Tutor] determining whether a set is a group
Thank you for your answer.

A few years ago, iwas only doing mathematics and physics and the kind of exercice to
practice we got was like the following one:
a * b = a+b - a x b
is (Z, *) a group ?
Yes ? no ?
If no how can i modify it to make it a group ?

It would be interesting to make a computer program to solve this kinds of pb.
As you suggest it, i would use a subset, lets say -10 ; 10  (because 0, 1 are often
worth to try as a general rule ) and additionnally i would build a function, that
takes a variable and checks if it belongs to Z


Answer:
if b= 1,   a * b = a+ b - a x b = a + 1 - a x 1 = 1
so a * 1 = 1 whatever 'a' is. so 1 has no inverse, i have to remove it from Z to
have a group....

But to make a  computer think like that is not so easy... :o)
Benoit


Corran Webster wrote:

> 
> 
>  As far as I can see, the best solution to the original problem (given
>  a finite set and the Cayley matrix of an operation on the set, is it
>  a group?) is a brute force checking of the axioms.  For efficiency
>  it's probably best use a dictionary to represent the matrix, rather
>  than a list of lists, and for generality it's probably better to have
>  the algortihm work with the operation as a function, rather than
>  directly with the matrix, but I could be wrong.
> 
>  Eg. (untested code)
> 
>  def cayleyToOp(set, cayley):
>     """Given a set and a Cayley matrix, returns a function which
>  performs the operation on two elements."""
>     matrix = {}
>     for a in range(len(set)):
>       for b in range(len(set)):
>         matrix[(set[a], set[b])] = cayley[a][b]
>     return lambda a, b, matrix=matrix: matrix[(a,b)]
> 
>  Z3 = [0, 1, 2]
>  Z3Cayley = [[0,1,2], [1,2,0], [2,0,1]]
>  Z3op = cayleyToOp(Z3, Z3Cayley)
> 
>  print Z3op(1,1)
>  #should print 2
> 
>  of course Z3op could be more efficiently implimented as
> 
>  def Z3op(a, b):
>     return (a+b) % 3
> 
>  which is why the group checking stuff will be more flexible if you
>  allow functions.
> 
>  >Although i remember what a group is , i don't remember what groups are useful
>  >for....... any math teachers?
> 
>  As it so happens, I teach math at UNLV.  Groups typically come up in
>  situations where there is symmetry of some sort and so can be used to
>  describe the symmetry which is present.  Knowing symmetries can help
>  you find and classify solutions to concrete problems.
> 
>  They are also one of the fundamental building blocks of abstract
>  algebra and most interesting algebraic systems involve some sort of
>  group structure.  The standard addition of numbers is an example of a
>  group.
> 
>  Regards,
>  Corran
> 
>  _______________________________________________
>  Tutor maillist  -  Tutor@[...].org
>  http://mail.python.org/mailman/listinfo/tutor

--
Benoit Dupire
Graduate Student
----------------
I'd like to buy a new Boomerang. How can i get rid of the old one?



_______________________________________________
Tutor maillist  -  Tutor@[...].org
http://mail.python.org/mailman/listinfo/tutor
Thread:
Julieta
Sheila King
Daniel Yoo
Benoit Dupire
Benoit Dupire
Corran Webster
Sheila King
Sheila King
Deirdre Saoirse Moen
Daniel Yoo

Privacy Policy | Email Opt-out | Feedback | Syndication
© ActiveState Software Inc. All rights reserved