code: double qobs(int i, double[] xt) {
          int x = (int) (xt[0]);
          double p = Math.random();
          int y = 0;
          p -= pi(x, y);
          while (p > 0) {
              y++;
              p -= pi(x, y);
          }
          return (double) y;
      }
docs: Draw an (internal) new state y given that we're in (internal) state xt