title: Generate a random boolean with given probability
body: <p>I am writing java code to solve a problem with simulated annealing method. I need a method to generate a random <code>true</code> only with probability exp(a/b) where <code>a</code> and <code>b</code> are given parameters.</p>
  
  <p>Thanks.</p>