Newton's Method (Table Fill Bug Resolved)

Hey! I’m new to these forums. I created the following activity for Newton’s Method. It’s my first major attempt at using the computation layer, but I have a bit of background with coding and such.

The activity mostly works how I want it to, except in the very last slide there’s a bug I can’t quite catch. Students are able to enter a function, enter an initial guess, and then use a “Fill Table” button to recursively implement Newton’s Method. It all works, except for some reason if the student gets an “undefined” output from Newton’s Method for whatever reason, the Fill in Table feature breaks down, and they’re unable to use the table. Even resetting the table won’t fix the issue.

I can’t seem to figure out why getting an undefined result for a variable would mess with the table. The recursion and the reset functions all work fine- it’s just that getting an undefined output makes everything break down. Any thoughts on why this would be the case?

Here’s the activity: https://teacher.desmos.com/activitybuilder/custom/601c673f22211b03c2260cf6

I spent this morning digging into some different sinks and realized that my problem was with the history numberList for one of my buttons. Apparently, if one value in the list is undefined, it makes the entire list unusable.

I have updated the bug, and now this is more just a sharing ideas thing :slight_smile:

1 Like

You can use conditionals for aggregating, then remove unwanted elements in a graph.

numberList(`L`): when isUndefined(thisNum) aggregate(1000)
                 otherwise aggregate(thisNum)

Then in the graph, this will remove any “undefined” since we set them to 1000. Then use list M for any calculations:

M=L[L<1000]