title: Select k random elements from a list whose elements have weights
body: <p>Selecting without any weights (equal probabilities) is beautifully described <a href="https://stackoverflow.com/questions/48087/select-a-random-n-elements-from-listt-in-c/48089#48089">here</a>.</p>
  
  <p>I was wondering if there is a way to convert this approach to a weighted one.</p>
  
  <p>I am also interested in other approaches as well.</p>
  
  <p>Update: Sampling <strong>without</strong> replacement</p>