%========================================================================== % Solutions to above sample exercises %========================================================================== %\advance\vsize by 3truecm \choosett{apl} \noindent \header%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \vskip 1cm \noindent As the index of the neutral element we use the index origin \BX@IO@ which usually has the value @0@. Then $S(N)= \{0,\dots,N-1\}$, given by the vector \IO@N@. An example on groups are the cyclic groups $({\bf Z}_n,+)$ the group tables of which are generated by the \APL\ function @ZNPLUS@: \hskip\parskip\vbox{\hsize=15truecm \begintt @DL Z_ZNPLUS N;@BXIO [1] @BXIO_0 [2] Z_N@AB(@ION)@SO.+@ION @DL \endtt }\smallskip \item{1.} The matrices represent binary operations of $S(N)$, since they are $N\times N$-matrices with elements from $S(N)$. They are all associative and also commutative except for the case (b). This can be seen by the function @TEST@: \hskip\parskip\vbox{\hsize=15truecm \begintt @DL Z_TEST B [1] " B IS A BINARY OPERATION. THE FUNCTION RETURNS A BOOLEAN 2-VECTOR [2] " (B ASSOCIATIVE, B COMMUTATIVE) [3] Z_(&/&/&/B[B;]=B[;B]),&/&/B=@TRB @DL \endtt }\smallskip \item{2.} \hskip\parskip\vbox{\hsize=15truecm \begintt @DL P_X GPOWER N;I [1] " G GLOBAL [2] P_@BXIO @DM I_0 [3] TEST:@GO(NJ_J+1)/CORE [6] @GO(N>I_I+1)/JLOOP @DL \endtt } Example: \hskip\parskip\vbox{\hsize=15truecm \begintt (ZNPLUS 2) PROD ZNPLUS 10 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 1 2 3 4 5 6 7 8 9 0 11 12 13 14 15 16 17 18 19 10 2 3 4 5 6 7 8 9 0 1 12 13 14 15 16 17 18 19 10 11 3 4 5 6 7 8 9 0 1 2 13 14 15 16 17 18 19 10 11 12 4 5 6 7 8 9 0 1 2 3 14 15 16 17 18 19 10 11 12 13 5 6 7 8 9 0 1 2 3 4 15 16 17 18 19 10 11 12 13 14 6 7 8 9 0 1 2 3 4 5 16 17 18 19 10 11 12 13 14 15 7 8 9 0 1 2 3 4 5 6 17 18 19 10 11 12 13 14 15 16 8 9 0 1 2 3 4 5 6 7 18 19 10 11 12 13 14 15 16 17 9 0 1 2 3 4 5 6 7 8 19 10 11 12 13 14 15 16 17 18 10 11 12 13 14 15 16 17 18 19 0 1 2 3 4 5 6 7 8 9 11 12 13 14 15 16 17 18 19 10 1 2 3 4 5 6 7 8 9 0 12 13 14 15 16 17 18 19 10 11 2 3 4 5 6 7 8 9 0 1 13 14 15 16 17 18 19 10 11 12 3 4 5 6 7 8 9 0 1 2 14 15 16 17 18 19 10 11 12 13 4 5 6 7 8 9 0 1 2 3 15 16 17 18 19 10 11 12 13 14 5 6 7 8 9 0 1 2 3 4 16 17 18 19 10 11 12 13 14 15 6 7 8 9 0 1 2 3 4 5 17 18 19 10 11 12 13 14 15 16 7 8 9 0 1 2 3 4 5 6 18 19 10 11 12 13 14 15 16 17 8 9 0 1 2 3 4 5 6 7 19 10 11 12 13 14 15 16 17 18 9 0 1 2 3 4 5 6 7 8 \endtt } \end