\Header{Binomial}{The Binomial Distribution}
\alias{dbinom}{Binomial}
\alias{pbinom}{Binomial}
\alias{qbinom}{Binomial}
\alias{rbinom}{Binomial}
\keyword{distribution}{Binomial}
\begin{Usage}
\begin{verbatim}
dbinom(x, size, prob)
pbinom(q, size, prob)
qbinom(p, size, prob)
rbinom(n, size, prob)
\end{verbatim}
\end{Usage}
\begin{Arguments}
\begin{ldescription}
\item[\texttt{x,q}] vector of quantiles.
\item[\texttt{p}] vector of probabilities.
\item[\texttt{n}] number of observations to generate.
\item[\texttt{size}] number of trials.
\item[\texttt{prob}] probability of success on each trial.
\end{ldescription}
\end{Arguments}
\begin{Description}
These functions provide information about the binomial distribution
with parameters \texttt{size} and \texttt{prob}.  \texttt{dbinom} gives the density,
\texttt{pbinom} gives the distribution function \texttt{qbinom} gives
the quantile function and \texttt{rbinom} generates random deviates.\end{Description}
\begin{Details}
The binomial distribution with \texttt{size} \eqn{= n}{} and
\texttt{prob} \eqn{= p}{} has density
\deqn{p(x) = {n \choose x} {p}^{x} {(1-p)}^{n-x}
}{p(x) = Choose(n,x) p^x (1-p)^(n-x)}
for \eqn{x = 0, \ldots, n}{}.

If an element of \texttt{x} is not integer, the result of \texttt{dbinom} is zero,
with a warning.\end{Details}
\begin{SeeAlso}
\texttt{\Link{dnbinom}} for the negative binomial, and \texttt{\Link{dpois}}
for the Poisson distribution.\end{SeeAlso}
\begin{Examples}
\begin{ExampleCode}
# Compute P(45 < X < 55) for X Binomial(100,0.5)
sum(dbinom(46:54, 100, 0.5))
\end{ExampleCode}
\end{Examples}

