Random Number Generator, No Repeats

Hey everyone,

I want to randomly select 10 numbers ranging from 1-50 with no repeats. Could I just make a list of the numbers 1-50 (in the graph component), seed the list (in the graph component), then take the first 10 numbers from that list?

@aknauft posted this gem on twitter:

Lines 1, 2, and 4 are all you need. Or, if you dont need any flexibility, just line 12


That’s beautiful! Thank you for sharing!

This is a nice solution.

If I have an expression that returns a list, Desmos gives me a result like “= 5 element list”.

Is there an easy way to see what those elements actually are?

The best I’ve got so far is either going and manually typing each index to see what’s in the list, or if I don’t care about the order, I sometimes plot them as points on the x-axis.

You can make a table and set it as one of the columns

1 Like

Thanks - I guess that means I have to give it a name but that is definitely better than the other solutions I had

You can access the elements of a list with square brackets next to the expression generating it or the variable it’s assigned to. Graphing Calculator

I have my random number generator working, providing feedback for the students, but I would like to fine tune it so that if the slope is 1 or -1, it does not show up, ex. y = x + 4. Same for the y-int. if it is zero. I tried using double quotes for a blank, but that didn’t work.

@Cheryl I solved the problem in this ridiculously complex way - basically accounting for all options and outputting the format correctly:

Look in the CL for the “question” note component.

There is some simplification that could happen, particularly around simplifying fractions, but I haven’t gone back to edit this.

@Zach This was very helpful, thank you!

Thanks very much for this. I was able to adapt this for a task on sampling methods.
Posting here if it’s useful to anyone: Intro to Sampling • Activity Builder by Desmos

1 Like