Numbers representation, tolerance and precision

In this page you will find out how integers and decimal numbers are treated in CalcMe. You can also find a detailed explanation of Precision and Tolerance. You can choose between different options for the Notation used when displaying numbers. Finally, you can specify answers with repeated decimals or with a concrete number of decimal places or significant figures.

WIRIS does calculations in exact mode, and only falls to approximate mode when any decimal number is involved. A decimal number is a number that has a decimal mark. A number without decimal mark is an integer. Examples of exact expressions that are not integer numbers are: 1 half, pi, square root of 2, ...

You can convert an exact expression to approximate by making a simple operation with a decimal number, like multiply by 1.0.

Wiris CAS CalcMe

Beware that, despite the correct answer beeing an integer, the student can always answer a decimal number close enough, and it will be graded as correct. If you want to force the student to answer an integer, you better set Integer form.

Also note some WIRIS commands sometimes return an exact number and sometimes an approximate one. For example: atan(), integrate(), solve(),... Keep this in mind when programming the algorithm in Variables.

Wiris CAS CalcMe

A decimal number is a number that has a decimal mark. Decimal numbers are shown using Precision setting, and are compared using Tolerance setting. What is understood as decimal mark depends on the modes General and Quantity.

  • General: Decimal mark is exclusively the dot. Decimal mark must be inside the number, not at sides; leading and trailing decimal marks are not allowed.
  • Quantity: By default, all dots, commas and apostrophes are understood as decimal marks. Leading and trailing decimal marks are allowed.

Precision is the number of significant figures or decimal places of variables shown after calculations. That is, calculations are made internally with full precision, and at the end they are rounded to the set precision. Precision affects the decimal numbers shown in wordings, feedback, and so. Max precision is 15. When rounding, the rule used for tie-breaking is half-up.

Consider the number 12.345

Precision Rounded to significant figures Rounded to decimal places
6 12.345 12.345000
5 12.345 12.34500
4 12.35 12.3450
3 12.3 12.345
2 12 12.35
1 12 12.3

Precision is not the allowed deviation between student and correct answers; that is Tolerance. But precision can have a bad impact in the comparison, if set improperly. Precision affects the correct answer, how it's shown to the student, but also the actual value. The student answer will be compared with the correct answer, that has been rounded using precision. If precision number is smaller than tolerance number, then good student answers will probably be graded as bad. That's because if the precision number is small, then the correct answer will be rounded too much, probably outside the tolerance range. So remember to set the precision number always greater than the tolerance number. Also note the precision does relate approximately with the relative tolerance, but does not relate directly to the absolute tolerance. There is a warning about this point.

Tolerance number is used to compare the student answer and the Correct answer. Denote by s a the student's answer, c a the correct answer, and n the tolerance.

Percent error

The student answer has an n percent sign error margin with respect to the correct answer. An answer will be marked as correct if it satisfies

fraction numerator vertical line c a minus s a vertical line over denominator vertical line c a vertical line end fraction less than n times 0.01

For instance, if the correct answer is 12.345

Percent error Interval of acceptance
10 left parenthesis 11.1105 comma 13.5795 right parenthesis
1 left parenthesis 12.22155 comma 12.46845 right parenthesis
0.1 left parenthesis 12.332655 comma 12.357345 right parenthesis
0.01 left parenthesis 12.3437655 comma 12.3462345 right parenthesis

Absolute error

The student answer has a margin of error of n. An answer will be marked as correct if it satisfies

vertical line c a minus s a vertical line less than n

For instance, if the correct answer is 12.345

Absolute error Interval of acceptance
1 left parenthesis 11.345 comma 13.345 right parenthesis
0.1 left parenthesis 12.245 comma 12.445 right parenthesis
0.01 left parenthesis 12.335 comma 12.355 right parenthesis
0.001 left parenthesis 12.344 comma 12.346 right parenthesis

Significant figures

