CL for Multi-Variable Equation

I’m struggling to write what (in my mind) should be basic CL to help the following problem be self-checking on the dashboard. Any advice is appreciated!

The equation a + b = c could be true or false. Find new values of a, b, and c that make the equation true.

I currently have 3 individual math inputs on the slide, one for a, another b, last one for c and can’t get the CL to cooperate. I’m sure it’s user-error.

Any suggestions?

I would suggest doing this with a table rather than the three inputs because technically you shouldn’t attach the correctness sink to any one of those inputs (they all depend on the others.)

However, setting aside that, let’s say you’ve called your math input components a, b and c.

In a and b, just have the code readOnly: true so that Desmos will ignore them from the point of view of correctness.

Then in component c, you can do the actual correctness checking like this:

a_value = a.numericValue
b_value = b.numericValue
c_value = this.numericValue

correct: numericValue("${a_value} + ${b_value}") = c_value

(Incidentally you don’t actually need to give that c component a name either, since you can refer to it using this as in the above example.)

Hope this helps.

1 Like

This hugely helpful! Thanks, Bryn!

1 Like