Checking colon form of a ratio

Checking whether or not a student’s ratio is correct can be as simple as a latex check, but this requires predicting student answers and you eventually are going to stop somewhere. Knowing that kids come up with crazy but correct answers sometimes, I wanted a way for my activities to check practically any form or a ratio. For example, if the ratio is 3 to 4, I still want the activity to recognize 333 : 444 as a correct answer even if it is silly.

Desmos calculator uses colons in syntax when defining conditionals and can do so when defining a function. I took advantage of this feature and some integration to come up with the following solution. I feel like there has to be a better way to figure out what the first number in the ratio is without finding area under the function, and if anybody can think of something, please share!

1 Like

Wow, that’a clever trick !!!

1 Like

I liked your idea, I studied it and I think a simplified it a bit.
See if you like this version:

https://teacher.desmos.com/activitybuilder/custom/6747a650bfb3b39320bd3c65

I do like it! There was a reason for my silliness with identifying the power of ten within which the discontinuity happens, though. If Desmos runs that integral over too large an interval, it misses small numbers. I also wanted to mark an answer like 0.03 : 0.04 as correct.

Oh!!! I see, now I understand … I didn’t realize that my solution does not work in such cases … so now I do actually prefer yours. Nice work.

By adjusting a bit the error tolerancies I managed to make my solution work in a wide range of values …