Maple is a large computer program which can do many useful mathematical tasks. It has extensive numerical, graphical, and symbolic manipulation capabilities. It is installed on most Rutgers computer systems. There are several computer programs with similar capabilities. The most widely distributed programs are Mathematica and Maple. Maple is installed on almost every computer system at Rutgers, and I have a copy at home. So that's what I use and can comfortably discuss. 7/1/2002
Maple can be run in a command line interface or in its own window. From a Unix command line, just type maple which begins the program or in a window system (such as X) type xmaple &. 7/1/2002
A big calculator
All Maple commands should be ended with either : or ; and then followed by pressing the return or enter key. I admit with some embarrassment that I sometimes type a command and then forget either to type a semicolon or a colon, or I forget to press "Enter", and sit there wondering why the system is malfunctioning. 7/1/2002
You can type 3+2; at a command line. The prompt that Maple gives is usually >. See what the result is. Then try 17*3; and check the result. Then try %+4; to see what Maple thinks % means -- it should mean the previous result. Also try 3^2; to learn what ^ means. You might also try 5^2: to learn what ending a command with : rather than ; means. You can check your understanding by typing 2*%; afterwards and predicting the answer before it appears. Note that the command 67/8; returns the value 67/8. Maple won't "simplify" or approximate unless requested. If the command evalf(%); is then given, Maple immediately returns 8.375000000. The function evalf evaluates an expression as a floating-point number with the default number of digits (you can change the accuracy to 20 places with the command DIGITS:=20;. 7/1/2002
Maple uses := for assignment of values and uses = when testing for equality. I have made numerous mistakes with this notation. 7/8/2002
Maple can remember variable names. I tend to use longer variable names because I forget what the names mean. I make errors typing, though, and longer names increase the chance of mistakes. You could try a:=445; followed by a^2; and see what the result is. 7/1/2002
Lots of functions
Maple has many functions built into it: many, many, many functions. I'll concentrate here on just a few whose usefulness for our cryptographic studies will be apparent. 7/1/2002
Surely the most important function is "help". If you want to learn about factoring, for example, you can type the command help(factor);. Most of the time you will get more information than you need, and some (much?) of the information is not relevant. Usually there are further references at the end (under See also) and this is very nice, because Maple has so many functions that finding the most appropriate and useful one can be difficult. For me, the examples are frequently the most helpful part of almost every help entry. 7/1/2002
Maple can help you factor an integer with the command ifactor. The statement ifactor(3334); gets the response (2) (1667) almost immediately but ifactor(some long numeric string); may take a while. 7/1/2002
The command 12+8 mod 11; returns the value 9 and that's how Maple does modular arithmetic. Maple can solve modular equations with the command msolve. Here are some examples. 7/1/2002
It may sometimes be interesting for you to track the amount of time or other resources (storage) that Maple is using. The command time(); asks Maple to report how much CPU (computation time) it has used in seconds (to the nearest thousandth) so far. You can easily get elapsed time as in the following example. Note that when you try this, you will likely get different numbers.
The commands so_far:=time();ifactor(99933355199933355519993335551);time()-so_far; get the responses
(3) (7) (13) (19) (31) (37) (211) (241) (525965029) (2906161) (2161)
The first time you use a command in a session the CPU time may not correctly indicate the relevant computation, since the program must fetch the needed part of itself from slower memory.
You can also read about the command showtime if you want even more information. 7/1/2002
Taking exponents easily and quickly modulo some integer is very important in the best known public key encryption ideas (RSA and Diffie-Hellman). Please consider the following two examples of sequences of commands.
Maple knows about polynomials. For example, here are two commands and the Maple responses:
Maple can also substitute and evaluate the result.
expand((fox^3)/9) mod 17;
1/9 mod 17;
Almost surely you will have questions. Each paragraph has a date when it was written (here: 7/1/2002). When I receive questions of general interest, I will try to add text to this page. Have fun! You can send me mail.