vendredi 19 février 2016

How can i create a "random" function that his output is closer than my data?

Create a random function (range 0 - 100) that outputs some given data
Eg: 8 56 78 6 98 74 36 52

This sequence can be generated using MyCustomRand(seed = 1251) (i use rand built in function on c# + some modification, its not relevant to put the code since i want to create a new custom function).

If i change to the next set of data(they are 1000 sets) its like gambling against the universe while finding the seed.

since 1/100 probability its insane for a sequence i have added an offset of 25, this mean my random function can create numbers that are closer to my desire result by 25 distance: Eg: My desire data: 5 65 98 54 1 97 32 45 MyCustomRand: 4 60 87 43 10 91 22 44

Diferences: 1 5 11 11 9 6 10 1

As you can see i can use this output from myCustomRand since their diference its below 25.

Is there an optimal way to create a randomfunction that helps me to archive this? i know you can control the "Randomness" using the Law of the unconscious statistician and other methods to make numbers "tends" to some distribution(maybe heres the trick). You have no restrictions on how to create this random function. Thanks!!




Aucun commentaire:

Enregistrer un commentaire