Lists

Overview

You can make lists in Desmos using square brackets like this:


You can create lists with evenly spaced elements. [1,...,10] is a list of the integers between 1 and 10. [1,3,...,11] is a list of the odd integers between 1 and 11. Table columns are available as lists in the rest of the system.

You can use lists anywhere in expressions that you would use a number. 

 

More Resources

Have more questions? Submit a request

22 Comments

  • 0
    Avatar
    Abotting213

    What is the maximum length of a list? May I have 16,000 elements in it?

  • 7
    Avatar
    Kashi Yamagato

    Can I access an item of a specific index? Say I have a list (or a table) and I want the last item in the list. Is there a way to do this?

  • 3
    Avatar
    Team Desmos

    Kashi - you can find a certain number in a list like x1[3] will give the 3rd number in the x1 list. 

  • 3
    Avatar
    Aran Glancy

    Can you concatenate lists? For example, if I have a=[1,2,3,4] and b=[5,4,3,2,1] and I want to get c=[1,2,3,4,5,4,3,2,1] can I do something like c=a+b?   

  • 2
    Avatar
    Team Desmos

    Aran - not currently, but it's on our list!

  • 0
    Avatar
    MrYurihi redstone

    Can you get multiple entries from an list, like getting entries 2 to 6, but in one thing? If not, how could you get Quartile 1 and Quartile 3 from any given list?

    Edited by MrYurihi redstone
  • 2
    Avatar
    Kristin

    You can try something like this to reference certain elements in a list: https://www.desmos.com/calculator/zcyahozrpb

    Edited by Kristin
  • 1
    Avatar
    Bryan Garcia

    I made two original equations to go from binary to decimal and decimal to binary. The binary to decimal uses the lists feature in desmos. I was wondering if there was any way that I could make a number into a list so that I could just type in the number in a function I guess and use that list instead of putting a comma after every single digit in a 20 digits long binary string.

  • 0
    Avatar
    Serge Ballif

    Bryan Garcia, The trick is to use an intermediary list. I made an example that will convert a decimal whole number to a list of digits. You can modify it as needed. https://www.desmos.com/calculator/7dsepfo2pe

  • 0
    Avatar
    Serge Ballif

    MrYurihi redstoneYou can use the quantile function in the stats menu. To get Q1 and Q3 of a list A you would use the commands quantile(A,.25) and quantile(A,.75). You can even use the quantile function to sort a list. The worksheet https://www.desmos.com/calculator/rfgwycggun shows an example of a sorted list along with a method to concatenate lists or to get a sublist, 

  • 0
    Avatar
    Bombergere23

    Aran Glancy,

    see here for concatenating lists

  • 0
    Avatar
    Joe Quinn

    I have an equation with 2 parameters (say A and B) in it, and I want to show all the graphs with all combinations of A and B at integers from 1 to 10. If I put A=[1,...,10] and then B=[1,...,10], I only get the graphs for A ranging from 1 to 10 with B fixed at 1. How do I show combinations of choices for the two parameters?

  • 1
    Avatar
    Serge Ballif

    Joe. There are currently no methods for iterating over two lists as you requested. Instead, you could make two lists of length 100 to cover all the ordered pairs. The worksheet https://www.desmos.com/calculator/cg2i9poeub has an example showing how that might be done.

  • 0
    Avatar
    Joe Quinn

    Okay thanks. I had already done the thing you suggested.

  • 0
    Avatar
    Bakerjr2159

    How do i find quartiles on desmos?

  • 0
    Avatar
    Serge Ballif

    Bakerjr2159 To get quartiles define a list "L=[1,2,3,4,5]" (or table of values with header "L") and enter quantile(L,0.25) to get the first quartile.

  • 0
    Avatar
    Benjamin Korpella

    Abotting213 - No, you can have up to 10000 entries.

    BTY: if you try to make a list like this, with more than 10000 entries, desmos won't do anything until you reload.

    Edited by Benjamin Korpella
  • 0
    Avatar
    Maxim Tiburziano

    Can I set lists to be unbounded between them? If I create a function with two variables and I set the variable A as [0,1,...,9] and B as [0,1,...,9] automatically the result is the combination of the first objects, second objects, third objects and so on.... but I would like the whole possible combination between them Is it possile?

  • 1
    Avatar
    Serge Ballif

    Maxim, there is no way to nest lists, unfortunately. One possible way to get all of the ordered pairs (0,0) through (9,9) is to make use of another list like this link: https://www.desmos.com/calculator/odm1auohqk

  • 0
    Avatar
    Joe Boccuzzi

    Is there a way to find the sum of a list, like [0,1,2,3,4,5] would sum to 15?

  • 0
    Avatar
    Serge Ballif

    total([0,1,2,3,4,5]) will give you the sum of the list.

  • 0
    Avatar
    Curtis Dyer

    Kashi Yamagato: if you want the last element in a list:

    L = [0,1,5,9]

    S = length(L)

    L[S] gives "9", L[S-1] gives "5", and so on.

Please sign in to leave a comment.
Powered by Zendesk