4
(1.2.2) (1.2.2) (1.1.2) (1.1.2) (1.1.1) (1.1.1) (2.7) (2.7) (2.4) (2.4) (2.1) (2.1) (1.2.1) (1.2.1) (2.3) (2.3) (2.5) (2.5) (2.6) (2.6) (2.8) (2.8) (2.2) (2.2) Sets, Lists and Sequences Lists are enclosed in a square brackets [ ] ; elements in the list are not ordered examples: Sets are enclosed in a curly braces { } ; elements in a set are ordered. examples: indexing: examples: 5 7 the last command can as well be entered as; 7

Learning Sets Sequences and Lists

Embed Size (px)

DESCRIPTION

maple

Citation preview

  • (1.2.2)(1.2.2)

    (1.1.2)(1.1.2)

    (1.1.1)(1.1.1)

    (2.7)(2.7)

    (2.4)(2.4)

    (2.1)(2.1)

    (1.2.1)(1.2.1)

    (2.3)(2.3)

    (2.5)(2.5)

    (2.6)(2.6)

    (2.8)(2.8)

    (2.2)(2.2)

    Sets, Lists and Sequences

    Lists are enclosed in a square brackets [ ]; elements in the list are not orderedexamples:

    Sets are enclosed in a curly braces { }; elements in a set are ordered.examples:

    indexing:examples:

    5

    7the last command can as well be entered as;

    7

  • (2.1.1)(2.1.1)

    (3.1)(3.1)

    (2.9)(2.9)

    (2.1.2)(2.1.2)

    (2.1.3)(2.1.3)

    (2.10)(2.10)

    (3.4)(3.4)

    (2.12)(2.12)

    (3.5)(3.5)

    (2.13)(2.13)

    (3.2)(3.2)

    (3.3)(3.3)

    (2.11)(2.11)

    modifying the elements of a list

    notnum

    Sequences: seq( expression in a variable n, n = n0..n1);examples:

    Useful list commands(a) Map command: used to evaluate a function at each element of a list. usemap (function name, the list);examples:

    NB: The first argument of the map command is only the name of the function or commandYou can also use map to evaluate a multi-variable function(b) map (function/command name, the list, argument 2, argument 3, etc);examples:

    we can compute the derivatives of the elements of somelist using

  • (5.4)(5.4)

    (5.1)(5.1)

    (4.1)(4.1)

    (3.6)(3.6)

    (4.3)(4.3)

    (5.3)(5.3)

    (4.4)(4.4)

    (5.2)(5.2)

    (3.7)(3.7)

    (4.2)(4.2)

    (c) map2 ( function name, argument1, list, argument2, etc );example:

    NB: isolate is similar to solve but it returns answers in form of equations

    Zip commandCan be used if both of the arguments of a two variable functions are listszip (function name, first list, second list );example:

    sorting listssort command arranges the elements in ascending order example:

    for descending order, we can used a boolean function of the formsort (list, boolean function)

    select : selects all elements of s list that meet a specified Boolean conditionremove: removes all elements of a list that meet certain boolean conditionselect(Boolean condition, list);remove(Boolean condition, list);

  • (6.4)(6.4)

    (3.6)(3.6)

    (6.6)(6.6)

    (6.3)(6.3)

    (6.5)(6.5)

    (6.1)(6.1)

    (6.2)(6.2)

    lets construct a list say listB and do these operations on it

    or we can remove the primes from the list

    We can combine both commands