Product of elements in a list in GAP

89 Views Asked by At

I just started learning GAP and I'm trying to do simple exercises. The following problem is something I have not been able to figure out.

So I found the character degrees of $S_4$ using the following code:

CharacterDegrees(CharacterTable($"S_4"$));

Now this gives the output [ [ 1, 2 ], [ 2, 1 ], [ 3, 2 ] ] , which means that there are two irreducible character of degree 1, one irreducible character of degree 2 and two irreducible characters of degree 3. I want to calculate the product of irreducible character degrees from this list. i.e., I want to calculate 1.1.2.3.3 directly from this list. Is there a command or a function that can be used in a situation like this?

Thak you!

1

There are 1 best solutions below

2
On BEST ANSWER

I don't know if there's any inbuilt function to do this, but you could easily make one as follows:

myFunction := function( L )
    return Product( List( L, x -> x[1]^x[2] ) );
end;

You can then use it like this:

gap> L := CharacterDegrees( CharacterTable( "S4" ) );
[ [ 1, 2 ], [ 2, 1 ], [ 3, 2 ] ]
gap> myFunction( L );
18