title: Whats the most concise way to pick a random element by weight in c#?
body: <p>Lets assume:</p>
  
  <p><code>List&lt;element&gt;</code> which element is:</p>
  
  <pre><code>public class Element(){
     int Weight {get;set;}
  }
  </code></pre>
  
  <p>What I want to achieve is, select an element randomly by the weight.
  For example:</p>
  
  <pre><code>Element_1.Weight = 100;
  Element_2.Weight = 50;
  Element_3.Weight = 200;
  </code></pre>
  
  <p>So </p>
  
  <ul>
  <li>the chance <code>Element_1</code> got selected is 100/(100+50+200)=28.57%</li>
  <li>the chance <code>Element_2</code> got selected is 50/(100+50+200)=14.29%</li>
  <li>the chance <code>Element_3</code> got selected is 200/(100+50+200)=57.14%</li>
  </ul>
  
  <p>I know I can create a loop, calculate total, etc...</p>
  
  <p><em>What I want to learn is, whats the best way to do this by Linq in ONE line (or as short as possible), thanks.</em></p>
  
  <p><strong>UPDATE</strong></p>
  
  <p>I found my answer below. First thing I learn is: <strong>Linq is NOT magic, it's slower then well-designed loop</strong>.</p>
  
  <p>So my question becomes find a random element by weight, (without as short as possible stuff :)</p>