Code
dbinom(2, size = 6, prob = .25)
pbinom(2, size = 6, prob = .25)The Bernoulli distribution represents one binary observation. Suppose, however, that the response is the number of target outcomes across a fixed set of positions. How do we move from one binary observation to that total? The binomial distribution answers this question under additional assumptions.
Suppose a bilingual production task gives a participant six positions at which a code switch could occur.
X_i(\omega)\equiv \begin{cases} 1 & \text{if position }i\text{ contains a code switch},\\ 0 & \text{otherwise}. \end{cases}
The response of interest is not one position. It is the total number of switched positions:
K\equiv\sum_{i=1}^{6}X_i.
The six opportunities are hypothetical. In an empirical code-switching study, an eligible position must be defined from the bilingual discourse and syntactic analysis; classic quantitative work treats the location of possible switches as an empirical question rather than a self-evident denominator (Pfaff 1975).
If the six indicators are independent and share one switch probability \pi, then K has a binomial distribution:
K\sim\operatorname{Binomial}(6,\pi).
More generally, the family has a fixed number of opportunities n and one target probability \pi.
We denote its PMF by
p_K(k)\equiv\mathbb{P}(K=k).
The smallest possible count is zero and the largest is the number of opportunities. Thus
\operatorname{supp}(K)=\{0,1,2,3,4,5,6\}.
The upper bound is part of the model. A count of 7 is impossible because only six positions were observed.
This denominator distinguishes a binomial count from an unbounded count. Recording 2 switches without recording 6 eligible positions discards part of the response.
Take K=2. One sequence of position outcomes is
1,1,0,0,0,0.
Under the shared probability and independence assumptions, this sequence has probability
\pi^2(1-\pi)^4.
The two switches can occupy any two of the six positions. The number of such sequences is
{6\choose2} =\frac{6!}{2!4!} =15.
Because the six indicators are independent, each qualifying sequence has the same product probability \pi^2(1-\pi)^4. Because the 15 sequences are mutually exclusive, those equal probabilities add:
p_K(2) ={6\choose2}\pi^2(1-\pi)^4.
The general PMF is
p_K(k) ={n\choose k}\pi^k(1-\pi)^{n-k}, \qquad k\in\{0,1,\ldots,n\}.
The binomial coefficient counts arrangements. The remaining factors give the probability of any one arrangement.
Let \pi=.25. Then
\begin{aligned} p_K(2) &={6\choose2}(.25)^2(.75)^4\\ &=15(.0625)(.31640625)\\ &\approx.297. \end{aligned}
Thus about .297 of the modeled probability lies on exactly two switches among six positions.
In base R,
dbinom(2, size = 6, prob = .25)
pbinom(2, size = 6, prob = .25)The first call returns the mass at exactly 2. The second returns cumulative probability through 2, so the two calls answer different questions.
Since K is a sum of six indicators, linearity of expectation gives
\mathbb{E}[K]=6\pi.
With \pi=.25,
\mathbb{E}[K]=1.5.
Under independence, the variance is
\operatorname{Var}(K)=6\pi(1-\pi)=1.125.
The expected value 1.5 is an average across repeated groups of six. One observed group still has an integer count.
The model requires three linked claims.
Repeated positions from one discourse may violate the third claim because switching can cluster. Different syntactic environments may violate the second because they offer different switch constraints.
A binomial model requires both the number of target events and the number of opportunities. Two speakers with 2 switches have different response proportions if one had 6 opportunities and the other had 60.
Retain both K and n. The family models the target count relative to its fixed opportunity count.
The binomial model keeps one target probability across comparable opportunities. The next page considers a finite population whose target probability changes when an object is sampled without replacement.