please I saw a method that implements the Poisson distribution function to generate random numbers and I have no idea how to run it. Can someone please help me with the main method that can print the random numbers? Below are the codes:
public static int getPoisson(double lambda) {
double L = Math.exp(-lambda);
double p = 1.0;
int k = 0;
do {
k++;
p *= Math.random();
}
while (p > L);
return k - 1;
}
Thank you.