# Why am I having issues working with large group multiplication tables?

My mathematica running on Wolfram Cloud seems to break down if I use a SymmetricGroup greater than 6. As a basic example, when I run,

group1 = GroupMultiplicationTable[SymmetricGroup[6]];
Print[Length[group1]];


I get 720 as output. However, Running the same code with 7 as in,

group1 = GroupMultiplicationTable[SymmetricGroup[7]];
Print[Length[group1]];


causes the notebook to display the running icon for about a minute, and then stop with no output. I am running this code in a notebook on Wolfram Cloud. I have tried running it on desktop Mathematica, but this also ceases to work for SymmetricGroups greater than 7.

• Perhaps you are exceeding some memory limitation? Displaying the result and the MaxMemoryUsed for 5 and then for 6 shows how rapidly this is growing and consuming memory. From that could you estimate the size for 7,8,9,10..? It doesn't look like it is a small simple smoothly increasing amount
– Bill
Mar 26, 2023 at 21:40
• Hm. This would be an integer matrix of size $7! \times 7! = 5040 \times 5040$, right? That fits comfortably into memory... Mar 26, 2023 at 21:43
• Perhaps to add clarity, my end goal was to display a histogram of the orders of elements in the Symmetric Group. I have code that works when plugging in SymmetricGroups up to size 6, but using SymmetricGroup[7] fails because for some reason getting the length of the GroupMultiplicationTable returns 1 once it is 7 or greater. Furthermore, I only need to go up to SymmetricGroup[9]. Mar 26, 2023 at 22:01
• You can get the histogram of orders with something like Histogram[PermutationOrder /@ GroupElements[SymmetricGroup[9]]].
– jose
Mar 28, 2023 at 23:17
• You're probably exceeding the time limit, which for basic wolframcloud seems to be about one minute. See CloudAccountData[], "SessionEvaluationTimeLimit" -> Quantity[60, "Seconds"] May 23, 2023 at 23:15

Here's what I think is happening. There's a bug/buglet in time-constraining the call to whatever library function computes the group multiplication table. Even on my laptop, this runs for about a minute, not the requested time constraint of 10 sec. (buglet), and then returns \$Aborted:
TimeConstrained[

I would think that wolframcloud would implement the "SessionEvaluationTimeLimit" of 60 sec. by wrapping commands in TimeConstrained[]. It wouldn't be hard to do it in other ways, I suppose, but TimeConstrained[] is already part of the WL system. Clearly(?) there is some other stuff involved in communicating between the web-notebook and the server kernel that is probably involved, but I don't know what it is.