Pages

Wednesday, December 14, 2011

Mathcalc8 Basis : list calculation

In this part three of the post, we will write about usage of list. List is another basic element of the calculator Mathcalc8. Mathcalc8 support list (you can call it vector or in spreadsheet program, column or row) arithmetic. A list is a set of numbers or complex numbers grouped together. For example, (1,2,3) is a list with three real numbers.We can pick up an item of a list easily when we assign an variable to a list such as a=(1,2,3). Now, to pick up the first item, we use a(0) which is 1. To pick out the second item, we use a(1) which is 2 and so on. Now suppose there is two lists called A and B. Below is a table that shows the operations of A and B that can be performed :

OperatorInput
+A+B
-A-B
xA*B
÷A/B
^pow(A,B)
modulomod(A,B)
most built-in functions support list :
eg. exponential
exp(A)

The most important point shown from the above table is that performing calculation between two lists is as easy as performing calculation between two numbers. We can also see that in standard vector calculation, there is not multiplication and division between two vectors. Insteads, there is two different operations for vectors. One is called dot product and the other is called vector product but they have different definition from list multiplication and division. So, list arithmetic is not the same as operations between vectors. Later, we will see that there is advantages in defining the list arithmetic in our own way. Now, Let us do some examples. (Note : some of the calculation below is not supported by the free version of the calculator) :
  1. (1,2,3)+(2,3,4)
    Input : (1,2,3)+(2,3,4)
    Ans. 3,5,7
     
  2. (1,2,3)-(2,3,4)
    Input : (1,2,3)-(2,3,4)
    Ans. -1,-1,-1
     
  3. (1,2,3)x(2,3,4)
    Input : (1,2,3)*(2,3,4)
    Ans. 2,6,12
     
  4. (1,2,3)÷(2,3,4)
    Input : (1,2,3)/(2,3,4)
    Ans. 0.5,0.667,0.75
     
  5. 1+(2,3,4)
    Input : 1+(2,3,4)
    Ans. 3,4,5
     
  6. 1-(2,3,4)
    Input : 1-(2,3,4)
    Ans. -1,-2,-3
     
  7. 2x(2,3,4)
    Input : 2*(2,3,4)
    Ans. 4,6,8
     
  8. 1÷(2,3,4)
    Input : 1/(2,3,4)
    Ans. 0.5,0.333,0.25
     
  9. (1,2,3)÷2
    Input : (1,2,3)/2
    Ans. 0.5,1,1.5
     
  10. (e1,e2,e3)
    Input : exp((1,2,3))
    Ans. 2.718,7.389,20.086
     
  11. (cos(1)+sin(1),cos(2)+sin(2),cos(3)+sin(3))
    Input : cos((1,2,3))+sin((1,2,3))
    Ans. 1.382,0.493,-0.849
     
  12. To take the statistics data such as mean,std dev. etc for a list (1,2,3,4,5)
    Input : stat((1,2,3,4,5))
    Ans. OK and a table of result is shown on the right-handed side of the calculator.
     
  13. To make a list of (0,1,2,3,4)
    Input : id(5)
    Ans. 0,1,2,3,4
     
  14. To make a list of (1,2,3,4,5)
    Input : 1+id(5)
    Ans. 1,2,3,4,5
     
  15. To make a list of (0,0.1,0.2,...,0.9,1)
    Input : id(11)/10
    Ans. 0,0.1,0.2,....,0.9,1
     
  16. To make a list of (5,5.1,5.2,...,5.9,6)
    Input : 5+id(11)/10
    Ans. 5,5.1,5.2,....,5.9,6
     

No comments:

Post a Comment

Note: Only a member of this blog may post a comment.