Self Check 6+3sqrt2?

Hello - I have a table where students are solving equations with irrational solutions. I can’t seem to get the check to work when the solutions are 6+3sqrt2 and 6-3sqrt2. In the CL it is check 7 and check 8 with the image appearing in cell (4,4)

Thanks.

Matching latex never really turns out well. I took a totally different route.

Thanks Daniel - Some of your syntax is new to me so I’ll have to dig in. I have been learning by cherry picking off or other people.
I agree that moving the disableevaluation to the end is good. I thought that there must be a more efficient way to do that but don’t know if Desmos does loops…yet.

Thanks again - I really appreciate it - it looks like you re-wrote the whole thing! I am excited to get in there and figure it out.

Reggie

No loops unfortunately. I tried to leave comments for most things. Let me know if you have questions on specifics.

Daniel Grubbs-- thanks, this helped me in an activity I’m doing. I want to check for correctness based on the two x-intercepts being 9+sqrt31, 0 and 9-sqrt31, 0.

Here’s my link-- slide 7 part d.

Just double checking that in the 4 years since this post, this is still the best way to do this. I’m still just learning how to use CL, and it seems strange to me that I can’t directly check a numericValue that has a radical. Or maybe I’m not exactly understanding how Latex and all this works. Any guidance would be helpful! Thanks!

A numericValue is a decimal approximation of an expression. Latex is not much different than a string of characters. Latex matching requires you to consider different variations. CL won’t recognize the latex for 9+\sqrt{31} and \sqrt{31}+9 as equivalent.

I don’t always understand the calculations under the hood, but evaluative methods are more robust. You need to be careful that for any values that are not exact (i.e. non-terminating decimal values), you’re comparing within a tolerance. The downside of this is any equivalent value is accepted. Looking back at my solution, simply inputting values into the quadratic formula would be accepted as well.

Patterns can narrow the scope here and look for format, and even mitigate the need for explicit evaluation of the expression by looking for specific values in parts of the expression. This is not the only way, but here’s a way to approach Screen 8 using patterns. Note this only accepts the simplified form, while allowing 0 addends and 1 factors/coefficients.

Thanks for the response. I’ve gotta sit with your answer a little bit to understand it. But yeah, I’ve found patterns to be super useful. It’s a great addition.

Thanks for the input!

Oh wait, just realized you’re the same person who answered my other post from a few weeks ago introducing me to patterns. Thanks so much. Love the patterns feature as it’s solved a lot of the issues around getting equivalent answers not in the form that I wanted.

Ok, asking another question about Patterns in this thread because for some reason the other one I started with you closed for replies.

I can’t seem to get the correct pattern for having a leading negative in a factored quadratic. In slide 8 in this activity, I want the answer to be either -(x+6)(x-3) or -(x-3)(x+6), but I can only get the first option to work. Any suggestions about how to fix my code?

Thanks.

This would be my edit. The only minor thing is one negative product term, but it could be either term pattern. At first I was going to use .allowNegativeTerms with the sum pattern, but it would allow “-x”.

pTerm = p.anyOf(pTerm1, pTerm2)
pProduct = p.product(p.negative(pTerm),pTerm).allowParens

Hmmm, I tried inserting that code and couldn’t get it to work. Here’s my updated version (slide 8). What did I do wrong? When I test it by putting in -(x+6)(x-3) or -(x-3)(x+6), neither is showing as correct.

Also, I haven’t been able to find good documentation for patterns stuff. I’m trying to find anyOf and allowParens to better understand those commands, but can’t find them. Any recommendation on that?

Tim

Found it. Remove “p.negative( )” from pTerm1. That’s the reason I added p.negative to pProduct. Keeping it would force the sum to be the first term.

p.anyOf is useful when you want to give options for something. For pTerm, I’m allowing either term to be the sum or difference so that the negative can be attached to either.

Follow-up question: Do you want to allow students to enter any binomial product? Or only the correct ones? If the latter you can get more specific with your patterns:

pTerm1 = p.sum(X, p.integer.satisfies(`x=6`) )
pTerm2 = p.difference(X, p.integer.satisfies(`x=3`) )
pCorrect = p.anyOf( p.product(p.negative(pTerm1), pTerm2), 
                    p.product(p.negative(pTerm2), pTerm1) )

You can also add .strictOrder to sums and products if you don’t want to allow commutative equivalents (e.g. p.product(p.negative(pTerm2), pTerm1).strictOrder )