title: Getting random key from Map based on the probabilities of the value
body: <p>I have a <code>map&lt;string,float&gt;</code> of size 10000. The values(float) are the probabilities of that key(string), non-negative entries that add up to one.</p>
  
  <p>E.g. Key(Value): <code>A(0.5);B(0.3);C(0.2)</code></p>
  
  <p>How would you get a random key based on the probability <code>vector</code> (I know I do not have a vector) e.g. <code>{0.5,0.3,0.2}</code>?</p>
  
  <p>I can use <code>C++11</code>.</p>
  
  <p>Thank you.</p>