title: How to create a probability by a given percentage?
body: <p>I'm trying to create a percentage-based probability for a game. E.g. if an item has a 45% chance of a critical hit, that must mean it is 45 of 100 hits would be critical.</p>
  
  <p>First, I tried to use a simple solution:</p>
  
  <pre><code>R = new Random();
  int C = R.Next(1, 101);
  if (C &lt;= ProbabilityPercent) DoSomething()
  </code></pre>
  
  <p>But in 100 iterations with a chance of e.g. 48%, it gives 40-52 out of 100.
  Same goes for 49, 50, 51.
  So, there is no difference between these "percents".</p>
  
  <p><strong>The question is how to set a percentage of e.g. 50, and get strictly 50 of 100 with random?</strong>
  It is a very important thing for probability of rare item finding with an opportunity to increase a chance to find with an item. So the buff of 1% would be sensinble, because now it is not.</p>
  
  <p>Sorry for my bad English.</p>