\Header{Uniform}{The Uniform Distribution}
\alias{dunif}{Uniform}
\alias{punif}{Uniform}
\alias{qunif}{Uniform}
\alias{runif}{Uniform}
\keyword{distribution}{Uniform}
\begin{Description}\relax
These functions provide information about the uniform distribution
on the interval from \code{min} to \code{max}.  \code{dunif} gives the
density, \code{punif} gives the distribution function \code{qunif}
gives the quantile function and \code{runif} generates random
deviates.
\end{Description}
\begin{Usage}
\begin{verbatim}
dunif(x, min=0, max=1, log = FALSE)
punif(q, min=0, max=1, lower.tail = TRUE, log.p = FALSE)
qunif(p, min=0, max=1, lower.tail = TRUE, log.p = FALSE)
runif(n, min=0, max=1)
\end{verbatim}
\end{Usage}
\begin{Arguments}
\begin{ldescription}
\item[\code{x,q}] vector of quantiles.
\item[\code{p}] vector of probabilities.
\item[\code{n}] number of observations. If \code{length(n) > 1}, the length
is taken to be the number required.
\item[\code{min,max}] lower and upper limits of the distribution.
\item[\code{log, log.p}] logical; if TRUE, probabilities p are given as log(p).
\item[\code{lower.tail}] logical; if TRUE (default), probabilities are
\eqn{P[X \le x]}{P[X <= x]}, otherwise, \eqn{P[X > x]}{P[X > x]}.
\end{ldescription}
\end{Arguments}
\begin{Details}\relax
If \code{min} or \code{max} are not specified they assume the default
values of \code{0} and \code{1} respectively.

The uniform distribution has density
\deqn{f(x) = \frac{1}{max-min}}{f(x) = 1/(max-min)}
for \eqn{min \le x \le max}{}.

For the case of \eqn{u := min == max}{}, the limit case of
\eqn{X \equiv u}{X == u} is assumed.
\end{Details}
\begin{References}\relax
Becker, R. A., Chambers, J. M. and Wilks, A. R. (1988)
\emph{The New S Language}.
Wadsworth \& Brooks/Cole.
\end{References}
\begin{SeeAlso}\relax
\code{\Link{.Random.seed}} about random number generation,
\code{\Link{rnorm}}, etc for other distributions.
\end{SeeAlso}
\begin{Examples}
\begin{ExampleCode}
u <- runif(20)

## The following relations always hold :
punif(u) == u
dunif(u) == 1

var(runif(10000))#- ~ = 1/12 = .08333
\end{ExampleCode}
\end{Examples}

