I have to make a program that computes the number of abelian group structures of type (G, *) where G = {a1, a2, ...., an}, and n is given as an input from the user(the problem is more than that but this is where i got stuck). Is there any formula for calculating this number, or do i have to compute every group, check if it is abelian and then count them? For clarification, i need the number of abelian structures, which are in this form for n=4: https://ibb.co/K2QWMNg These are only the first 4 , there are 12 more, similar to these 4, but with different identity elements
-
To clarify, you're asking how to calculate the number of abelian groups of order $n$, given $n$? – 79037662 Oct 18 '19 at 18:24
-
Nope, i found the answer for that, but that's not what i need. I need an output like "the number of abelian group structures on a set G = {a1, a2, a3, a4} is 16" if my n is 4 – Ghosty Frosty Oct 18 '19 at 18:27
-
You may use the fundamental theorem of abelian groups. You need to factorize a given input, say it $n$. Consider the case when $n$ is a power of a prime. In that case, you may need a partition number. – Hanul Jeon Oct 18 '19 at 18:34
-
See here – Yuval Gat Oct 18 '19 at 18:49
-
1Once you know the number of non-isomorphic abelian groups of order $n$, you have $n!$ ways of assigning the group structure to your set. So the answer to your problem is $n!A(n)$, where $A(n)$ is the number of non-isomorphic abelian groups of order $n$. – Arturo Magidin Oct 18 '19 at 19:01
-
@ArturoMagidin but does it hold for my example too? For n = 4 i should get 16 abelian structures, but 4! is 24, and A(4) = 2 so the answer would instead be 48. – Ghosty Frosty Oct 18 '19 at 19:07
-
@GhostyFrosty how do you know there are 16? – 79037662 Oct 18 '19 at 19:11
-
@79037662 I've just edited my post and given the explanation. – Ghosty Frosty Oct 18 '19 at 19:13
-
That's not an explanation. That link is not self-explanatory, and doesn't show a count of 16 for $n=4$. – Arturo Magidin Oct 18 '19 at 19:15
-
That said... I may be overcounting. For instance, how many distinct mutliplication functions are there to make a $4$-element set cyclic of order $4$? The identity and the element of order $2$ are uniquely determined by the multiplication table, so that gives $12$ possible assignments. Once those two are set, the rest of the multiplication table is completely determined. So there are 12 ways to give it the "cyclic group of order $4$" structure. (cont) – Arturo Magidin Oct 18 '19 at 19:18
-
@ArturoMagidin then is this one better? https://jpst.it/1TiNF This is the list of operation tables that define the abelian structure on a G = {a1, a2, a3, a4} – Ghosty Frosty Oct 18 '19 at 19:18
-
Stop giving me links to outside sites that contain no explanation and just a bunch of tables. They don't explain anything, nor do they show your count is complete. If you cannot explain why you get 16, then don't send me to do the work elsewhere. – Arturo Magidin Oct 18 '19 at 19:19
-
@GhostyFrosty That still doesn't answer my question. How do you know there are only 16 and not more? – 79037662 Oct 18 '19 at 19:20
-
I know they are 16 because that's what the problem statements gives as an example @ArturoMagidin – Ghosty Frosty Oct 18 '19 at 19:20
-
So then you don't actually know, you've been told. Don't claim to possess knowledge you do not actually possess, you just waste everyone's time by doing so. – Arturo Magidin Oct 18 '19 at 19:21
-
An they also give that list of operation tables as an example – Ghosty Frosty Oct 18 '19 at 19:21
-
I do not claim to know it, that's why i ask for a formula, i can make lists for up to card(G) = 7 but higher than that there are way too many structures – Ghosty Frosty Oct 18 '19 at 19:22
-
How many ways are there to give the set the Klein $4$-group structure? $4$ ways to decide who the identity is; then the rest of the table is determined, since we know what the multiplication by itself is, and the multiplication by each other element has to be the fourth element. So that does give me a total of 16 ways and 16 ways only (12 for the cyclic group, 4 for the Klein 4-group). Some of the permutations of the underlying set will result in the same multiplication function. – Arturo Magidin Oct 18 '19 at 19:23
-
Which means that you are very unlikely to find an easy closed formula; but you aren't looking for a formula, you are looking for a computer program to do it. Checking abelianness is easy (table has to be symmetric); but checking associativity is difficult and I do not know of a way to check it through an easy property of the multiplication table. It's not as simple as counting all the Latin squares. – Arturo Magidin Oct 18 '19 at 19:25
-
Checking abelianness is indeed easy, the difficult thing is optimizing how you generate tables so that you do not generate every possible table. Also, past n = 7 the problem does not require printing the tables, only giving the number of structures, that's where it becomes difficult. It may be that my implementation is wrong, or the way i look at the problem. I'll try to submit it as it is now, hopefully my teacher will give me a concrete answer of what he meant or on his idea of implementing it. Thank you for the time! – Ghosty Frosty Oct 18 '19 at 19:33
1 Answers
This is not going to be a trivial problem. Contrary to my original assertion, it is not simply $n!A(n)$ with $A(n)$ the number of nonisomorphic abelian groups.
Take the case $n=4$. To give a set of $4$ elements a cyclic group structure, we can select an arbitrary element to be the identity (four choices) and an arbitrary element to be the element of order $2$ (three remaining choices). Those two choices completely determine the multiplication table, so you have $12$ ways of assigning the cyclic-group-of-order-4 structure to the set, rather than the expected $4!=24$ you get; this, because exchanging a distinguished generator and its inverse will not change the multiplication table.
For the Klein $4$-group structure, once you determine the identity, this completely determines the multiplication table; every element is its own inverse, and the remaining two entries in each row and column are forced. This gives $4$ ways of giving it the Klein $4$-group structure.
By contrast, for $n=5$, you can pick the identity (5 possibilities); a generator (4 possibilities), its square (3 possiblities), and its cube (2 possibilities), arbitrarily. The remaining entries are forced. They will each give you a different table. So here you do get $5!$ possible ways of defining the multiplication.
The fact that this analysis is rather ad hoc suggests to me that it will be difficult to find a closed formula.
So I don't think there is an easy closed formula for it, even if you know $A(n)$ (which is related to the factorization of $n$ and the partition numbers for the exponents).
But you don't want a closed formula, you want a program to calculate the number. I don't know what the expected answer is; it is not hard to make a program to figure out how many latin squares there are, and you actually only need to fill out the top half of the square since abelianness means the multiplication table will necessarily be symmetric about the main diagonal. But checking associativity is not straightforward, so you may have to do that in some direct way.

- 398,050