title: Java using beta distribution to generate a random number from 0 to 1
body: <p>I need to use beta distribution Beta(a, b) to generate a random number from 0 to 1.</p>
  
  <p>I found Class BetaDist, which has constructor BetaDist(double alpha, double beta) which constructs a BetaDist object with parameters α = alpha and β = beta and default domain (0, 1).</p>
  
  <p>But, I cannot find a method that can use just alpha and beta to return a randomly draw x (0, 1) using the BetaDist object. </p>
  
  <p>I read another post on stackoverflow say:
  A general method to generate random numbers from an arbitrary distribution which has a cdf without jumps is to use the inverse function to the cdf: G(y)=F^{-1}(y). If u(1), ..., u(n) are random numbers from the uniform on (0,1) distribution then G(u(1)), ..., G(u(n)) is a random sample from the distribution with cdf F(x).</p>
  
  <p>BetaDist class does have cdf(double x) method, yet I am still lost on what to do next. I haven't learn statistics, and the above post is still too complicated for me.</p>
  
  <p>thank you very much.</p>