27

I am going to start learning Abstract Algebra- Groups, Rings,etc. I am interested to know any programming language, if at all which can help me learn/try the concepts I learn in theory.

EDIT: I am not really looking at implementing what I learn. I am interested to know any language which already supports them.

alfC
  • 10,293
  • 4
  • 42
  • 88

11 Answers11

33

Maybe a slightly different take on your question, but still... The functional language Haskell uses concepts from algebra (particularly category theory) such as monads, monoids, arrows and whatnot.

Using Haskell's typeclasses, you could also make any object into a group, or a ring, for example, simply by defining operations (operators) on them. Guaranteeing that the operations you define actually comply to the group/ring axioms would be your responsibility, however.

Thomas
  • 150,847
  • 41
  • 308
  • 421
  • That is THE kind of answer I wanted :-). Thanks! –  Feb 24 '09 at 04:23
  • 1
    Practically speaking, Haskell is nice for abstract algebra and other discrete math because it makes defining and evaluating combinatorial datastructures lightweight and easy. – comingstorm Nov 19 '09 at 22:01
  • 3
    A good introduction of using Haskell for algebra could be found in this paper: http://people.cs.uu.nl/jeroen/article/algebra/index.html – Daniel Jan 20 '10 at 21:41
21

The text that you want here is Abstract Algebra, A Computational Approach by Chuck Sims. The author will recommend that you use the APL programming language. The book is out of print, but you can probably find it in your library.

There is also the GAP Computer Algebra System which is fun to use for group theory.

Advanced resources:

Magma: fairly sophisticated CAS that can handle a wide range of concepts from abstract algebra.
Macaulay 2: used to study polynomial rings, especially Gröbner bases.
SINGULAR: used to study polynomial rings.

A key fact in studying group theory is that every group is isomorphic to a permutation group by the regular action. Thus, the key to understanding group theory is to understand the permutation groups.

Finally, any language that supports defining your own objects and defining a binary operator on two instances of the object will support learning the theory through programming.

Sam Hasler
  • 13,310
  • 9
  • 68
  • 101
jason
  • 220,745
  • 31
  • 400
  • 507
  • I just stumbled upon "Abstract Algebra, A Computational Approach" in the library today... can you recommend an APL implementation for the exercises? – Jørgen Fogh Dec 02 '09 at 22:32
  • 1
    The NARS2000 implementation is great; I've used it successfully under Linux (it's runs on other systems too). I've heard (but have not experienced) that the VisualAPL (.NET implementation of APL) is fantastic. – jason Dec 03 '09 at 01:39
  • Although I'm over 4 years late, I'd just like to point out that not every group is *isomorphic* to a permutation group; rather, every group *embeds* in a permutation group. Also, while this is technically true, it's not always the best reduction to perform; it's very much like saying that every integer divides a factorial, so number theory can be reduced to the study of factorials. – LSpice Jan 12 '14 at 01:51
  • This is a great answer, but if you are looking for a language with great community support and has real applications the industry, go with Haskell, as Thomas's comment points out. Typed FP is gaining traction with all the emphasis on concurrency, parallelism, and distributed computing these days, and the models for achieving this seem to borrow the most from ML and Haskell (although, Lisp is also making a show, it won't help you with Abstract Algebra like you want). – josiah Nov 09 '14 at 20:02
  • The book is available last time I checked: https://www.amazon.com/Abstract-Algebra-Computational-Charles-Sims/dp/0471098469 – alfC May 21 '18 at 03:06
5

If you're playing with groups, you may want to visualize them using Group explorer.

Francois G
  • 11,485
  • 50
  • 57
4

Mathematica has a lot of useful functions for dealing with concepts in abstract algebra. Unfortunately, it's proprietary software and very expensive. Sage is a free alternative, which also has a pretty good repertoire of abstract algebra functions, although I haven't used it as extensively so I can't comment much more on it.

Adam Rosenfield
  • 360,316
  • 93
  • 484
  • 571
3

Any language with fixed size unsigned integers (eg. the unsigned int type in C) is an example of such an implementation. Addition with unsigned values is essentially the same as addition over Z232 (ie. the integers modulo 232), which you are probably learning about in your abstract algebra class.

