Intervals

Students can use intervals in answers, and the system will understand them as their equivalent inequality to compare it with the correct answer. Take into account the particular notation explained below to create these intervals in CalcMe.

Example

Consider the following question:

intervals_statement.png

with correct answer:

intervals_correctanswer.png

To make formulas like (0,1) interpreted as intervals, we must select the corresponding checkbox in Input options > Input syntax.

intervals_validation.png

Finally, as intervals are conceptually equivalent to inequalities but internally (in the Algorithm), they are different data types, we need to use the Equivalent equations validation method if we want students to answer either intervals or inequations. Alternatively, student answers must be the same type as the correct answer.

intervals_preview.png

Syntax

The intervals notation is quite particular. You can create several intervals with the syntax you can see below.

Table 2. Interval syntax

Interval

CalcMe word

Equivalent inequality

(a,b)LaTeX (a,b)

interval_open_open(a,b)

a<xx<b

(a,b]LaTeX (a,b\rbrack

interval_open_close(a,b)

a<xxb

[a,b)LaTeX \lbrack a,b)

interval_close_open(a,b)

axx<b

[a,b]LaTeX \lbrack a,b\rbrack

interval_close_close(a,b)

axxbLaTeX a\leq x\wedge x\leq b

(a,+)LaTeX (a,+\infty)

interval_open_open(a,+∞)

axLaTeX a\leq x>

normalℝLaTeX \mathbb{R}

normalℝLaTeX \mathbb{R}

{a}LaTeX \{a\}

{a}

x=aLaTeX x=a

{a,b,c}LaTeX \{a,b,c\}

{a,b,c}

x=ax=bx=cLaTeX x=a\vee x=b\vee x=c

LaTeX \varnothing

{}

false



Furthermore, it is also possible to do operations with intervals.

Operation

Example

Union

(a,b)(c,d)LaTeX (a,b)\cup(c,d)

Intersection

(a,b)(c,d)LaTeX (a,b)\cap(c,d)

Difference

(c,d)(a,b)LaTeX (c,d)\setminus(a,b)

Complementary

normalℝ(a,b)LaTeX \mathbb{R}\setminus(a,b)

The student answer can have operations, and it will be simplified and compared with the correct answer. If you want to prevent this, set Simplified in Validation options > Simplification, as usual.

intervals_simplified.png

If you want to make an algorithm for a question with intervals, you can not use the interval symbols directly; you must use the corresponding CalcMe word for them. See the table above. There are commands that return intervals; for instance domain_set(). Other commands return inequations; for instance domain(). You can convert the result from inequations to intervals using expression_to_set().

logic_and_sets.intervals.calc.png