public static int poisson(double lambda){
  int k=0;
  double p=1.0;
  double L=Math.exp(-lambda);
  do {
    k++;
    p*=uniform();
  }
 while (p >= L);
  return k - 1;
}

public static int poisson ( double lambda ) { int k = 0 ; double p = 1.0 ; double L = Math . exp ( - lambda ) ; do { k ++ ; p *= uniform ( ) ; } while ( p >= L ) ; return k - 1 ; }
return an integer with a poisson distribution with mean lambda .
