# \#patterns

**URL:** https://cl.desmos.com/tag/patterns/25.md

[Latest](https://cl.desmos.com/latest.md) · [Categories](https://cl.desmos.com/categories.md) · [Tags](https://cl.desmos.com/tags.md)

---

## [Checking correctness of an equation](https://cl.desmos.com/t/checking-correctness-of-an-equation/2116)

<div class="topic-metadata">

**Author:** [@Alyshea\_Moore](https://cl.desmos.com/u/Alyshea_Moore)\
**Replies:** 8\
**Last updated:** [February 27, 2026, 2:02pm UTC](https://cl.desmos.com/t/checking-correctness-of-an-equation/2116 "2026-02-27T14:02:30Z")

</div>

I want students to be marked correct when they type in math input the equation y = 30x-6 as well as equivalent forms of slope such as y = 60/2 x -6. How do I do this in CL?

---

## [Pattern Match the +- symbol](https://cl.desmos.com/t/pattern-match-the-symbol/8355)

<div class="topic-metadata">

**Author:** [@H\_Kiamil](https://cl.desmos.com/u/H_Kiamil)\
**Replies:** 4\
**Last updated:** [November 3, 2025, 4:00pm UTC](https://cl.desmos.com/t/pattern-match-the-symbol/8355 "2025-11-03T16:00:54Z")

</div>

Hello, I have not been able to pattern match for the plusminus symbol. Can anyone help me? Eg I would like students to have to include it in their answer to the final slide of this activity: Changing the Subject • Act…

---

## [Pattern matching sums with positive and negative terms](https://cl.desmos.com/t/pattern-matching-sums-with-positive-and-negative-terms/8354)

<div class="topic-metadata">

**Author:** [@H\_Kiamil](https://cl.desmos.com/u/H_Kiamil)\
**Replies:** 1\
**Last updated:** [November 3, 2025, 3:52pm UTC](https://cl.desmos.com/t/pattern-matching-sums-with-positive-and-negative-terms/8354 "2025-11-03T15:52:51Z")

</div>

Hello, I am stuck trying to pattern match to sums with positive and negative terms. This is my activity so far: Changing the Subject • Activity by H Kiamil Could someone help me with page 6 (titled Question 5) please? …

---

## [Student Feedback Matching Latex and Random Numbers](https://cl.desmos.com/t/student-feedback-matching-latex-and-random-numbers/8315)

<div class="topic-metadata">

**Author:** [@rdunn](https://cl.desmos.com/u/rdunn)\
**Replies:** 5\
**Last updated:** [October 20, 2025, 7:16pm UTC](https://cl.desmos.com/t/student-feedback-matching-latex-and-random-numbers/8315 "2025-10-20T19:16:16Z")

</div>

I cannot get the CL correct to match the latex in the student’s input so that they receive the “correct” response. Any suggestions are appreciated.

---

## [Trouble generating feedback based on student input](https://cl.desmos.com/t/trouble-generating-feedback-based-on-student-input/8204)

<div class="topic-metadata">

**Author:** [@orel\_komemi](https://cl.desmos.com/u/orel_komemi)\
**Replies:** 1\
**Last updated:** [September 19, 2025, 6:33pm UTC](https://cl.desmos.com/t/trouble-generating-feedback-based-on-student-input/8204 "2025-09-19T18:33:59Z")

</div>

Hello everyone, I’m having trouble creating feedback for a student based on their input. I have a math response box component named exp2 and a text component named note. In the CL of exp2 I wrote: correct = (this.lat…

---

## [Validating latex strings are numbers](https://cl.desmos.com/t/validating-latex-strings-are-numbers/8106)

<div class="topic-metadata">

**Author:** [@eeyore](https://cl.desmos.com/u/eeyore)\
**Replies:** 10\
**Last updated:** [August 2, 2025, 10:02pm UTC](https://cl.desmos.com/t/validating-latex-strings-are-numbers/8106 "2025-08-02T22:02:55Z")

</div>

I’m validating input from a MathInput component to ensure the student entered a NUMBER. I get unexpected results for input of the form 2x (any pos/neg number in front of the x with/without a space in between). This isn’…

---

## [Check for slope-intercept form?](https://cl.desmos.com/t/check-for-slope-intercept-form/7969)

<div class="topic-metadata">

**Author:** [@ASmith](https://cl.desmos.com/u/ASmith)\
**Replies:** 3\
**Last updated:** [June 4, 2025, 10:28pm UTC](https://cl.desmos.com/t/check-for-slope-intercept-form/7969 "2025-06-04T22:28:51Z")

</div>

I’ve seen some discussions about checking slope intercept form. But the provided codes seem to check that the line is correct based on slope and intercept. Example: This activity checks the slope and y-intercept Slope I…

---

## [Complex numbers in desmos](https://cl.desmos.com/t/complex-numbers-in-desmos/4688)

<div class="topic-metadata">

**Author:** [@Ryan\_Crowder](https://cl.desmos.com/u/Ryan_Crowder)\
**Replies:** 13\
**Last updated:** [June 2, 2025, 3:36am UTC](https://cl.desmos.com/t/complex-numbers-in-desmos/4688 "2025-06-02T03:36:54Z")

</div>

Hello, My name is Ryan and I use desmos frequently in my classroom. I was wondering if there is any way to place imaginary numbers or complex numbers into desmos like you can with the TI calculators when you change the m…

---

## [Problem with patterns (when slope 1 or is negative)](https://cl.desmos.com/t/problem-with-patterns-when-slope-1-or-is-negative/7926)

<div class="topic-metadata">

**Author:** [@Terry\_Silveus](https://cl.desmos.com/u/Terry_Silveus)\
**Replies:** 4\
**Last updated:** [May 19, 2025, 6:20pm UTC](https://cl.desmos.com/t/problem-with-patterns-when-slope-1-or-is-negative/7926 "2025-05-19T18:20:38Z")

</div>

Slide 2 When the correct slope is 1 or is a negative it incorrectly says it is incorrect (when entered as a fraction). Can someone help me see why. I have tried to include patterns.negative, but it doens’t help. I’m…

---

## [Pattern matching with parentheses](https://cl.desmos.com/t/pattern-matching-with-parentheses/7935)

<div class="topic-metadata">

**Author:** [@Terry\_Silveus](https://cl.desmos.com/u/Terry_Silveus)\
**Replies:** 2\
**Last updated:** [May 18, 2025, 9:02pm UTC](https://cl.desmos.com/t/pattern-matching-with-parentheses/7935 "2025-05-18T21:02:48Z")

</div>

I need my students to be able to specifically enter parentheses in their equation and then validate that they entered it correctly. I want to take it step by step so I give them d^3 + (c^2 - 2) when d is 2/5 and c is -…

---

## [Pattern Matching](https://cl.desmos.com/t/pattern-matching/2972)

<div class="topic-metadata">

**Author:** [@JayChow](https://cl.desmos.com/u/JayChow)\
**Replies:** 55\
**Last updated:** [May 17, 2025, 9:34pm UTC](https://cl.desmos.com/t/pattern-matching/2972 "2025-05-17T21:34:27Z")

</div>

There have been quite a few questions recently about the pattern type in the CL documentation, so I thought I’d record a few short videos to help you get started. I’ll share here each time a new video is posted, and we’l…

---

## [Can Pattern Matching Be Used to Parse Time Format?](https://cl.desmos.com/t/can-pattern-matching-be-used-to-parse-time-format/7855)

<div class="topic-metadata">

**Author:** [@Adam.Kelly](https://cl.desmos.com/u/Adam.Kelly)\
**Replies:** 1\
**Last updated:** [March 26, 2025, 9:20pm UTC](https://cl.desmos.com/t/can-pattern-matching-be-used-to-parse-time-format/7855 "2025-03-26T21:20:10Z")

</div>

If I have a math response component where students type answers in HH:MM:SS format, is there a way for me to get the numericValue of the minutes and seconds?

---

## [Pattern Matching for Checking Correctness](https://cl.desmos.com/t/pattern-matching-for-checking-correctness/7837)

<div class="topic-metadata">

**Author:** [@Adam.Kelly](https://cl.desmos.com/u/Adam.Kelly)\
**Replies:** 1\
**Last updated:** [March 21, 2025, 1:31pm UTC](https://cl.desmos.com/t/pattern-matching-for-checking-correctness/7837 "2025-03-21T13:31:23Z")

</div>

My CL is not working, specifically it says equality does not work for “Numerator=72” and “Denominator=13” p=patterns Numerator = p.fraction(p.integer,p.integer).parse(this.latex).numerator Denominator = p.fraction(p.i…

---

## [Is there a way to get the first three characters of a string value?](https://cl.desmos.com/t/is-there-a-way-to-get-the-first-three-characters-of-a-string-value/7797)

<div class="topic-metadata">

**Author:** [@Terry\_Silveus](https://cl.desmos.com/u/Terry_Silveus)\
**Replies:** 5\
**Last updated:** [March 11, 2025, 4:32pm UTC](https://cl.desmos.com/t/is-there-a-way-to-get-the-first-three-characters-of-a-string-value/7797 "2025-03-11T16:32:28Z")

</div>

Or is there a better way to do this. I’m trying to randomize the adding or subtracting in scientific notation. I can use pattern matching to see if the student input their answer in scientific notation, but to check to…

---

## [simpleFunction evaluateAt result not giving me correct feedback](https://cl.desmos.com/t/simplefunction-evaluateat-result-not-giving-me-correct-feedback/7775)

<div class="topic-metadata">

**Author:** [@Adam.Kelly](https://cl.desmos.com/u/Adam.Kelly)\
**Replies:** 4\
**Last updated:** [February 28, 2025, 5:20pm UTC](https://cl.desmos.com/t/simplefunction-evaluateat-result-not-giving-me-correct-feedback/7775 "2025-02-28T17:20:32Z")

</div>

compinp = simpleFunction(parseEquation(this.latex).rhs, x) compinppi = compinp.evaluateAt(numericValue(\\pi)) compinpe = compinp.evaluateAt(numericValue(e)) compans = simpleFunction(5\\left(5x-x^{2}\\right)-\\left(5x-x^{2…

---

## [How to Use patterns.prime](https://cl.desmos.com/t/how-to-use-patterns-prime/7617)

<div class="topic-metadata">

**Author:** [@Alexander\_3691](https://cl.desmos.com/u/Alexander_3691)\
**Replies:** 3\
**Last updated:** [January 3, 2025, 3:24am UTC](https://cl.desmos.com/t/how-to-use-patterns-prime/7617 "2025-01-03T03:24:07Z")

</div>

Hi Everybody, Does anybody know how to use the function patterns.prime? The CL does not offer any suggestions after “prime”.

---

## [Checking Latex FUNCTION input for correctness](https://cl.desmos.com/t/checking-latex-function-input-for-correctness/7358)

<div class="topic-metadata">

**Author:** [@Savannah\_Eng1](https://cl.desmos.com/u/Savannah_Eng1)\
**Replies:** 2\
**Last updated:** [November 10, 2024, 10:20pm UTC](https://cl.desmos.com/t/checking-latex-function-input-for-correctness/7358 "2024-11-10T22:20:17Z")

</div>

Activity: \[Copy of\] Unit 3 Intro: Visual Patterns (B) • Activity by Savannah Eng Focus on Slide 3. The original activity has a box popping up after placing inputs into the table. In the new latex (InputEquation), the …

---

## [Correct Answer as Fraction](https://cl.desmos.com/t/correct-answer-as-fraction/7385)

<div class="topic-metadata">

**Author:** [@luksetik](https://cl.desmos.com/u/luksetik)\
**Replies:** 3\
**Last updated:** [October 17, 2024, 3:09pm UTC](https://cl.desmos.com/t/correct-answer-as-fraction/7385 "2024-10-17T15:09:05Z")

</div>

I would like the correct: 1/3 But fractions have to be typed a certain way. How can I have the fraction be the correct answer?

---

## [Patterns.negtive](https://cl.desmos.com/t/patterns-negtive/7387)

<div class="topic-metadata">

**Author:** [@Itzik](https://cl.desmos.com/u/Itzik)\
**Replies:** 2\
**Last updated:** [October 12, 2024, 6:33am UTC](https://cl.desmos.com/t/patterns-negtive/7387 "2024-10-12T06:33:26Z")

</div>

please advise how can I define a pattern to negative exponent. i.e. -(x+1)^2 thanks Itzik

---

## [How to check student answers in table that involve fractions with variables?](https://cl.desmos.com/t/how-to-check-student-answers-in-table-that-involve-fractions-with-variables/7360)

<div class="topic-metadata">

**Author:** [@barbra.steinhurst](https://cl.desmos.com/u/barbra.steinhurst)\
**Replies:** 2\
**Last updated:** [October 5, 2024, 3:14pm UTC](https://cl.desmos.com/t/how-to-check-student-answers-in-table-that-involve-fractions-with-variables/7360 "2024-10-05T15:14:53Z")

</div>

I’m seeing lots of examples and questions about checking student answers in tables when the answers are or are equivalent to numeric fractions. However, I need to check student answers of the form 1/(4.5r) and 1/r when t…

---

## [Patterns with parentheses](https://cl.desmos.com/t/patterns-with-parentheses/7262)

<div class="topic-metadata">

**Author:** [@Itzik](https://cl.desmos.com/u/Itzik)\
**Replies:** 2\
**Last updated:** [September 13, 2024, 3:17am UTC](https://cl.desmos.com/t/patterns-with-parentheses/7262 "2024-09-13T03:17:21Z")

</div>

how I can define a pattern for expression with parantheses. see row 3 in the table.patterns definition for row 3

---

## [Self Check 6+3sqrt2?](https://cl.desmos.com/t/self-check-6-3sqrt2/992)

<div class="topic-metadata">

**Author:** [@ThinMint](https://cl.desmos.com/u/ThinMint)\
**Replies:** 11\
**Last updated:** [September 10, 2024, 11:52pm UTC](https://cl.desmos.com/t/self-check-6-3sqrt2/992 "2024-09-10T23:52:01Z")

</div>

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 im…

---

## [Pattern Matching - Polynomial?](https://cl.desmos.com/t/pattern-matching-polynomial/4033)

<div class="topic-metadata">

**Author:** [@pirsquared](https://cl.desmos.com/u/pirsquared)\
**Replies:** 9\
**Last updated:** [August 30, 2024, 4:33pm UTC](https://cl.desmos.com/t/pattern-matching-polynomial/4033 "2024-08-30T16:33:06Z")

</div>

Hi all, I’d like to try and use pattern matching to check - and ideally parse - a student’s answer that should be a polynomial of the form ax^3+bx^2+cx+d. However, I’m drawing a blank if I want to allow for some of the …

---

## ["Contains" option for checking strings](https://cl.desmos.com/t/contains-option-for-checking-strings/7149)

<div class="topic-metadata">

**Author:** [@Timothy\_Lee1](https://cl.desmos.com/u/Timothy_Lee1)\
**Replies:** 3\
**Last updated:** [August 29, 2024, 7:40pm UTC](https://cl.desmos.com/t/contains-option-for-checking-strings/7149 "2024-08-29T19:40:06Z")

</div>

I’ve added some feedback to an activity where students have to write the standard form and the vertex form of a quadratic. I have my feedback use a hidden graph to check for equivalent functions as opposed to the exact c…

---

## [Check that an expression is in the correct form](https://cl.desmos.com/t/check-that-an-expression-is-in-the-correct-form/6836)

<div class="topic-metadata">

**Author:** [@Kevin\_McSorley](https://cl.desmos.com/u/Kevin_McSorley)\
**Replies:** 3\
**Last updated:** [August 17, 2024, 9:04pm UTC](https://cl.desmos.com/t/check-that-an-expression-is-in-the-correct-form/6836 "2024-08-17T21:04:55Z")

</div>

Does anyone have a way to check that an expression is in the correct form? For example, when students are given a^m\*a^n I want them to enter a^(m+n), I know how to do this for expressions containing numbers by using co…

---

## [Changing "," to "."](https://cl.desmos.com/t/changing-to/6280)

<div class="topic-metadata">

**Author:** [@MrSurkjau](https://cl.desmos.com/u/MrSurkjau)\
**Replies:** 9\
**Last updated:** [August 8, 2024, 10:06am UTC](https://cl.desmos.com/t/changing-to/6280 "2024-08-08T10:06:32Z")

</div>

Hello, I am a teacher from Germany and here we use “,” instead of “.” So we make decimals like this “4,5” and not “4.5” I’m looking for a solution on how to change the “,” to “.” via code so Desmos can understand it, b…

---

## [Checking for the correctness of an equation or expression](https://cl.desmos.com/t/checking-for-the-correctness-of-an-equation-or-expression/5754)

<div class="topic-metadata">

**Author:** [@Teresa\_Knouff](https://cl.desmos.com/u/Teresa_Knouff)\
**Replies:** 4\
**Last updated:** [July 8, 2024, 2:38am UTC](https://cl.desmos.com/t/checking-for-the-correctness-of-an-equation-or-expression/5754 "2024-07-08T02:38:24Z")

</div>

I want the correctness of a math response to allow for multiple versions of an expression/equation. For example, “2x+5” will work but I am having trouble with 2\*x + 5. Also, how would you write an expression for divisi…

---

## [I am trying to allow students to know if they got their answer correct. How do I write code for -90 7/8?](https://cl.desmos.com/t/i-am-trying-to-allow-students-to-know-if-they-got-their-answer-correct-how-do-i-write-code-for-90-7-8/5745)

<div class="topic-metadata">

**Author:** [@Lisa\_Hunt](https://cl.desmos.com/u/Lisa_Hunt)\
**Replies:** 1\
**Last updated:** [June 28, 2024, 5:06am UTC](https://cl.desmos.com/t/i-am-trying-to-allow-students-to-know-if-they-got-their-answer-correct-how-do-i-write-code-for-90-7-8/5745 "2024-06-28T05:06:21Z")

</div>

check= this.numericValue=-90,latex=/frac{7}{8} correct: check suffix: when not(this.submitted) “” when check “:white\_check\_mark:” otherwise “:cross\_mark:”

---

## [Evaluating expressions in a table](https://cl.desmos.com/t/evaluating-expressions-in-a-table/5712)

<div class="topic-metadata">

**Author:** [@Teresa\_Knouff](https://cl.desmos.com/u/Teresa_Knouff)\
**Replies:** 2\
**Last updated:** [June 18, 2024, 1:40pm UTC](https://cl.desmos.com/t/evaluating-expressions-in-a-table/5712 "2024-06-18T13:40:41Z")

</div>

With my inexperience with CL… Can I code the correctness of a table with the following characteristics? Some of the cells will have expressions solutions. The solutions will be a single variable, preferrably x or y. S…

---

## [Pi in math input check](https://cl.desmos.com/t/pi-in-math-input-check/5319)

<div class="topic-metadata">

**Author:** [@moigon](https://cl.desmos.com/u/moigon)\
**Replies:** 2\
**Last updated:** [May 30, 2024, 8:11am UTC](https://cl.desmos.com/t/pi-in-math-input-check/5319 "2024-05-30T08:11:23Z")

</div>

I want my students to enter pi as an answer in math input. when I check set it up for feedback after they submit, pi doesn’t get recognized as correct. This is the script for the math input: correct = patterns.literal(\\…

[Next page](https://cl.desmos.com/tag/patterns/25.md?match_all_tags=true&page=1&tags%5B%5D=patterns)
