Next: Poisson Random Variable, Previous: General Finite Discrete Random Variable, Up: Functions and Variables for discrete distributions [Contents][Index]
The binomial distribution with parameters \(n\) and \(p\) is a discrete probability distribution. It consists of \(n\) independent experiments where each experiment consists of a Boolean-valued outcome where a success occurs with a probablity \(p\).
For example, a biased coin that comes up heads with probablity \(p\) is tossed \(n\) times. Then the probability of exactly \(k\) heads in \(n\) tosses is given by the binomial distribution.
Returns the value at x of the probability function of a
\({\it Binomial}(n,p)\)
random variable, with \(0 \leq p \leq 1\) and \(n\) a positive integer. To make use of this function, write first load("distrib")
.
The pdf is
Returns the value at x of the distribution function of a \({\it Binomial}(n,p)\) random variable, with \(0 \leq p \leq 1\) and \(n\) a positive integer.
The cdf is
where \(I_z(a,b)\) is the beta_incomplete_regularized function.
(%i1) load ("distrib")$
(%i2) cdf_binomial(5,7,1/6); 7775 (%o2) ---- 7776
(%i3) float(%); (%o3) 0.9998713991769548
Returns the q-quantile of a
\({\it Binomial}(n,p)\)
random variable, with \(0 \leq p \leq 1\) and \(n\) a positive integer; in other words, this is the inverse of cdf_binomial
. Argument q must be an element of \([0,1]\). To make use of this function, write first load("distrib")
.
Returns the mean of a
\({\it Binomial}(n,p)\)
random variable, with \(0 \leq p \leq 1\) and \(n\) a positive integer. To make use of this function, write first load("distrib")
.
The mean is
Returns the variance of a
\({\it Binomial}(n,p)\)
random variable, with \(0 \leq p \leq 1\) and \(n\) a positive integer. To make use of this function, write first load("distrib")
.
The variance is
Returns the standard deviation of a
\({\it Binomial}(n,p)\)
random variable, with \(0 \leq p \leq 1\) and \(n\) a positive integer. To make use of this function, write first load("distrib")
.
The standard deviation is
Returns the skewness coefficient of a
\({\it Binomial}(n,p)\)
random variable, with \(0 \leq p \leq 1\) and \(n\) a positive integer. To make use of this function, write first load("distrib")
.
The skewness coefficient is
Returns the kurtosis coefficient of a
\({\it Binomial}(n,p)\)
random variable, with \(0 \leq p \leq 1\) and \(n\) a positive integer. To make use of this function, write first load("distrib")
.
The kurtosis coefficient is
Returns a
\({\it Binomial}(n,p)\)
random variate, with \(0 \leq p \leq 1\) and \(n\) a positive integer. Calling random_binomial
with a third argument m, a random sample of size m will be simulated.
The implemented algorithm is based on the one described in Kachitvichyanukul, V. and Schmeiser, B.W. (1988) Binomial Random Variate Generation. Communications of the ACM, 31, Feb., 216.
To make use of this function, write first load("distrib")
.