code: public double[] sample(int numSamples, Random rand)
      {
          double[] samples = new double[numSamples];
          for(int i = 0; i < samples.length; i++)
              samples[i] = invCdf(rand.nextDouble());
          
          return samples;
      }
docs: This method returns a double array containing the values of random samples from this distribution.
  
  @param numSamples the number of random samples to take
  @param rand the source of randomness
  @return an array of the random sample values