Many questions about a random experiment have a yes or no answer. Does this package need a manual label check? Does the lamp pass its test? Recording yes as and no as turns the answer into a random variable that takes only the values and , and a single probability then describes its whole distribution. This lesson builds that distribution, derives its mean and variance, and separates what it says about one trial from what it leaves open about several.
Key terms
Bernoulli trial and success
Definition A Bernoulli trial is one run of a random experiment together with one event whose occurrence is recorded. The event is called success and its complement is called failure. Coding success as and failure as gives the indicator , which equals on outcomes in and on all other outcomes. Many texts use the plural phrase “Bernoulli trials” only for independent trials with a common success probability. Independence and a common success probability are extra assumptions about the whole sequence, and they do not follow from each trial having two recorded results.
In plain words Success is a name for the event you chose to record, not a judgment. A defect, a delay or a failed test can be the success if that is the event being counted. The experiment itself may have many outcomes, as long as each one is sorted into the event or its complement.
Example Roll a fair die and call a six a success. The die has six outcomes, but the trial records only whether occurred, so with probability . For a package on a sorting line, the success can be the event that it needs a manual label check, even though nobody hopes for that. Now draw two tokens without replacement from a bag with marked tokens among , and record a marked token as success. Each draw is a Bernoulli trial with success probability before anything is seen, yet after a marked first draw the second is marked with probability . The two trials are dependent.
Bernoulli distribution
Definition Let . A random variable has the Bernoulli distribution with parameter , written , if its PMF has
and for every other . The two masses are nonnegative and add to for every in , so this is a valid distribution. Every indicator is Bernoulli with parameter . Some books write the PMF as for , which relies on the convention when is or .
In plain words A Bernoulli variable is a yes or no answer written as a number. Its whole distribution is fixed by one probability, the chance of a . Questions about are answered by translating the event into the values and .
Example Let if a package needs a manual check and otherwise, with in this constructed model. Then and . The event holds only at the value , so , while because no possible value exceeds .
Parameter of a distribution
Definition A parameter is a number, or a list of numbers, that selects one distribution from a family described by a common formula. The set of allowed values is the parameter space. The Bernoulli family has one parameter with parameter space , and each value of gives exactly one PMF. If , the reversed coding satisfies , because it exchanges the two masses.
In plain words The family gives the formula, and the parameter fills in what the formula leaves open, which for the Bernoulli family is the one number . The parameter belongs to the model. The fraction of checked packages in one batch is an observed frequency, and it can differ from . Different trials can belong to the same family with different parameters.
Example For the package model, . The indicator of no manual check is , which equals exactly when , so . A fragile label type with a higher check probability, say , is described by another member of the same family, and treating both label types as one trial type with a single would misdescribe them.
Mean and variance of a Bernoulli variable
Definition If , then
Because and , the variable satisfies , so and
The standard deviation is . For an indicator these give and .
In plain words The mean of a variable that is or is the probability of a . It is an average over the model, and when it is not a value the variable can take. Squaring a or a changes nothing, so the second moment equals the mean, and subtracting the squared mean leaves .
Example For the package indicator with , the mean is . No package receives of a check. Each package gives or , and is the probability-weighted average of those values. The variance is
and . If ordinary processing costs units and a manual check adds more, the cost is , and linearity gives the expected cost units. The table of costs agrees, since .
Degenerate distribution
Definition A random variable has a degenerate distribution if for some constant . Its variance is then , and conversely a variable with variance satisfies . The Bernoulli distributions with and are degenerate, at and at . For both values and have positive probability and .
In plain words A degenerate variable takes one value with probability , so there is nothing left to predict. It is still a valid distribution. At the endpoints it is clearer to read the PMF directly than to evaluate with a in it.
Example In a model where a lamp passes its test with probability , the indicator of failure is . It equals with probability , its mean is and its variance is . The indicator of passing is , with mean and variance .
Maximum Bernoulli variance
Definition For every in ,
with equality exactly when . So a Bernoulli variance is at most , a Bernoulli standard deviation is at most , and both maxima occur only at . The variance takes the same value at and at .
In plain words The result is hardest to predict when and are equally likely. As moves away from toward or , one value dominates and the variance shrinks, reaching at the endpoints. Coding the other event as success replaces by and leaves the variance unchanged.
Example The package indicator with has variance . A lamp indicator with or with has variance , and a fair coin has the largest possible value . No Bernoulli variable has variance , since that exceeds . A variance of does not determine , because both and give it.
Check yourself
- A lamp works on its test with probability . Let if it works and if it fails, and let if it fails and if it works. Give the distributions of and with their means and variances.
Show the answer
The variable is , with mean and variance . The failure indicator is , which is with mean and the same variance . These are two codings of the same test, not two independent observations. Whenever one of them is , the other is .
- Each lamp test costs units, and a failure adds more. Find the expected cost of one test in two ways.
Show the answer
The cost is when the lamp works and when it fails, so the table gives units. The cost can also be written as , and linearity gives units.
- Two packages each need a manual check with probability . Is the probability that both need checks equal to ?
Show the answer
Not necessarily. The product rule holds exactly when the two check indicators are independent, and their Bernoulli laws say nothing about that. Suppose a shared printing fault makes the two packages either both need a check or both pass, with the check happening with probability . Each indicator is still , but the probability that both need checks is , not . In general these two marginal laws allow any value from to for that probability, so the way the packages are linked has to be modeled separately.