title: Generating number from binomial distribution using C++ TR1
body: <p>I am trying to use the following code (taken from the internet) to generate numbers from binomial distribution. It compiles but one execution it hangs. (I am using g++ on mac.)</p>
  
  <p>Could someone suggest a working code to generate numbers from binomial distribution using C++ TR1  library features? </p>
  
  <pre><code>#include &lt;tr1/random&gt;
  #include &lt;iostream&gt;
  #include &lt;cstdlib&gt;
  
  using namespace std;
  using namespace std::tr1;
  
  int main()
  {
    std::tr1::mt19937 eng; 
    eng.seed(time(NULL));
    std::tr1::binomial_distribution&lt;int, double&gt; roll(5, 1.0/6.0);
    std::cout &lt;&lt; roll(eng) &lt;&lt; std::endl;
    return 0;
  }
  </code></pre>