mercredi 6 juillet 2016

random selection from 1-D vector data

would you please share your thoughts on the following question

suppose you have a 1-D vector data like

Data=[ a1 a2 a3 a4..... an];   0<ai<100

how we can find a subset of data such as

Data_subset=[ a3 a7 a8]  or  Data_subset=[ a1 a17 a81 a92 a93 a100 a101 ]

which best hold this condition : abs(sum(Data_subset)-700)<10

any idea?




Aucun commentaire:

Enregistrer un commentaire