lundi 23 mars 2020

Can you create a probability curve without any hard math?

Sorry if this all sounds silly or wrong, im very new to coding.

What im trying to achieve is a probability density function - something that "focuses" the results around one given area with given "focus" strength or "shape". And i need it to be done without hard calculations, as the application would require it to be done tens of thousands of times per second.

If im still not clear, when you do random.randint(0,100) all results should have 1% of occurring. What i want is that you focus on 80 for example, with a minimal focus strength - then 80 has the highest chance to appear, 79 and 81 have second highest chance, and so on, in an exponential decline. If the focus is maximal, then the answer would always come out as 80. Thinking of an application, you have a unit offspring and it takes some value from its parent as a focus point, then gets a random chance to mutate. If the chance to mutate is high (low focus), then the value can land anywhere from 1 to 100, else it will be more likely to follow the parent.

Feeling like a toddler describing this in such lame terms...

I cant provide any example code, as the best ive come up with is too far from what i need. Scipy and numpy modules all have very hard terminology for me, even though the answer is probably in them somewhere.




Aucun commentaire:

Enregistrer un commentaire