"PolynomialResult" (Comparison Method)

Compare mathematical expressions in a way suitable for exercises about polynomials, allowing reordering of factors but no other computation.

Details

  • The polynomial comparison method only considers two polynomials to be equivalent if they are equal and they are factored into the same terms. Expanded forms are not considered equivalent to factored forms.
  • Answers are considered correct even if terms are differently ordered or negative signs are differently distributed.
  • The values of the key and answer can both be specified as held expressions Hold[expr] to maintain the values exactly as they were given. Even when the values are held, reordering transformations are performed to determine equivalence during assessment, but no computation is allowed.

Examples

open allclose all

Basic Examples  (1)

Create an AssessmentFunction for a polynomial question:

Use it to assess an answer:

The expanded form of the same polynomial is not considered correct:

Scope  (3)

Create an assessment function for the question "Expand the polynomial (x+y)^2(x-y)^2":

Supplying the original question is not considered correct:

Equivalent polynomials that differ by reordering are considered correct:

Polynomials differing by arithmetic are considered different:

Polynomials differing only by placement of negative signs are considered equivalent:

Generalizations & Extensions  (1)

Create a polynomial QuestionObject:

Attempting to provide the solution as code will give an incorrect answer:

Properties & Relations  (4)

Arbitrary operations are not performed in held answers:

Global definitions of variables are ignored during assessment:

If two polynomials are equal but differently factored, the "PolynomialResult" comparison method will give an incorrect assessment:

The "CalculusResult" comparison method will give a correct assessment:

Define a polynomial assessment including a constant coefficient:

Answers are considered correct for any factoring of the coefficient: