Mathematical function that has more chance to return small number, than large
I need to get random element in array, but I want to get element with smaller index more frequently than element with large index. Is there any way to do that?
Example: sqrt(x) will return big indexes frequently
Aucun commentaire:
Enregistrer un commentaire