--- capa/capa51/pProj/Changes 2000/02/09 22:10:24 1.2 +++ capa/capa51/pProj/Changes 2000/08/30 15:02:30 1.3 @@ -1,4 +1,96 @@ + +New functions + + +array_min(array_name) +array_max(array_name) + +will calculate the min or max value from the +array given by array_name. All elements in +array array_name should be of numerical type, +if there is one element assigned a string value, +then array_min() and array_max() will give an +error, indicating that it could not calculate +the min or max value for strings. + +/LET arr[123]=123 +/LET arr[456]=456 +/LET arr[1]=1 +/LET arr[34]=34 +/LET arr[56]=56 +/LET arr[78]=78 +/LET arr[12]=12 +/LET arr[4]=4 +/LET arr["124"]=124 +/LET arr[1.2]=1.01234567 +/LET max = array_max(arr) +/LET min = array_min(arr) + +The results of max will be 456 and min will be 1. + + +array_moments(result_array, input_array) + + +/LET elements = array_moments(result_array, data_array) + +The input array is data_array and the calculated results will be placed in a newly +created array named result_array. This resulting array contains exactly five elements, +result_array[0] = number of elements in input array +result_array[1] = mean value of elements in input array +result_array[2] = variance of elements in input array +result_array[3] = skewness of elements in input array +result_array[4] = Kurtosis value of elements in input array + +Suppose all values in array data_array is denoted by $X$, +the $i$-th element in the array is denoted by $x_i$, and +the number of elements in the array is denoted by $n$. +The formula of mean value is given by $\Sigma_{i=0}^{n-1} x_i / n$. +Let $\mu$ represents the mean value of the array. +The variance is defined as $\frac{\Sigma_{i=0}^{n-1}(x_i - \mu)^2}{n-1}$. +The standard deviation of the array can be calculated by taking the square root +of variance. Let $\sigma$ denotes the standard deviation of the array. +Skewness is calculated from $\frac{\Sigma_{x=0}^{n-1}((x_i - \mu)/\sigma)^3}{n}$ +The Kurtosis value is from the formula +\frac{\Sigma_{i=0}^{n-1}(x_i - \mu)/\sigma)^4}{n} - 3$ +The constant $3$ is used to make the normal distribution appear to have a zero Kurtosis. + + +Formula answer + +As of CAPA 5.1, a new type of answer can be used by the instructor. +A formula as an answer to a problem. That is, the instructor defines a string of +formula and ask the students to enter the formula, as long as the entered formula +is equivalent to the answer formula, the CAPA system will check and +issue correctness or incorrectness based on their equivalence. +The underlying mechanism behind this type of answer is that besides the formula string, +two additional pieces of informations have to be provided +by the instructor, (1) the list of variables used in the answer string and +(2) the values of these variables to be used in evaluating formula equivalence. +Those two pieces of information are given within a pair of angle brackets appearing +as the right hand side of the keywork "eval =". + +The list of variables is entered as a string or a variable containing a +string value. Within that string, each variable is separated by a comma. +The symbol '@' then follows. +Two forms of variable values can be used. A string with comma separated numerical values +or two comma separated numerical values divided by a ':' symbol and followed by +a '#' symbol and an integer indicating the number of values to be +interpolated within the two values given previously. Both form can be replaced by +a variable containing the proper string value. + +Tolerence can be given to allow the instructor fine tune the results +of acceptable values when checking the equivalence of two formulae. + + +/LET f="x^2+y*y^(2)" +/LET vlist = "x,y" +/LET pts = "1,4:4,5#5" + +/ANS(f,str=FML ,eval = <"x,y" @ "-1.0,-1.0":"1,1"#4, pts, "0.0,0.0"> ,tol=1e-9) + +-- Fixed rad != 1/s in capaUnit.c add init_array() function to the user