Binomial Distribution

DESCRIPTION:

Density, cumulative probability, quantiles and random generation for the binomial discrete distribution.

USAGE:

dbinom(x, size, prob, log=F) 
pbinom(q, size, prob) 
qbinom(p, size, prob) 
rbinom(n, size, prob, bigdata=F) 

OPTIONAL ARGUMENTS:

x
vector or bdVector of quantiles. Missing values ( NAs) are allowed.
q
vector or bdVector of (positive) quantiles (number of successes obtained in size binomial trials with probability prob of success). Missing values ( NAs) are allowed.
p
vector or bdVector of probabilities. Missing values ( NAs) are allowed.
n
sample size.
size
vector or bdVector of (positive integer) numbers of coin flips for which the Binomial distribution measures the number of heads.
prob
vector or bdVector of probabilities of a head. If length(n) is larger than 1, then length(n) random values are returned.
bigdata
a logical value; if TRUE, an object of type bdVector is returned. Otherwise, a vector object is returned. This argument can be used only if the bigdata library section has been loaded.
log
a logical scalar; if TRUE, dbinom will return the log of the density, not the density itself.

VALUE:

density ( dbinom), probability ( pbinom), quantile ( qbinom), or random sample ( rbinom) for the Binomial distribution with parameters size and prob. The quantile is defined as the smallest value q such that Pr(Binomial random variate <= q) >= p.

SIDE EFFECTS:

The function rbinom causes the creation of the dataset .Random.seed if it does not already exist, otherwise its value is updated.

DETAILS:

Elements of q or p that are missing will cause the corresponding elements of the result to be missing.

BACKGROUND:

A Binomial discrete random variable X is the number of successes in n independent repetitions of a simple success-failure experiment where p is the probability of success. For example, consider the experiment of tossing a coin n times where the probability of the coin landing heads is p. A special case is the Bernoulli trial when n == 1 (a coin toss).

For details on the uniform random number generator implemented in S-PLUS, see the set.seed help file.

REFERENCES:

Hoel, P., Port, S. and Stone, C. (1971). Introduction to Probability Theory. Houghton-Mifflin, Boston, MA.

Johnson, N. L. and Kotz, S. (1970). Discrete Univariate Distributions, vol. 2. Houghton-Mifflin, Boston, MA.

SEE ALSO:

, .

EXAMPLES:

rbinom(20, 10, 0.5)      # sample of size 20 with mean 10*0.5 = 5 
rbinom(11, 10, 0:10/10)  # different values of prob
rbinom(10, 1:10, .5)     # different values of size