t> MAPLE EXPRESSIONS AND SYNTAX
b>
t> Expressions are a very important structure in Maple. Most Maple objects
t> are, at one level or another, made up entirely of these expressions.
t> At the most basic level, an expression consists of a single value or
t> unknown. Conversely, Maple expressions can consist of thousands upon
t> thousands of values and unknowns strung together with the use of
t> various arithmetic operators.
b>
t> Maple's arithmetic operators include:
b> 
n>    +         addition 
n>    -         subtraction 
n>    *         multiplication
n>    /         division 
n>    ^         exponentiation 
n>    !         factorial
n>    abs()     absolute value 
n>    iqou()    integer quotient 
n>    irem()    integer remainder
b> 
c1>
t> The following are some examples of simple Maple expressions.
b>
x> a+b+c;
x> 3*x^3-4*x^2+x-7;
x> x^2/25+y^2/36;
t> As you can see, Maple echoes these expressions in a "pretty" form, the
t> quality of which depends upon the capabilities of your monitor.
b>
c1>
t> Order of Operations
b>
t> In expressions, the precedence of operators follows the standard found
t> in most other areas of computation. If there are any ambiguities, use
t> parentheses, (), to specify the order of operations.
b>
x> 2+3*4-5;
x> (2+3)*4-5;
x> (2+3)*(4-5);
t> It is a good idea to use parentheses whenever there is any chance
t> of ambiguity. If a set of parentheses is redundant, Maple's parser
t> eliminates it automatically.
b>
c1>
t> Questions
b>
c2>
q> Write the Maple expression that represents the quantity, a plus b, divided
q> by the quantity, a times c.
a> (a+b)/(a*c);
b>
c2>
q> Calculate the value for the binomial formula n!/(n-r)!r! when n=6 and r=2.
a> 6!/((6-2)!*2!);
eoq>
b>
c1>
t> Expression Sequences
b>
t> Another data representation often used in Maple is the expression
t> sequence.  An expression sequence is simply one or more Maple
t> expressions separated by commas. As you will see throughout this
t> tutorial, most procedures require an expression sequence as input, and
t> many of them return a result that includes an expression sequence.
b>
t> The simplest way to create an expression sequence is to simply enter it
t> as such.
b>
x> 1,2,3,4,5;
x> a+b,b+c,c+d,e+f,f+g;
c1>
t> Alternatively, there are two ways in Maple to automatically generate a
t> implicit expression sequence. First, the $ operator can be used alone
t> to create sequences containing multiples of one element, or in
t> conjunction with the ellipsis operator, .., to create well-ordered
t> sequences.
b>
x> a$6;
x> $1..6;
x> i^2$i=1..6;
h> i:=evaln(i):
c1>
t> There is also a Maple procedure, seq, that allows even more control
t> over the creation of expression sequences.
b>
x> seq(i!/i^2, i=1..7);
h> i:=evaln(i):
t> Another advantage of the seq command is that it is very fast, and can
t> be used in many situations to increase the speed of your Maple
t> calculations.  There will be more information on how to call procedures,
t> like seq, in a later chapter of this tutorial.
b>
c1>
t> Questions
b>
c2>
q> Using the $ operator, create an expression sequence containing the first
q> ten even numbers: 2, 4, 6,...
a> 2*i$i=1..10;
b>
c2>
q> Create an expression sequence, using the seq command, for the binomial 
q> formula n!/(n-r)!r! where n=6 and r ranges from 0 to 6.
a> seq(6!/((6-r)!*r!), r=0..6);
h> r := 'r';
h> i := 'i';
eoq>
eof>


