[GAP Forum] Mappings how?

Marcus Bishop marcus.bishop at gmail.com
Wed Nov 17 21:39:02 GMT 2010


Computer algebra can be very frustrating when your questions are SO
specific. What you want to do is first understand why your problem is
equivalent to the following.

List all the pairs [a,b] where a and b come from the set {1,2,3}.

Then the answer to the second problem in GAP is given by the following command.

gap> Tuples([1,2,3],2);
[ [ 1, 1 ], [ 1, 2 ], [ 1, 3 ], [ 2, 1 ], [ 2, 2 ], [ 2, 3 ], [ 3, 1
], [ 3, 2 ], [ 3, 3 ] ]

You can find out more about the Tuples command by typing
?Tuples
Best of luck!
-marcus

On Wed, Nov 17, 2010 at 9:58 PM, U.Mutlu <mutluu at uni-hildesheim.de> wrote:
> Hi,
> I'm new to GAP and I try to solve the following from a textbook:
>  A = { 1, 2 } and B = { a, b, c }.
>  Show all possible mappings of A to B.
>
> How to do this in GAP?
>
>
> _______________________________________________
> Forum mailing list
> Forum at mail.gap-system.org
> http://mail.gap-system.org/mailman/listinfo/forum
>



More information about the Forum mailing list