The Binomial distribution answers the question: “what is the probability of exactly \(r\) successes after \(n\) independent Bernoulli trials with constant success probability \(p\)?”
\[
\binom{n}{r} = \frac{n!}{(n-r)!r!}, \quad 0 \le r \le n
\]
and \(p\) = probability of success, \(q\) = probability of failure, \(p + q = 1\), \(n\) = number of independent draws, and \(X\) = number of successes.
In other words, the Binomial distribution describes the probability of \(X=r\) successes when \(n\) binary experiments are carried out independently with fixed success probability \(p\).
Important contrast: if sampling is done without replacement from a finite population, the exact model is Hypergeometric (see Chapter 16), not Binomial.
When \((n+1)p \in \mathbb{N}\), the distribution is bimodal: two adjacent values are tied for the highest probability.
13.5 Median
\[
\text{Med}(X) \approx np
\]
More precisely, a binomial median is in \(\{\lfloor np \rfloor,\lceil np \rceil\}\). In some parameter settings the median is unique; in others both nearby integers satisfy the median condition.
13.6 Variance
\[
\text{V}(X) = n p q
\]
Variance is maximal at \(p=0.5\) and approaches 0 as \(p \to 0\) or \(p \to 1\).
13.7 Moment Generating Function
\[
M_X(t) = (q + pe^t)^n
\]
13.8 Coefficient of Skewness
\[
g_1 = \frac{q-p}{\sqrt{npq}}
\]
13.9 Coefficient of Kurtosis
\[
g_2 = 3 + \frac{1-6pq}{npq}
\]
The corresponding excess kurtosis is \(\frac{1-6pq}{npq}\).
13.10 Parameter Estimation
For one observed binomial count \(X\) with known trial size \(n\), the maximum-likelihood estimator is
\[
\hat p = \frac{X}{n}.
\]
For a sample \(X_1,\dots,X_m\) of binomial counts with common \((n,p)\):
\[
\hat p = \frac{\bar X}{n}.
\]
13.11 R Module
The Binomial Probabilities software can be found on the public website:
Observe how we define three parameters (success_threshold, n_trials, and p_success) which represent the user input fields of the R module. In fact, all the R scripts displayed in this handbook correspond (to a certain degree) to the R modules that are available on the web.
The main functions that are used are pbinom (distribution function / CDF) and dbinom (probability mass function / PMF). In R, the d prefix is used for both continuous densities and discrete mass functions.
13.12 Example
Let us reconsider the hospital-birth simulation from Section 11.2.1, where sampling variability is compared across different hospital sizes. The number of trials \(n\) is the average number of births in a hospital. The number of “successes” \(r\) to be evaluated is 60% of \(n\). The probability of a “success” is \(p = 0.5\).
For the large hospital \(n = 45\) and \(0.60 n = 0.60 * 45 = 27\). Hence, P\((X \leq 27) \simeq 0.9324\) and P\((X > 27) \simeq 1 - 0.9324 \simeq 0.0676\). You can verify this result with the R console
success_threshold <-0.6*45# number of successes to be evaluatedn_trials <-45# average number of births in the large hospitalp_success <-0.5# probability of a successr <-pbinom(success_threshold, n_trials, p_success)print('Probabilities of the Binomial Distribution')print(paste('P(X <=', success_threshold, ') = ', r, sep=''))print(paste('P(X >', success_threshold, ') = ', 1-r, sep=''))print(paste('P(X =', success_threshold, ') = ', dbinom(success_threshold, n_trials, p_success), sep=''))
In a pilot vaccine study, \(n=30\) participants are independently assessed for seroconversion, with historical response probability \(p=0.6\). What is the probability that at least 22 participants respond?