mardi 20 juin 2017

choose k from n with a probability

I've a list of n elements (e_i). For each i, e_i have a probability p_i to be selected.

I want to write an algorithm to pick k elements from theses n, but I have to respect the probabilities of each element when I choose them. I've no idea how to do that, I didn't know any algorithm which do that :/

Can you direct my reflection?




Aucun commentaire:

Enregistrer un commentaire