Tutorials › Statistical Theory I - Probability and Distribution Theory › The Bernoulli Distribution and Its Support

Bernoulli and Binomial Families · Tutorial 100 of 994

The Bernoulli Distribution and Its Support

Learn to identify a Bernoulli distribution, describe its support precisely, and calculate probabilities of events from its mass function.

Beginner 9 min read

What You'll Learn

  • State the parameter range and probability mass function of a Bernoulli random variable.
  • Distinguish the two-outcome state space from the support when the parameter is at a boundary.
  • Calculate probabilities of events involving one or both Bernoulli outcomes.
  • Derive the Bernoulli cumulative distribution function from its mass function.
  • Recognize when a binary-outcome model is not Bernoulli with the proposed parameter.

Introduction

Many statistical questions begin with an outcome that has two possibilities: a patient does or does not have a condition, a part is or is not defective, or a response is or is not positive. The Bernoulli distribution is the basic probability model for one such binary outcome. Its single parameter specifies the probability assigned to one of the outcomes.

For calculations, a Bernoulli random variable takes the numerical values 0 and 1. The mass at each value determines the probability of every event involving the variable. Care is needed with the word support: the possible values are contained in \(\{0,1\}\), but if the parameter is 0 or 1, only one value has positive probability.

Definition and Probability Mass Function

Definition: A random variable \(X\) has a Bernoulli distribution with parameter \(p\), written \(X\sim\operatorname{Bernoulli}(p)\), if \(0\leq p\leq 1\) and its probability mass function is $$ f(x)=P(X=x)= \begin{cases} 1-p, & x=0,\\ p, & x=1,\\ 0, & x\notin\{0,1\}. \end{cases} $$ The values 0 and 1 form the two-outcome state space; \(p\) is the probability assigned to the value 1.

The restrictions on \(p\) ensure that both listed masses are nonnegative. They also sum to one: \(f(0)+f(1)=(1-p)+p=1\). Thus the formula assigns all probability to the two stated outcomes and defines a probability distribution. When \(0<p<1\), both outcomes have positive probability. At \(p=0\), \(X=0\) with probability one; at \(p=1\), \(X=1\) with probability one.

Definition: For a discrete random variable, its probability-mass support is the set of values having positive probability. For \(X\sim\operatorname{Bernoulli}(p)\), this support is \(\{0,1\}\) if \(0<p<1\), \(\{0\}\) if \(p=0\), and \(\{1\}\) if \(p=1\). The state space \(\{0,1\}\) describes the two values allowed by the model, even when a boundary parameter makes one value have probability zero.

This distinction is useful whenever a parameter is allowed to reach a boundary. Saying the state space is \(\{0,1\}\) does not imply that both values must have positive probability. The support, in the probability-mass sense defined above, includes exactly the values with positive mass.

Calculating Event Probabilities

An event involving \(X\) is a condition that \(X\) may or may not satisfy. Since \(X\) can only equal 0 or 1, an event's probability is found by adding the masses of whichever of those two values satisfy the condition. This gives a simple rule that applies to any subset \(A\) of the real line.

Theorem: If \(X\sim\operatorname{Bernoulli}(p)\) and \(A\subseteq\mathbb{R}\), then $$ P(X\in A)=(1-p)\mathbf{1}_{\{0\in A\}}+p\mathbf{1}_{\{1\in A\}}, $$ where \(\mathbf{1}_{\{c\in A\}}\) is 1 when \(c\in A\) and 0 otherwise.

Proof. The event \(\{X\in A\}\) occurs exactly when \(X=0\) and \(0\in A\), or when \(X=1\) and \(1\in A\). These two cases are disjoint because \(X\) cannot equal 0 and 1 at the same time. If \(0\in A\), the first case contributes \(P(X=0)=1-p\); otherwise it contributes zero. Likewise, the second case contributes \(p\) if \(1\in A\) and zero otherwise. Adding the contributions gives the formula. \(\square\)

For example, the event \(X=1\) has probability \(p\), and its complement \(X=0\) has probability \(1-p\). If an event includes both 0 and 1, its probability is 1; if it includes neither, its probability is 0. For an interval, check which of 0 and 1 it contains rather than treating the variable as continuous.

Worked Example: A Positive Test Result

Suppose a randomly selected patient has a positive test result with probability \(p=0.08\). Let \(X=1\) denote a positive result and \(X=0\) a negative result. Find \(P(X=1)\), \(P(X=0)\), and \(P(0.5<X\leq 1)\).

The mass function gives \(P(X=1)=p=0.08\). For the negative result, $$ P(X=0)=1-p=1-0.08=0.92. $$

The condition \(0.5<X\leq1\) is satisfied by \(X=1\), but not by \(X=0\). Therefore, $$ P(0.5<X\leq1)=P(X=1)=0.08. $$ The interval does not receive probability according to its length; it receives the mass of the Bernoulli outcome it contains.

Worked Example: An Event Containing Both Outcomes

