Tutorials › Introduction to Statistics › Bernoulli Trials and Defining Success

Binomial and Geometric Models · Tutorial 400 of 996

Bernoulli Trials and Defining Success

Learn to define a trial precisely, choose what counts as success, and code each trial with a zero-one indicator.

Intermediate 9 min read

What You'll Learn

  • Define a trial as one clearly specified repetition of a chance process.
  • Distinguish the trial’s full outcome from the event labelled success.
  • Represent success and failure with an indicator that takes values one and zero.
  • Translate a stated success event into probabilities for the indicator.
  • Use a sum of indicators to count successes in a sequence.
  • Recognize that binary coding alone does not establish independence or equal success probabilities.

Why Define Success Before Counting?

A repeated chance process can produce many different kinds of outcomes. A quality inspector might examine parts one at a time; a game might involve repeated turns; a clinic might record whether each patient responds to a treatment. To study how often a particular event occurs, we first need to say exactly what one repetition is and what outcome will count as a success. Only then can we record the repetitions consistently.

The word success does not mean that an outcome is desirable, beneficial, or ethically good. It is simply the name assigned to the event being counted. For example, if the question is how often a device fails, a failure is the success event for that analysis. The event must be stated clearly enough that every possible outcome of a trial can be classified as either success or failure.

Definition: A trial is one specified repetition of a chance process, with its outcome recorded according to a stated rule. A success event is the event of interest for that trial; a trial is called a success if its outcome belongs to that event and a failure otherwise. The indicator variable for success is \(I\), defined by \(I=1\) when success occurs and \(I=0\) when it does not.

A trial may have many possible outcomes even though its indicator has only two possible values. If a die is rolled and a success is defined as “the result is at least 5,” the die’s outcome is still one of six numbers, but the indicator records only whether the result belongs to \(\{5,6\}\). The indicator keeps the information needed to answer the success-counting question while setting aside other details.

From an Outcome to a Zero-One Indicator

Let \(A\) denote the chosen success event for one trial, and let \(X\) denote the trial’s full outcome. The indicator can be written \(I=1\) if \(X\) belongs to \(A\), and \(I=0\) if \(X\) does not belong to \(A\). Thus, the success event and the indicator are related but not identical: \(A\) describes a set of possible outcomes, whereas \(I\) is the numerical variable used to code whether the observed outcome is in that set.

If the probability of success on a particular trial is \(p\), then the indicator’s two probabilities follow directly from the coding rule. The event \(I=1\) is exactly the success event, and \(I=0\) is its complement. Since those two events cover every possibility and cannot occur together, their probabilities add to one.

$$ P(I=1)=p,\qquad P(I=0)=1-p $$

A random variable coded this way is called a Bernoulli random variable with success probability \(p\). A single Bernoulli trial therefore has a binary indicator: it takes the value one with probability \(p\) and zero with probability \(1-p\). The particular outcomes that receive the label one depend on the question; the probability model describes how likely that event is.

Worked Example: Defining Success for a Coin Toss

Suppose a fair coin is tossed once. For the question “Does the coin land heads?”, define a success as heads and let \(I\) be the indicator for success. Find the indicator values for both possible outcomes and their probabilities.

The trial is one toss. Its full outcome is either heads or tails, and the success event is \(A=\{\text{heads}\}\). Thus the coding rule is \(I=1\) for heads and \(I=0\) for tails.

A fair coin assigns probability \(1/2\) to each outcome. Therefore,

$$ P(I=1)=P(\text{heads})=\frac{1}{2}=0.5,\qquad P(I=0)=P(\text{tails})=\frac{1}{2}=0.5 $$

The indicator records whether heads occurred, not which side of the coin is more valuable. If the question instead asked whether the toss landed tails, the success event would change, and so would the coding: tails would receive one and heads would receive zero. The coin toss itself would be unchanged.

Choosing the Success Event Carefully

The definition of success should match the question being asked. Before coding a process, specify three things: what counts as one trial, what outcomes the trial can produce, and which of those outcomes belong to the success event. If any of these is vague, different people may code the same observed outcome differently.

The success event does not need to consist of a single outcome. It can include several outcomes or be described by a condition. For example, for a single roll of a fair six-sided die, define success as rolling at least 5. The outcome space is \(\{1,2,3,4,5,6\}\), and the success event is \(\{5,6\}\). The indicator is one for outcomes 5 and 6, and zero for 1, 2, 3, and 4.

Worked Example: A Success Event With More Than One Outcome

A fair six-sided die is rolled once. Define success as rolling a number greater than 4. Write the indicator rule and calculate the probability of each indicator value.

The trial is one die roll, with six equally likely outcomes. The success event is \(\{5,6\}\), so \(I=1\) for either of those results and \(I=0\) for \(\{1,2,3,4\}\).

There are two success outcomes out of six, so

$$ P(I=1)=\frac{2}{6}=\frac{1}{3}\approx 0.3333 $$

There are four failure outcomes out of six, giving

$$ P(I=0)=\frac{4}{6}=\frac{2}{3}\approx 0.6667 $$

