Skip to main content

Plus/Minus operator

It is possible to perform computations with the ±\pm operator, as explained here. Therefore, the student can use the ±\pm symbol. Recall that the result of the ±\pm operator is a list (not a set!).Plus Minus

Example 1: Simple equation

Let us start with an easy example: solve the equation x2-2=0. We simply write as correct answer ±2.

grading_correctanswer1.png

As we already mentioned, it is interpreted as a list: ±2={2,-2}\pm\sqrt2=\left\{\sqrt2,-\sqrt2\right\}; this means that the order matters and both options are enclosed in braces. Therefore, we have to change the default settings to allow the students to answer with any correct syntax:

  • Braces are not necessary: Input options > Input syntax > Lists without enclosers.

grading_input.png
  • The order is not important: Validation options > Comparison with student answer > Repetition matters in lists, but order does not.

grading_validation.png

Finally, we can test the behaviour.

grading_preview1.gif

Example 2: Complex expression

A well-known expression is a formula for solving the second-order degree polynomial. For instance, the roots of the polynomial x2+bx+cx^2+bx+c are given by -b±b2-4c2\frac{-b\pm\sqrt{b^2-4c}}2. Let us ask the student to write this expression.

The correct answer will be

grading_correctanswer2.png

As before, we have to change the default settings to allow the students to answer with any correct syntax:

  • Braces are not necessary: Validation > Options for general > Lists always need curly brackets "{}".

grading_input.png
  • The order is not important: Validation > Comparison with student answer > Compare as sets.

grading_validation.png

Finally, we can test the behaviour.

grading_preview2.gif