dimanche 16 mai 2021

Trying to plot a random function but it seems that it's not quite random

I am trying to plot a random function that looks like this:

What I did was to generate a random number between 1 to 20 for all numbers in a range.

X = np.arange(1,20,0.2).tolist()
Random = [random.random() for x in X]

Then I plotted this But I got this:

enter image description here

Now I am wondering this is not quite random, Where we can see in some ranges that the function is increasing or decreasing, It looks like the sequence is not completely independent from the previous value. My question is that how can I write a function that is completely random like the first picture.




Aucun commentaire:

Enregistrer un commentaire