Check that the first n significant figures of student and correct answers are identical. An answer will be marked as correct if it satisfies

text trunc end text left parenthesis c a times 10 to the power of m right parenthesis equals text trunc end text left parenthesis s a times 10 to the power of m right parenthesis

where m is such that 10 to the power of n minus 1 end exponent less or equal than c a times 10 to the power of m less than 10 to the power of n, and text trunc end text is the truncation function.

For instance, if the correct answer is 19.586

Student answer
Significant figures 20.01 19.6 19.59 19.58
1
2
3
4

Decimal places

Check that the first n decimal places of student and correct answers are identical. An answer will be marked as correct if it satisfies

text trunc end text left parenthesis c a times 10 to the power of n right parenthesis equals text trunc end text left parenthesis s a times 10 to the power of n right parenthesis

where text trunc end text is the truncation function. For instance, if the correct answer is 19.586

Student answer
Decimal places 19.6 19.59 19.587 19.586
1
2
3

These notations apply only to decimal numbers. Numbers and expressions without a decimal point in them are exact, and so these notations don't apply to them. You can always convert an exact expression to decimal by multiplying by 1.0 for instance.

Auto

Auto is the default notation if you use significant figures in Precision setting. Auto notation chooses the best format for wach type of values: most numbers are shown without changes but very big or small ones are shown in scientific notation. Decimal trailing zeros are removed too.

If you are using p significant digits as precision, the floating number x will be shown in scientific notation when open vertical bar x close vertical bar greater than 10 to the power of p or open vertical bar x close vertical bar less than 10 to the power of negative 4 end exponent. Note that this does not apply to integer numbers.

Decimal

Decimal notation is like Auto but never shows scientific notation. Note that this notation can produce numbers with lots of digits. For example, you will see 1. times 10 to the power of 99 in Algorithm, but you will get actually a long number of hundred digits.

This is the only option when working with decimal places as precision.

Scientific notation

Scientific notation always shows numbers in normalized scientific notation, also called exponential notation.

Precision number here means significant digits of the mantissa to show.

Consider 6.023 times 10 to the power of 23 as correct answer. In General mode as allowed input, the only accepted notation is 6.023 times 10 to the power of 23. If you want to allow students answering in other formats you must use Quantity in Validation > Allowed input setting instead. This way 6.023 E 23 is also accepted. To allow the lowercase e, untick its box in Validation > Options for quantity > Constants.

Note that the following answers are not OK:

  • 12.3e+2: because there are too many digits before the decimal point
  • 1.0 e+2: because there is an extra space in the middle

As any other assertion, we can choose if the student answer has a concrete number of significant figures or decimal places.

Imagine that we want the student to ask with 1 number after the decimal point. Suppose that the correct answer is 21.5, then

WIRIS Quizzes understands decimal numbers with repeating decimals. Repeating decimals is a notation used to represent decimal numbers with periodic expansion, that is, rational numbers. There are 3 symbols available to mark repeating decimals; you can use any of them. The system is smart enough to know that 0.3 33 with overparenthesis on top equals 0.3 with overparenthesis on top, and of course that 0.9 with overparenthesis on top equals 1.

What questions can we do today?

Students can answer numbers with repeating decimals at any time

Students can answer numbers with repeating decimals at any time. The system will recognize it like any other decimal number. If the answer fits the Validation criteria (Tolerance, Mathematically equal, ...) then it will be graded as Correct.

Constant number with repeating decimals

Teachers can set for a Correct answer a constant number with repeating decimals. The student can answer any number, with or without repeating decimals, even a fraction, and it can be graded as correct, depending on the Validation criteria.

Use of "Literally equal"

At present there is no Additional property to validate if a student answer has or has not repeating decimals. But you can use Literally equal to check if the student answer and the correct answer have the same form, that is, if they both have or have not repeating decimals.

Repeating decimals

At present you can not generate variables with repeating decimals.

LIVE DEMO