## 6.13 Tutorial: Setting Margin of Tolerance in Non-numeric Questions

For an introduction to the concept of *margin of error*, see *Controlling Answer Tolerance*.

For basic information on the system plus or minus operator, "**?**", see *Setting a Margin of Error in Non-numeric Questions*.

You can specify an absolute error using the **?** operator.

**x ? y** represents **x +/- y**.

**2.12 ? 0.01 **

specifies a margin of error of +/- **0.01** in the answer. The answer matches any response between **2.11** and **2.13** (inclusive). For example, the system grades **2.114** or **2.123456789**, as well as **2.11** and **2.13**, correct.

**2.1J ? 0.25J **

specifies a margin of error of +/- **0.25J**. The system grades correct any response between **1.85J** and **2.35J**. The error must have the same dimension as the correct answer.

**cos(pi/6) ? 1000 **

specifies a margin of error of +/- **1000**. The system grades correct any response between **cos(pi/6)-1000** and **cos(pi/6)+1000**, approximately between **-999.1339746** and **1000.866025**.

You can also specify a percentage error using the **?** operator.

**x (1 ? y)** represents **x +/- x*y**.

**1.52 (1 ? 0.025)**

specifies a margin of error of **2.5%**. The system grades correct any response between **1.444** and **1.596**.

**50 (1 ? 1.1)**

specifies a margin of error of **110%**. The system grades correct any response between **-5** and **105**.

You can use a margin of error with answers that are algorithmic variables. Consider a question in which the correct answer is assigned to **$answer**.

**Example 6**

To specify an absolute margin of error of **0.1**, use:

**$answer ? 0.1
**

To specify a percentage margin of error of **3%**, use:

**$answer (1 ? 0.03)**

** **

### Using the ? Operator in Complex Expressions

You can use the **?** operator in complex expressions. It is an arithmetic operator.

**Example 8**

**2.12?0.01 **

matches any response between **2.11** and **2.13** and

**2*(2.12?0.01) **

matches any response between **4.22** and **4.26**.

**Example 9**

The ordinary rules of arithmetic (for example, the distributive rule) apply.

**2*(2.12?0.01) **

is equivalent to:

**(2*2.12)?(2*0.01) **

**Example 10**

You can specify very complicated ranges of numbers.

**((2.17 ? 0.01) + e^(1.07?2.03))/(1? 0.5)**

**2 + 2 * (1 ? 0.05) **

which defines a tolerance of **5%** of **2**, is different from:

**(2 + 2) * (1 ? 0.05) **

which defines a tolerance of **5%** of the sum **4**.

**See Also:**

*Controlling Answer Tolerance*