Let \(X\sim\operatorname{Bernoulli}(0.6)\). Calculate \(P(X\in\{0,1\})\), \(P(X\notin\{1\})\), and \(P(X\in[0.2,0.9])\).

The first event contains both possible values, so $$ P(X\in\{0,1\})=P(X=0)+P(X=1)=0.4+0.6=1. $$

The event \(X\notin\{1\}\) excludes 1 and includes 0. Hence $$ P(X\notin\{1\})=P(X=0)=1-0.6=0.4. $$

The interval \([0.2,0.9]\) contains neither 0 nor 1. Thus $$ P(X\in[0.2,0.9])=0. $$ Its being an interval of positive length does not matter: the variable has no probability mass at any point strictly between 0 and 1.

The mass function also determines the cumulative distribution function \(F(x)=P(X\leq x)\). Its value changes only when \(x\) reaches one of the outcomes.

Theorem: For \(X\sim\operatorname{Bernoulli}(p)\), the cumulative distribution function is $$ F(x)= \begin{cases} 0, & x<0,\\ 1-p, & 0\leq x<1,\\ 1, & x\geq1. \end{cases} $$

Proof. If \(x<0\), neither 0 nor 1 is at most \(x\), so \(P(X\leq x)=0\). If \(0\leq x<1\), the only possible value at most \(x\) is 0, giving \(P(X\leq x)=P(X=0)=1-p\). If \(x\geq1\), both possible values are at most \(x\), and their probabilities sum to \((1-p)+p=1\). These cases include the boundary values \(x=0\) and \(x=1\) in the appropriate pieces, so the formula holds for every real \(x\). \(\square\)

Worked Example: A Defective Part

A manufactured part is defective with probability \(0.025\). Let \(X=1\) if a randomly selected part is defective and \(X=0\) otherwise. Find the probabilities that the part is not defective, that \(X\leq0\), and that \(X>0.7\).

Here \(p=0.025\), so the mass at 0 is $$ P(X=0)=1-0.025=0.975. $$ This is the probability the part is not defective.

The event \(X\leq0\) contains the value 0 but not 1, so $$ P(X\leq0)=P(X=0)=0.975. $$ The event \(X>0.7\) contains 1 but not 0, so $$ P(X>0.7)=P(X=1)=0.025. $$ As a check, \(P(X\leq0)+P(X>0.7)=0.975+0.025=1\); here the two events partition the possible outcomes.

Boundary Cases and Model Checks

At \(p=0\), the mass function assigns \(f(0)=1\) and \(f(1)=0\). At \(p=1\), it assigns \(f(0)=0\) and \(f(1)=1\). Both are valid Bernoulli distributions, though each is degenerate: the outcome is fixed with probability one. When \(0<p<1\), the distribution is nondegenerate and both outcomes occur with positive probability.

To check whether a proposed model is Bernoulli, verify that the random variable takes values only in \(\{0,1\}\) and that \(P(X=1)=p\) for some \(p\in[0,1]\). The remaining probability must then be \(P(X=0)=1-p\). A binary outcome alone does not justify a particular value of \(p\); that probability must come from the model or information about the setting.

Common Mistakes

  • Calling \(\{0,1\}\) the positive-mass support at a boundary. At \(p=0\), the support is \(\{0\}\); at \(p=1\), it is \(\{1\}\). The set \(\{0,1\}\) remains the state space.
  • Assigning probability by interval length. A Bernoulli variable is discrete. For example, \(P(0.2\leq X\leq0.9)=0\), because this interval contains neither possible value.
  • Using \(p\) for both outcomes. By definition, \(p=P(X=1)\), while \(P(X=0)=1-p\). The two probabilities add to one.
  • Ignoring a zero mass at a boundary. The formula still includes the value with zero probability, but events containing only that value have probability zero.
Key takeaway: A Bernoulli distribution places mass \(1-p\) at 0 and mass \(p\) at 1, with \(0\leq p\leq1\). To find the probability of any event, identify which of those values it contains and add their masses; the positive-mass support shrinks to a singleton when \(p\) is a boundary value.

Check Your Understanding

For each question, use the Bernoulli mass function and identify which of 0 and 1 satisfy the event.

  1. If \(X\sim\operatorname{Bernoulli}(0.3)\), find \(P(X=0)\) and \(P(0<X\leq1)\).
  2. What are the state space and positive-mass support when \(X\sim\operatorname{Bernoulli}(1)\)?
  3. For \(X\sim\operatorname{Bernoulli}(0.4)\), calculate \(P(X\in[-1,0.5])\).
  4. Write the cumulative distribution function for \(X\sim\operatorname{Bernoulli}(p)\) on the three ranges \(x<0\), \(0\leq x<1\), and \(x\geq1\).
  5. A proposed model assigns \(P(X=0)=0.2\), \(P(X=1)=0.7\), and no probability to other values. Can these probabilities define a Bernoulli distribution? Explain using the requirement that total probability is one.