Maple Tutorial 4:
Sequences, Lists, and Sets

M.M. Yovanovich

TUTORIAL4.MWS

Sequences, lists and sets.

> restart:

> list1:= [1,2,3,4];

[Maple Math]

> list2:= [1+x^2, 1-x^2];

[Maple Math]

> set1:= {1,2,3,4};

[Maple Math]

> set2:= {1+x^2, 1-x^2};

[Maple Math]

> list1[1]; list2[2];

[Maple Math]

[Maple Math]

> op(1, list2); op(2, list2);

[Maple Math]

[Maple Math]

> expand(op(1, list2)*op(2, list2));

[Maple Math]

> map(exp, list2);

[Maple Math]

> map(cos, list2); subs(x = Pi, %); evalf(%, 6);

[Maple Math]

[Maple Math]

[Maple Math]

> xs:= [seq(x.j, j = 1..5)];

[Maple Math]

> nops(xs); s2:= add(xs[j], j = 1..nops(xs));

[Maple Math]

[Maple Math]

> average:= s2/nops(xs);

[Maple Math]