Summation with lists for limits

I ran into this code for set difference and intersection.

The summation lower limits are scalars, and the upper limits are lists. I understand the examples I’ve seen where the lower and upper limits are both the same list.

In trying to understand that set operations code, I rewrote the it, using scalar limits here:

How can I get my head around list limits for summation and product? Any good examples or documentation?

Howdy,

One reason there isn’t much documentation around is that the use of list limits has been largely replaced by more recent list functionality, in particular list comprehension, in Desmos. For example, here’s the Set Utilities graph rewritten without list limits:

Things can still be brain benders with the newer functionality. It took me a good while, for example, to land on line 10

as a way to say, “for each element in SET, keep it if it appears more than once. Then, keep only one copy of each element in the resulting list.”

Hopefully that is more helpful than confusing - I’m also happy to dig more into examples of the old or new functionality!

Thanks!

I love list comprehensions. One thing that I haven’t figured out how to get Desmos list comprehensions to produce is a triangular enumeration without filtering, I suspect, because not enough attention is being paid to scope, which could allow inner variables to reference outer variables (as it does in various computer languages).

I am not sure, but I have a feeling that list limits on summations may be able to do that.

BTW: I didn’t know about S.length. Where can I find documentation for other “dot functions”?

Fascinating - I’ve not thought about using list limits on summations to generate a triangle enumeration. I know where my extra time and brainpower is going today I think you’re on to something!

With regards to the dot notation, many of the list functions (documented here) that you can call with parentheses can also be called with dot notation. They function equivalently with a dot or with parentheses, but depending on the context I sometimes find one or the other more readable.

1 Like