# How to check if two numbers in a table make the correct Ratio

**URL:** <https://cl.desmos.com/t/how-to-check-if-two-numbers-in-a-table-make-the-correct-ratio/7752>\
**Category:** Questions\
**Tags:** validation, correctness\
**Created:** [February 13, 2025, 6:15pm UTC](https://cl.desmos.com/t/how-to-check-if-two-numbers-in-a-table-make-the-correct-ratio/7752 "2025-02-13T18:15:16Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Jennifer\_Knarr](https://yyz1.discourse-cdn.com/flex031/user_avatar/cl.desmos.com/jennifer_knarr/32/2492_2.png) [@Jennifer\_Knarr](https://cl.desmos.com/u/Jennifer_Knarr)\
**Post date:** [February 13, 2025, 6:15pm UTC](https://cl.desmos.com/t/how-to-check-if-two-numbers-in-a-table-make-the-correct-ratio/7752/1 "2025-02-13T18:15:16Z")

</div>

I want to check two numbers in a table to make sure they make a ratio equal to 2. That is my first hurdle. The \frac line is wrong.

I want it to be correct when the ratio = 2 but make sure the student did not just use one of the earlier table entries given.

Here is what I have:

f1=t6.cellNumericValue(4,1)  
f2=t6.cellNumericValue(4,2)  
ratio=numericValue(“\frac{{f2}{{f1}}”)

correct: (not(f1=1) and not(f1=2) and not(f1)=3 and ratio=2)

I am not sure why it is not showing what I typed in. It should have ${f2} in there.  
Thank you for helping me figure this out.

---

<div class="post-metadata">

**Author:** ![Scott\_Walker](https://yyz1.discourse-cdn.com/flex031/user_avatar/cl.desmos.com/scott_walker/32/3100_2.png) [@Scott\_Walker](https://cl.desmos.com/u/Scott_Walker)\
**Post date:** [February 13, 2025, 7:48pm UTC](https://cl.desmos.com/t/how-to-check-if-two-numbers-in-a-table-make-the-correct-ratio/7752/2 "2025-02-13T19:48:45Z")

</div>

I think the activity below does what you were looking for.

> **[Knarr Table • Activity Builder by Desmos Classroom](https://teacher.desmos.com/activitybuilder/custom/67ae47d366358dd80e10452e)**
>
> by Scott Walker

In your `correct =` definition you have `(not(f1=1) and not(f1=2) and not(f1)=3 and ratio=2)` but I believe you mean for that to be `(not(f1=1) and not(f1=2) and not(f1=3) and ratio=2)`

I don’t know why you can’t include the CL code for the ratio script here on the forum without it showing that “Extra open…” error message. I am getting the same message, so I guess you’ll have to see what I used in the CL of the activity linked above.

---

<div class="post-metadata">

**Author:** ![Jennifer\_Knarr](https://yyz1.discourse-cdn.com/flex031/user_avatar/cl.desmos.com/jennifer_knarr/32/2492_2.png) [@Jennifer\_Knarr](https://cl.desmos.com/u/Jennifer_Knarr)\
**Post date:** [February 14, 2025, 12:38am UTC](https://cl.desmos.com/t/how-to-check-if-two-numbers-in-a-table-make-the-correct-ratio/7752/3 "2025-02-14T00:38:08Z")

</div>

That is perfect. Thank you!!

---

<div class="post-metadata">

**Author:** ![Daniel\_Grubbs](https://yyz1.discourse-cdn.com/flex031/user_avatar/cl.desmos.com/daniel_grubbs/32/719_2.png) [@Daniel\_Grubbs](https://cl.desmos.com/u/Daniel_Grubbs)\
**Post date:** [February 14, 2025, 2:51pm UTC](https://cl.desmos.com/t/how-to-check-if-two-numbers-in-a-table-make-the-correct-ratio/7752/4 "2025-02-14T14:51:36Z")

</div>

> [@Jennifer\_Knarr](#):
>
> I am not sure why it is not showing what I typed in.

If you want to include code on the forum that displays correctly, enclose it using triple backticks (the apostrophe like mark by the “1” key). You can use it inline, or on the lines before and after a block of code, which is really handy for copying it!

```auto
f1 = t6.cellNumericValue(4,1)
f2 = t6.cellNumericValue(4,2)
ratio = numericValue(`\frac{${f2}}{${f1}}`)

```
