# TI-Lists/Arithmetic

Arithmetic can be done with Lists in a variety of ways. A single item in a list can be used in an arithmetic expression. The operations that are normally used for single numbers can work on lists of numbers. And there are a variety of functions that do list operations on lists.

### TI arithmetic

After an arithmetic expression is computed, the result is displayed, and this result is available in the Ans variable. For normal arithmetic, the result is a number. If the expression is followed by a STO> command, this number is stored in the stated variable, it is displayed, and it is also stored in Ans.
    5 + 7
             12
    Ans + 1
             13
    4 STO> X
             4
    2 + 8
             10
    X + Ans
             14
If the result of an expression is a list, the entire list is displayed and the entire list is available in the Ans variable.
    {2,5,3}
             {2 5 3}
    Ans STO> L1
             {2 5 3}
    L1
             {2 5 3}

### Single Items in a List

To access or change a single item from a list, use the list variable followed by the item number in parentheses.
    {2,7,4,9} STO> L1
             {2 7 4 9}
    L1(3)
             4
    8 STO> L2(3)
             8
    L2
             {2 7 8 9}
One way to put another item on the end of the list is to store the value in the next item number.
    L2
             {2 7 8 9}
    6 STO> L2(5)
             6
    L2
             {2 7 8 9 6}
    L2(1) + L2(4) STO> L2(6)
             11
    L2
             {2 7 8 9 6 11}

### Arithmetic with a List and a number

The operations that use two real numbers can also be done on a number and a list. The number operates on each of the items in the list.
Addition
    5 + {1,2,3}
             {6 7 8}
Subtraction
    5 - {1,2,3}
             {4 3 2}
If L1 is {7,8,9}
    L1 - 5
             {2 3 4}
Multiplication
    {1,2,3} * 5
             {5 10 15}
Division
    {6,8,10} / 4
             {1.5 2 2.5}
    60 / {3,4,5}
             {20 15 10}
    {10,12,15} / 6 >Frac
             {5/3 2 5/2}
Exponents
    L1 ^ 2
             {49 64 81}
    3 ^ {2,3,5,6}
             {9 27 243 729}
Roots (MATH 5)
    3 ${\sqrt[{x}]}$ {27,64,1000}
             {3 4 10}
    {3,4,6} ${\sqrt[{x}]}$ 4096
             {16 8 4}
Set the decimal places to 2 (MODE down right right right)
    12 ${\sqrt[{x}]}$ {2,6,16}
             {1.06 1.16 1.26}

### Arithmetic with 2 Lists

All the arithmetic operations can be used with two lists. When two or more lists are used in an expression, each list must have the same number of values, or an error will occur. Each of the numbers in one list operates on the corresponding number in the other list. The result is a list of the same length.
Addition
    {3,5,6} + {6,2,1}
             {9 7 7}
Subtraction
    {3,5,6} - {6,2,1}
             {-3 3 5}
Multiplication
    {3,5,6} * {6,2,1}
             {18 10 6}
Division
    {3,5,6} / {6,2,1}
             {.5 2.5 6}
Exponents
    {3,5,6} ^ {6,2,1}
             {729 25 6}
Roots
    {3,5,6} ${\sqrt[{x}]}$ {6,2,1}
             {1.82 1.15 1.00}
Multiple operations
    {5,4}({2,5}+{3,9})
             {25 56}

### Arithmetic Functions with Lists

All of the functions that work on real numbers can also work on a list of numbers. The result will be a list of the same length. In these examples the decimal place has been set to 2.
Square root
    ${\sqrt}$({2,3,4})
             {1.41 1.73 2.00}
Logarithms
    log({2,3,4})
             {.30 .48 .60}
    ln({2,3,4})
             {.69 1.10 1.39}
Exponential
    e^({2,3,4})
             {7.39 20.09 54.60}
Trigonometric (in radians)
    sin({2,3,4})
             {.91 .14 -.76}
    tan $^{-1}$({2,3,4})
             {1.11 1.25 1.33}
Miscellaneous
    abs({2,-2})
             {2 2}
    round({π,e^(1),9/7},2)
             {3.14 2.72 1.29}
The functions that normally need two numbers can work on two lists or a list and a number. The length of the result will match the length of the list used.
    min({4,3},{5,1})
             {4 1}
    gcd({32,27},36)
             {4 9}
    6 nCr {2,3,4}
             {15 20 15}
Each list created as the result of an operation is available using the previous Ans.
    2{5,8} STO L1
             {10 16}
       3{4,2}
             {12 6}
       Ans+L1
             {22 22}

### Links

    Previous: Creating Lists
    Next: List Operation Functions
    Back to: TI-Lists