Abstract Algebra calculation