As a check, the two probabilities sum to one: \(1/3+2/3=1\). The indicator does not distinguish a 5 from a 6 because that distinction is irrelevant to the stated success event.

In applications, a success rule often needs operational detail. “A patient improves” may be too vague unless improvement is defined, for example, as a specified reduction on a symptom scale by a specified date. Likewise, “a shipment is late” requires a reference delivery time. The rule should be set before outcomes are classified, not adjusted after seeing which classification produces a preferred result.

Indicators in a Sequence of Trials

For a process repeated \(n\) times, let \(I_i\) indicate success on trial \(i\), for \(i=1,\ldots,n\). Each indicator takes the value one for a success on its own trial and zero for a failure. The individual indicators make it possible to represent the whole sequence numerically without losing track of which trial each result came from.

The number of successes in the sequence is the sum of the indicators. This works because adding one for every success and zero for every failure leaves a total equal to the number of successes. The fact is purely about the coding; it does not require that the trials have the same success probability or be independent.

Key result: If \(I_i=1\) when trial \(i\) is a success and \(I_i=0\) otherwise, then the observed number of successes in \(n\) trials is \(I_1+I_2+\cdots+I_n\).

To verify this, suppose the sequence contains \(k\) successes. Exactly \(k\) of its indicators equal one, and the other \(n-k\) equal zero. Their sum is therefore

$$ \sum_{i=1}^{n} I_i = \underbrace{1+\cdots+1}_{k\text{ terms}} + \underbrace{0+\cdots+0}_{n-k\text{ terms}} =k. $$

This representation is useful because a question about a count can be built from clearly defined trial-level records. However, writing the indicators does not by itself establish a probability model for their joint behavior. In particular, binary coding alone does not imply that the trials are independent or that they share a common success probability.

Worked Example: Counting Responses Across Several Trials

In a hypothetical demonstration, a sensor is checked once on each of six test cycles. Define success as “the sensor gives an alert during the cycle.” The recorded outcomes are: no alert, alert, alert, no alert, no alert, alert. Code the trials with indicators and find the total number of successes.

The trial is one complete test cycle, and the success event is an alert during that cycle. In order, the indicator values are

$$ (I_1,I_2,I_3,I_4,I_5,I_6)=(0,1,1,0,0,1). $$

Summing the indicators gives

$$ \sum_{i=1}^{6} I_i=0+1+1+0+0+1=3. $$

Thus, three of the six cycles were successes under the stated definition. This is a count of the observed alerts, not a probability estimate unless a probability-estimation method and its assumptions are specified. The coding also says nothing about whether alerts on different cycles are independent.

Why the Trial Boundary Matters

A repeated process is only well-defined when “one trial” has a consistent meaning. If one observer treats a trial as one patient and another treats it as one clinic visit, their indicators may refer to different units and the resulting success counts will not answer the same question. A trial should be the unit at which one outcome is recorded under a consistent rule.

Some processes have natural trial boundaries, such as one coin toss or one die roll. Others require an explicit time window or event boundary. For instance, when counting whether a machine alarm occurs, “one trial” might mean one operating shift, one production batch, or one hour of operation. These choices can lead to different definitions of success and different records, so the context must identify the unit.

In a sequence, the indicator \(I_i\) refers to trial \(i\), but the trial labels do not guarantee identical conditions. If the chance of success changes across trials, one may have different probabilities for different \(I_i\). If one outcome affects a later outcome, the indicators may be dependent. Those features matter when choosing a model for the entire sequence, but they do not change the basic zero-one definition.

Common Mistakes and a Practical Check

  • Treating “success” as a value judgment. A failure can be the success event when the investigation counts failures. The label means “event counted,” not “good outcome.”
  • Confusing the full outcome with the indicator. A die outcome of 6 is not the indicator; if success means “at least 5,” the indicator for a 6 is 1. The outcome retains detail that the indicator deliberately compresses.
  • Assuming success must be one particular outcome. An event can contain several outcomes, such as rolling 5 or 6. State the whole event or a precise rule that identifies it.
  • Assuming coding creates independence or equal probabilities. Assigning zeros and ones is a way to record outcomes. It does not change how the chance process behaves.
  • Leaving the trial unit unclear. Define what constitutes one repetition before counting; otherwise, different records may not be comparable.

A useful final check is to ask whether every possible outcome of one trial receives exactly one code. Outcomes in the success event get a one; all other outcomes get a zero. If some outcome is unclassified or could receive both codes, the success rule needs clarification.

Check Your Understanding

Use the definitions and coding rules in this tutorial to answer the following questions.

  1. A fair six-sided die is rolled once, and success is defined as rolling an even number. State the trial, the success event, and the indicator value for each possible die result.
  2. A device is checked once per operating shift. “Success” is defined as at least one alarm in a shift. If a shift has no alarm, what is the indicator value, and why?
  3. Explain why a success event can contain more than one possible outcome of a trial.
  4. For indicators \((1,0,1,1,0)\), calculate the observed number of successes and explain why summing indicators gives that count.
  5. Does recording each trial with zero and one establish that the trials are independent and have the same success probability? Explain.