# BinomialDist

## Name

BinomialDist --  Binomial distribution

## Description

The binomial distribution gives the discrete probability of obtaining exactly n successes out of N Bernoulli trials

## Methods

### Phase: Creating

• + create: (id <Zone>)aZone setGenerator: (id <SimpleRandomGenerator>)generator
Use this create message if the generator to be attached is a Simple one:

• + create: (id <Zone>)aZone setGenerator: (id <SplitRandomGenerator>)generator setVirtualGenerator: (unsigned)vGen
Use this create message if the generator to be attached is a Split one:

• + create: (id <Zone>)aZone setGenerator: (id <SplitRandomGenerator>)generator setVirtualGenerator: (unsigned)vGen setNumTrials: (unsigned)aNumTrials setProbability: (double)aProbability
Use this create message if the generator to be attached is a Split one and both the number of trials and the probability are to be set at create time:

• + create: (id <Zone>)aZone setGenerator: (id <SimpleRandomGenerator>)generator setNumTrials: (unsigned)aNumTrials setProbability: (double)aProbability
Use this create message if the generator to be attached is a Simple one: and both the number of trials and the probability are to be set at create time:

### Phase: Setting

• - setNumTrials: (unsigned)aNumTrials
The setNumTrials only sets the numTrials parameter; the probability parameter is left unchanged from its previous or initialized value

• - setNumTrials: (unsigned)aNumTrials setProbability: (double)aProbability
The setNumTrials:setProbability sets both the number of trials rate and the probability parameters.

### Phase: Using

• - (unsigned)getUnsignedSampleWithNumTrials: (unsigned)aNumTrials withProbability: (double)aProbability
The getUnsignedSampleWithOccurRate:andInterval return a sample value for the specified number of trials and probability. Does not change the the distribution's parameter values.

• - (unsigned)getUnsignedSampleWithProbability: (double)aProbability
The getIntegerSampleWithInterval returns a sample value using the distribution's current number of trials and new probability value. Causes an error if the number of trials has not been previously set.

• - (unsigned)getUnsignedSample
The getIntegerSample returns a sample value using the distribution's current number of trials and probability parameters; causes an error if these parameters have not been previously set.

• - (double)getProbability
The getProbability returns probability parameter.

• - (unsigned)getNumTrials
The getNumTrials returns number of trials parameter.