# 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:
https://www.desmos.com/calculator/26tjhn44yn

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

2 Likes

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