# Bernoulli trial

__: Any experiment with two possible random outcomes__

**Short description**Part of a series on statistics |

Probability theory |
---|

In the theory of probability and statistics, a **Bernoulli trial** (or **binomial trial**) is a random experiment with exactly two possible outcomes, "success" and "failure", in which the probability of success is the same every time the experiment is conducted.^{[1]} It is named after Jacob Bernoulli, a 17th-century Swiss mathematician, who analyzed them in his *Ars Conjectandi* (1713).^{[2]}

The mathematical formalisation of the Bernoulli trial is known as the Bernoulli process. This article offers an elementary introduction to the concept, whereas the article on the Bernoulli process offers a more advanced treatment.

Since a Bernoulli trial has only two possible outcomes, it can be framed as some "yes or no" question. For example:

- Is the top card of a shuffled deck an ace?
- Was the newborn child a girl? (See human sex ratio.)

Therefore, success and failure are merely labels for the two outcomes, and should not be construed literally. The term "success" in this sense consists in the result meeting specified conditions, not in any moral judgement. More generally, given any probability space, for any event (set of outcomes), one can define a Bernoulli trial, corresponding to whether the event occurred or not (event or complementary event). Examples of Bernoulli trials include:

- Flipping a coin. In this context, obverse ("heads") conventionally denotes success and reverse ("tails") denotes failure. A fair coin has the probability of success 0.5 by definition. In this case there are exactly two possible outcomes.
- Rolling a die, where a six is "success" and everything else a "failure". In this case there are six possible outcomes, and the event is a six; the complementary event "not a six" corresponds to the other five possible outcomes.
- In conducting a political opinion poll, choosing a voter at random to ascertain whether that voter will vote "yes" in an upcoming referendum.

## Definition

Independent repeated trials of an experiment with exactly two possible outcomes are called Bernoulli trials. Call one of the outcomes "success" and the other outcome "failure". Let [math]\displaystyle{ p }[/math] be the probability of success in a Bernoulli trial, and [math]\displaystyle{ q }[/math] be the probability of failure. Then the probability of success and the probability of failure sum to one, since these are complementary events: "success" and "failure" are mutually exclusive and exhaustive. Thus one has the following relations:

- [math]\displaystyle{ p = 1 - q, \quad \quad q = 1 - p, \quad \quad p + q = 1. }[/math]

Alternatively, these can be stated in terms of odds: given probability *p* of success and *q* of failure, the *odds for* are [math]\displaystyle{ p:q }[/math] and the *odds against* are [math]\displaystyle{ q:p. }[/math] These can also be expressed as numbers, by dividing, yielding the odds for, [math]\displaystyle{ o_f }[/math], and the odds against, [math]\displaystyle{ o_a: }[/math],

- [math]\displaystyle{ \begin{align} o_f &= p/q = p/(1-p) = (1-q)/q\\ o_a &= q/p = (1-p)/p = q/(1-q) \end{align} }[/math]

These are multiplicative inverses, so they multiply to 1, with the following relations:

- [math]\displaystyle{ o_f = 1/o_a, \quad o_a = 1/o_f, \quad o_f \cdot o_a = 1. }[/math]

In the case that a Bernoulli trial is representing an event from finitely many equally likely outcomes, where *S* of the outcomes are success and *F* of the outcomes are failure, the odds for are [math]\displaystyle{ S:F }[/math] and the odds against are [math]\displaystyle{ F:S. }[/math] This yields the following formulas for probability and odds:

- [math]\displaystyle{ \begin{align} p &= S/(S+F)\\ q &= F/(S+F)\\ o_f &= S/F\\ o_a &= F/S \end{align} }[/math]

Note that here the odds are computed by dividing the number of outcomes, not the probabilities, but the proportion is the same, since these ratios only differ by multiplying both terms by the same constant factor.

Random variables describing Bernoulli trials are often encoded using the convention that 1 = "success", 0 = "failure".

Closely related to a Bernoulli trial is a binomial experiment, which consists of a fixed number [math]\displaystyle{ n }[/math] of statistically independent Bernoulli trials, each with a probability of success [math]\displaystyle{ p }[/math], and counts the number of successes. A random variable corresponding to a binomial experiment is denoted by [math]\displaystyle{ B(n,p) }[/math], and is said to have a *binomial distribution*.
The probability of exactly [math]\displaystyle{ k }[/math] successes in the experiment [math]\displaystyle{ B(n,p) }[/math] is given by:

- [math]\displaystyle{ P(k)={n \choose k} p^k q^{n-k} }[/math]

where [math]\displaystyle{ {n \choose k} }[/math] is a binomial coefficient.

Bernoulli trials may also lead to negative binomial distributions (which count the number of successes in a series of repeated Bernoulli trials until a specified number of failures are seen), as well as various other distributions.

When multiple Bernoulli trials are performed, each with its own probability of success, these are sometimes referred to as Poisson trials.^{[3]}

## Example: tossing coins

Consider the simple experiment where a fair coin is tossed four times. Find the probability that exactly two of the tosses result in heads.

### Solution

For this experiment, let a heads be defined as a *success* and a tails as a *failure.* Because the coin is assumed to be fair, the probability of success is [math]\displaystyle{ p = \tfrac{1}{2} }[/math]. Thus the probability of failure, [math]\displaystyle{ q }[/math], is given by

- [math]\displaystyle{ q = 1 - p = 1 - \tfrac{1}{2} = \tfrac{1}{2} }[/math].

Using the equation above, the probability of exactly two tosses out of four total tosses resulting in a heads is given by:

- [math]\displaystyle{ \begin{align} P(2) &= {4 \choose 2} p^{2} q^{4-2} \\ &= 6 \times \left(\tfrac{1}{2}\right)^2 \times \left(\tfrac{1}{2}\right)^2 \\ &= \dfrac {3}{8}. \end{align} }[/math]

## See also

- Bernoulli scheme
- Bernoulli sampling
- Bernoulli distribution
- Binomial distribution
- Binomial coefficient
- Binomial proportion confidence interval
- Poisson sampling
- Sampling design
- Coin flipping
- Jacob Bernoulli
- Fisher's exact test
- Boschloo's test

## References

- ↑ Papoulis, A. (1984). "Probability, Random Variables, and Stochastic Processes".
*Probability, Random Variables, and Stochastic Processes*(2nd ed.). New York: McGraw-Hill. pp. 57–63. - ↑ James Victor Uspensky:
*Introduction to Mathematical Probability*, McGraw-Hill, New York 1937, page 45 - ↑ Rajeev Motwani and P. Raghavan. Randomized Algorithms. Cambridge University Press, New York (NY), 1995, p.67-68

## External links

- Hazewinkel, Michiel, ed. (2001), "Bernoulli trials",
*Encyclopedia of Mathematics*, Springer Science+Business Media B.V. / Kluwer Academic Publishers, ISBN 978-1-55608-010-4, https://www.encyclopediaofmath.org/index.php?title=p/b015690 - "Simulation of n Bernoulli trials". math.uah.edu. http://www.math.uah.edu/stat/applets/BinomialTimelineExperiment.html.

Original source: https://en.wikipedia.org/wiki/ Bernoulli trial.
Read more |