On Sat, Oct 22, 2011 at 8:40 PM, Ahmed Abdeen Hamed <ahmed.elmasri@gmail.com
> wrote:
> ...
> Thanks very much for your quick response. I am doing some simulations that
> produce probailities which are in turn must be compared to certains rates.
> Here is an example of what I am doing:
>
> if (randBinomial.nextBinomial(1, Simulation.MRATE)==1) {
> // the condition can be replaced by the following uncommented condition
> //randM.nextDouble() < Simulation.M_RATE;
>
I see no need to use the fancy binomial generator here. The place that it
becomes interesting is where n >> 1. For your problem, what you have is
really better.
> if (gt[i] == 0) {
> gt[i] = 1;
> } else {
> gt[i] = 0;
> }
>
This can probably be replaced by
gt[i] = 1  gt[i]
(depending on what the original contents are, that is).
