Group statistics
I just ran across FiniteGroupData and related functions in Mathematica. That would have made some of my earlier posts easier to write had I used this instead of writing my own code.
Here's something I find interesting. For each n, look at the groups of order at most n and count how many are Abelian versus non-Abelian. At first there are more Abelian groups, but the non-Abelian groups soon become more numerous. Also, the number of Abelian groups grows smoothly, while the number of non-Abelian groups has big jumps, particularly at powers of 2.
Here's the Mathematica code:
fgc = FoldList[Plus, 0, Table[FiniteGroupCount[n], {n, 1, 300}]] fga = FoldList[Plus, 0, Table[FiniteAbelianGroupCount[n], {n, 1, 300}]] ListLogPlot[ {fgc - fga, fga }, PlotLegends -> {"Non-Abelian", "Abelian"}, Joined -> True, AxesLabel -> {"order", "count"}]
I see the plot legend on my screen, but when saving the plot to a file the legend wasn't included. Don't know why. (Update: See footnote [1]). The jagged blue curve is the number of non-Abelian groups of size up to n. The smooth gold curve is the corresponding curve for Abelian groups.
Here's the same plot carried out further to show the jumps at 512 and 1024.
Related posts[1] Someone from Wolfram Research saw this post and sent me a fix:
pl = ListLogPlot[...]Export["~/Desktop/img.png", pl]