docs: private int samplePMF(double p[]) {
  
          double r = m_MetaRandom.nextDouble();
  
          double sum = 0.0;
          for (int i = 0; i < p.length; i++) {
              sum += p[i];
              if (r < sum) {
                  return i;
              }
          }
          return -1;
      }