# Checking a recursive function?

Hi, all,
I’m looking for a way that I can have students input their own common difference into the table and then check to see whether their outputs are correct. If anyone can help, I would appreciate it very much. This is above and beyond my scope of understanding CL at this point. I’ve included the slide that I’m hoping to have this work with.

Thanks much for any and all help!

``````#the explicit function with difference d
f=simpleFunction("4+dx","x","d")
a=cellNumericValue(1,1)
aTerm2= cellNumericValue(1,3)=f.evaluateAt(2,a)
aTerm3= cellNumericValue(1,4)=f.evaluateAt(3,a)
aTerm4= cellNumericValue(1,5)=f.evaluateAt(4,a)
b=cellNumericValue(2,1)
bTerm2= cellNumericValue(2,3)=f.evaluateAt(2,b)
bTerm3= cellNumericValue(2,4)=f.evaluateAt(3,b)
bTerm4= cellNumericValue(2,5)=f.evaluateAt(4,b)
``````

If on another slide you want them to change the initial value, you could add a variable for that in the simpleFunction. Each term variable is checking, though not giving feedback. Use those variables as you see fit. You may need to add in rounding in both the function and the term checking if you expect fractions.

``````f=simpleFunction("\round(4+dx,2)","x","d")
aTerm2= numericValue("\round(\${cellNumericValue(1,3)},2)")=f.evaluateAt(2,a)
``````

Thank you so much! I appreciate your help every time I post. This worked like a dream and I can’t wait to share this with my fellow teachers. Desmos has been so amazing for us this year to be able to give students immediate feedback and I am so thankful that the support is here to rely on.

1 Like