Randomized graph to graph CL with button press

Can I get help getting these randomized points from working in the graph to working in the activity with the random generator and a button press?
points with rng • Activity Builder by Desmos

I’m not sure if it’s actually documented anywhere, but you can use a second parameter in Shuffle that forces it to re-randomise whenever that second value changes. So if you use c_1=shuffle(A,b) or c_1=shuffle(A,m), whenever the button is pressed and b or m are updated, the list will be reshuffled as you wish.

Just as a point of tidiness for the future, you don’t actually need the [1...11] on the end of the shuffle - this just means “the first eleven elements” which, given it’s an eleven-element list, isn’t required.

I think one of my issues with this is when I write in in the graph CL, it shows up as a point, rather than a list of points, so only one gets plotted and randomly changes. I don’t now how to get the list to the CL?

You can’t manipulate lists in the CL. If your aim is to randomize using CL, you can set a number in the graph to a button press or a random number using the random number generator. Using that number, b in @pisquared’s example, to shuffle or reshuffle the list.

In that case, I’m not sure I fully understand what you’re trying to achieve. At the minute, you have semi-random points generated by being a random distance above or below a randomly-generated line of best fit. If you use shuffle(A,b) or similar then the random distances will update each time the line of best fit does, rather than being the same fixed distance. As @Daniel_Grubbs says, it’s not possible to manipulate or generate lists in CL, so you’d have to generate n number of random x-coordinates and y-coordinates, then feed them one-by-one into the graph, then combine them within the graph. It seems much easier to do things the way you currently have set up.

Unless I’m missing something?

Okay, I am missing something. Thank you both for your insight!

Okay I understand now, I got it to work the shuffle(A,b), thing, thank you so much for your help!
…and sorry for not understanding sooner, all of what I’ve learned has been from direct example.

I don’t understand any of this, and can’t find any information on it anywhere. I am sorry, thank you for your patience with me.
So, if I have a list N=[-5…5] , then n_1=shuffle(N) just shuffles those 11 elements. What if I wanted to draw from those 11 elements 30 times?

I mean make a new list of 30 elements randomized from the integers in the first list.

Okay, previous post from Daniel

L=( [-5…5].random(30,s_eed)?

Okay, I got it now, thank you so much for all your help on this forum!!

Glad you got it sorted. You can also take advantage of the syntax random(list, n, seed) - for instance:
L=random([-5...5],30,s_eed)

There’s some more detail available here (although not all syntaxes are listed):

1 Like