So at the moment I'm basically running a test with 2 parameters, amount of numbers randomly generated (N) and the maximum value of which the numbers must not exceed (Y).
Code:
for(i = 0; i <= N-1; i++)
{
double u = gsl_ran_exponential (r, tao);
a[i] = u;
b = whichbin(bin,a[i],M,Y,i);
if (b != -1)
{
counter[b]++;
}
printf("%f\n", a[i]);
}
and the whichbin function include
Code:
if (a[i] > Y)
{
printf("Invalid Number:");
b = -1;
}
If i input 10 and 10 at command prompt, it will translate to 10 numbers with the maximum value of 10, otherwise it will be considered as an outlier.
I was wondering, if 1 out of the 10 numbers is an outlier, (i.e output: Invalid Number: 11.243423) , I am left with 9 numbers instead of 10. How can I generate another number when I encounter an outlier? I believe this has something to do with a while statement, something like
Code:
while (counter[b] < N)
but I'm not sure where to place it.