mardi 31 mars 2015

Select % of random numbers from list [on hold]

I'm interested in selecting a % of random numbers form a list. For example, if I have the following list: 1 2 3 4 5 6 7 8 9 10, I would want to select randomly 40% out of it and the returned list to be: 2 5 6 10 (which were selected randomly).


My final purpose will be to select a percentage of lines from a file in the same way.


Does anyone have any idea how could this be implemented?


Thanks


Aucun commentaire:

Enregistrer un commentaire