title: Computing a binomial probability for huge numbers
body: <p>I want to compute binomial probabilities on python. I tried to apply the formula:</p>
  
  <pre><code>probability = scipy.misc.comb(n,k)*(p**k)*((1-p)**(n-k))
  </code></pre>
  
  <p>Some of the probabilities I get are infinite. I checked some values for which p=inf. For one of them, n=450,000 and k=17. This value must be greater than 1e302 which is the maximum value handled by floats. </p>
  
  <p>I then tried to use <code>sum(np.random.binomial(n,p,numberOfTrials)==valueOfInterest)/numberOfTrials</code></p>
  
  <p>This draws numberOfTrials samples and computes the average number of times the value valueOfInterest is drawn.</p>
  
  <p>This doesn't raise any infinite value. However, is this a valid way to proceed? And why this way wouldn't raise any infinite value whereas computing the probabilities does?</p>