Modular addition over such a group is not terribly interesting, though. More interesting might be modular addition over a group of size N where N has prime factors other than just 2, or size P where P is a prime. To experiment with such groups, you may have to implement such arithmetic operations yourself (it's not hard). Languages with operator overloading can make the implementation a lot more convenient to use.

Greg Hewgill
  • 828,234
  • 170
  • 1,097
  • 1,237
3

Use the language that makes the most sense to you. Abstract algebra contains a lot of symbol manipulation (symbol pushing) and rewriting, a modest amount of induction, and a fair amount of tediousness. To me that sounds like logic or functional programming; Epigram and Agda do a bit of this, and Haskell does to some extent (though I disagree that monoid is correct, mzero and mappend okay, mconcat: bad). For abstract algebra, the best programming language is Definition notebook and tons paper. Though this one is becoming quite esoteric these days.

3

Hmm ... sorry to say but I don't think it's effective to learn some fancy new programming language in order to help you learn abstract algebra.

Yes Haskellers love to talk category theory but this is not really a good starting point.

GAP and co. are used to help grown up group theorists to find new "monsters" - they are bad tools to learn group theory.

Maybe you can have a look at this: http://freecomputerbooks.com/mathAlgebraBooks.html - there are a lot of free books around this topic.

Carsten
  • 49,407
  • 9
  • 85
  • 111
  • 2
    I must disagree here. If you have decent programming chops then implementing these concepts in something like Haskell could be a fantastic learning exercise. Abstractions of types and binary operations are conceptually close to the basics of abstract algebra. – Alex Aug 30 '09 at 17:54
  • 1
    @Alex yes, I agree that implementing concepts is the best way to learn what they really mean. On the other hand, the question specifically asks for languages that support this kind of concept, so that they do not have to be implemented. In this case, I agree with carsten. – acl Dec 18 '11 at 16:15
  • It's not that you're implementing these things on top of the language. The language is fundamentally built upon algebraic concepts: you get algebraic datatypes, in haskell these form final coalegbras while in ML they form initial algebras, you don't see this kind of structure mirrored at *all* in things like mathematica, etc... – Kristopher Micinski May 31 '12 at 07:02
  • @Eric: for your downvote: thanks for letting me know why but for the misspellings: help me out as an non-nativ english user and correct them instead of complaining about this – Carsten Jun 07 '13 at 05:43
  • @Eric: concerning the "non constructive" ... I gave my honest answer (I did learn algebra the *old* way and am a Haskell/FP user) and pointed to some free resources – Carsten Jun 07 '13 at 05:49
2

It is a bit surprising that so far no one has mentioned CoCoA (an acronym for Computations in Commutative Algebra), a link to the main site : http://cocoa.dima.unige.it/ where one can download the newest CoCoA 5.0 for major platforms (Linux, MacOS X, Windows), (a helpful manual for CoCoA 4.7 can also be found there, for 5.0 is to be updated).
A freely available computer algebra system (written in C) being developed for over 20 years. Its target are professional, scientific applications, among them Gröbner bases calculations, polynomial factorization, exact linear algebra, Hilbert functions, toric ideals etc.

There are good monographs like Computational Commutative Algebra (2 vol.) by Kreutzer and Robbiano dealing with CoCoA: http://cocoa.dima.unige.it/kr/

In the field of commutative algebra it has more advanced and specialized functionality than Mathematica, although in M there are brilliant capabilities (absent in CoCoA) for quantifier elimination (helpful in dealing with systems of polynomial equations and inequalities) : http://www.wolfram.com/learningcenter/tutorialcollection/AdvancedAlgebra/.

Artes
  • 1,113
  • 1
  • 16
  • 22
1

The only computer language book I read that tries to deal seriously with concepts of Abstract algebra is Scientific and Engineering C++: An Introduction with Advanced Techniques and Examples by John J. Barton, Lee R. Nackman.

It is a good book on C++, although quite old.

I can't tell if the approach is 100% mathematically correct.

alfC
  • 10,293
  • 4
  • 42
  • 88
0

EAAM its a mathematica specific package and can be installed as well.

Sejwal
  • 1,547
  • 1
  • 15
  • 26
0

In a similar vein to Greg's answer, groups have a nice representation in the form a matrix multiplication, so you often see examples done using matlab or similar tools...

dmckee --- ex-moderator kitten
  • 90,531
  • 23
  • 129
  • 225