Using the evalf Command to Set the Value of the Digits Variable
The parameter n, which can be given as a second argument (evalf(expr, n)), sets the value of Digits for a single computation.
To round the exact answer, assign the exact answer to a dummy variable, and then use the evalf(expr,n) command in the evalb command to compare the student response to the rounded answer.
Calculate the quadratic mean of the following list of data: [695, 607, 511, 588, 710, 500, 682, 515, 709, 478, 497, 657, 652, 634, 488, 615, 714, 579, 589, 493, 584, 484, 503, 711, 622, 695]. The answer requires 5 significant digits.
- First calculate the exact numeric answer.
- Round it to the required number of significant digits. For example:
exact_answer:=evalf(Statistics[Mean](<695, 607, 511, 588, 710, 500, 682, 515, 709, 478, 497, 657, 652, 634, 488, 615, 714, 579, 589, 493, 584, 484, 503, 711, 622, 695>)):
rounded_answer:=evalf(exact_answer,5):
evalb($RESPONSE=rounded_answer);