I have this activity that I’ve used for a couple of years now but my students are getting an error on one slide. I’m attaching the slide for assistance. It appears that when the student checks their answer they will get an “incorrect” if the list is showing “undefined”. I’m not sure why it is showing “undefined”. The “?” are can be ignored and the student response is ok. It’s the “undefined” that is causing the problem.

A list defined by [1,6,…,max] can overshoot the upper limit - for example, if you do [1,6,…,20] it will give [1,6,11,16,21]. So the activity is sometimes looking for the 237th or 238th term of a 236-long list, hence the undefined.

You can ‘sanitise’ a list by having something like s_0 = s[s>0], which will create a new list s_0 that removes any undefined terms.

Unfortunately, I do not understand a lot of the programing and I don’t understand " Have you changed all of the other lists to now look at s_0 rather than s ? Remember s still has undefined terms in it." because the only place I see “s” is line 4. I do not see it as part of any of the other statements. So I’m not sure what to do with: s_0 = s[s>0] or s[0<s<infinity]. Are these supposed to have their own command line in the “edit graph” or be part of other command lines or am I supposed to place these in the computation layer?

So at the moment, you have list s that picks every fifth value and sometimes looks for an item that doesn’t exist and therefore has an “undefined” at the end. This list is then used in the label of P (line 7) and the mean calculation on line 9. The mean can’t be defined if one of the terms in the list is undefined.

Daniel and I are suggesting you can sanitise this list by creating a new one, s_0 or whatever you want to call it, that picks only the defined elements from s. Now you have a “clean” list, it’s this that you need to use in lines 7 and 9, not the original s which still has the undefined term in it.

Here’s a different way to index list L_1. I added L_index which is essentially a list of [1…5] repeated up to the length of L_1. Then, rather than using an arithmetic sequence beginning with L_0, I’m filtering L_1 using the list L_index where it is equivalent to L_0. No worries of undefined values… Desmos | Graphing Calculator