Check Algebraic Expression Answer

Thanks. I’m not actually part of the Desmos team, just a user who enjoys the coding puzzles and helping people out.

First, you can use countNumberUsage to identify specific expressions. (See post 6 in this thread).

Second, if you have equivalent expressions, you could just create a function that is the difference of the two. Being equivalent, any value of x should evaluate to zero.
Say you want a student to simplify exp1 in a math input.

exp1=`4x-2x+5`
f= simpleFunction("${exp1} - (${this.latex})")
correct: f.evaluateAt(0)=0 and f.evaluateAt(1)=0 and f.evaluateAt(2)=0
           and countNumberUsage(this.latex,2)=1 
           and countNumberUsage(this.latex,5)=1
           and countNumberUsage(this.latex)=2

It’s also easier to check more values using a table in a graph than to use evaluateAt in the CL.

1 Like