Re: Haskell newb trying to write a basic program.

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

Re: Haskell newb trying to write a basic program.

Erik Rantapaa-2

Have a look at the HaskellForMaths package.

Using the Math.Algebra.Group.PermutationGroup module the expression `elts (_A n)` will return all the permutations of A_n.

On Thursday, May 26, 2016 at 6:39:52 PM UTC-5, Blake Sims wrote:
Hi,

I am a newb to Haskell and programming in general, but I was trying to write a basic program to find the elements for the alternating group for any n.

For the symmetric group I wrote something like this

input Data.List

symmetric n = permutations ([1..n])

What if I just want to find the even permutations?  What is the quick and dirty way of doing this?  I was looking at the package Data.Matrix and messing around with permutation matrices, but there has got to be a quicker and easier way of doing it. I am skimming the book learn you a Haskell, but my attention span is pretty short so if someone could direct me in the right direction I'd be much obliged.  

_______________________________________________
Haskell-Cafe mailing list
[hidden email]
http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe