Skip to main content
When to use the default Algebraically Equivalent check?
Thijs Gillebaart avatar
Written by Thijs Gillebaart
Updated over a week ago

Grasple has multiple check methods using the Computer Algebra System (CAS) which can be used within the editor to indicate when the answer of a student should be marked correct/incorrect. A full list of current options can be found in this article.

This article covers the default Algebraically Equivalent check. There are three sections in this article:

  1. When to use the Algebraically Equivalent check?

  2. How does the Algebraically Equivalent check work?

  3. Basic Examples

  4. Specific Examples

  5. What to do if you want a stricter check?

When to use the Algebraically Equivalent check?

If you want to check whether a student answer is mathematically equal to the correct answer, you should use this check. A simple example would be: "x+x" is considered algebraically equivalent to "2*x".

You can apply this method to:

  • exact numbers (e.g. 3 or pi)

  • complex numbers (e.g. 2i+3)

  • formulas (e.g. 3x+4)

  • equations and relations (e.g. y=3x+4 or x > 3)

  • vectors and matrices

  • unordered collections/lists (e.g. [2,3,4])

  • Sets (e.g. {1,2})

  • Intervals (e.g. [1,6))

  • Logic expressions

  • Points/coordinates (e.g. (1,2,0) )

How does the Algebraically Equivalent check work?

The check uses the CAS to check whether the left-hand-side (student answer dependent value - RHS ) is equivalent to the right-hand-side (the answer defined by the teacher - LHS ). Equivalency is defined via the following logic:

  • First the left-hand-side and the right-hand-side are simplified. Simplification means that algebraic expressions are simplified (1+1 is simplified to 2 and x+x is simplified to 2x) and functions are evaluated (e.g. sin(pi/2) is evaluated/simplified to 1). This evaluation ensures we compare both the left-hand-side and right-hand-side in their "simplified" form.

  • We do not evaluate operations such as integrals, sums, products, matrix inverses, etc. These are considered operations and not functions to simplify and/or evaluate.

  • Simplification is done using the mathematical rules within sympy.

  • Finally, the left-hand-side and right-hand-side are subtracted from each other and checked whether the result equals zero.

There are some specific situations to be aware of. Please read these carefully and look at the specific examples to get a better understanding on how this check works.

  • For equations it is checked if the equation on the right-hand-side is the equation of the left-hand-side multiplied by a non-zero constant. Both equations are transformed to an equation of 0 = RHS - LHS and from these equations the right-hand-sides are used to check whether one is the other multiplied by a constant.

  • If the student answer is an equation in the form y = x, but the teacher answer is 2x (and thus not an equation), the equivalence check will check if x (the right hand side of the equation provided by the student) is equivalent to 2x.

  • For matrices and vectors the same check as for numbers and formulas is applied per vector/matrix entry.

  • For unordered collections the same check as for numbers and formulas applies per entry, but the order of the entries on the left and right side do not have to match.

Find our more specifics in the Specific Examples below.

Basic Examples

Below are two sets of the basic example cases: one for which the Algebraically Equivalent check will indicate the left- and right-hand-side are the same and one for which the Algebraically Equivalent check will indicate the left- and right-hand-side are not the same.

Specific Examples

In this section more specific examples are given for different areas within mathematics.

In the next section you can read more on what the general approach of our CAS system is and how this is applied on all expressions. In short we subtract the left hand side (e.g. answer given by the student - LHS ) from the right hand side (e.g. answer provided by the teacher - RHS ) and simplify this expression using the open source CAS system we use (Sympy).

NOTE: In all situations the general simplifications are made. So the expression "2+2" is equal to "4" also when the same expression is present in a matrix, list, set, point, etc.

Below examples of equivalency are provided for the following mathematical areas:

  • Trigonometry

  • Complex numbers

  • Relations

  • Matrix/vectors (i.e. linear algebra)

  • Sets and intervals

  • Logical Expressions and Boolean Algebra

  • Points / coordinates

Trigonometry

In short: for trigonometric expressions we simplify expressions to expressions/values without the trigonometric functions if possible. Below is a list of examples which should give you a good idea on

In general: if the trigonometric function of a certain argument can be expressed as a value without trigonometric functions, they are seen as equivalent.

Complex numbers

For complex numbers we consider the following cases also as equivalent

This means that we consider the sqrt(-1) to be equivalent to i, and also simplify exponential expressions to their trigonometric forms when comparing answers.

NOTE: be aware that these simplifications are combined with all other simplifications. This means that cos(pi/3) is equal to 1/2, also in a complex number.

Relations

For relations it is allowed to manipulate the LHS and RHS of the relationship and still be considered equivalent.

Examples on what is seen as equivalent are:

Matrix/vectors

For matrices and vectors, algebraic calculations are considered equivalent. So, just as multiplication and addition makes expressions like "x+x" be equivalent to "2x", these operations can also be applied to matrixes and vectors.

See below examples on what is seen as equivalent.

Sets and intervals

For the details on how to use sets and intervals in your exercises, please read the specific documentation: "Practicing with sets and / or intervals".

In that article examples are given of how equivalency is determined.

Logical Expressions and Boolean Algebra

For the details on how to use logical expressions and boolean algebra in your exercises, please read the specific documentation: "Logical Expressions and Boolean Algebra".

In that article examples are given of how equivalency is determined.

Points / coordinates

For the details on how to use sets and intervals in your exercises, please read the specific documentation: "Practicing with points / coordinates".

In that article examples are given of how equivalency is determined.

Operations

Operations such as integrals, sums, products, limits and matrix inverses are not seen as "simplifications". Therefore the evaluated version of the integral is not seen as equivalent to the integral itself. See below examples on how values are not seen as equivalent regarding these type of operations.

What to do if you want a stricter check?

If you want a stricter check on the answer provided by the student, please check out the following options:

Questions or feedback

Do you want to know more about this check, whether you should use it for your exercise or any of the other checks? Please let us know via the chat icon in the right bottom of the screen! We are glad to help you out on specific use cases.

Did this answer your question?