Bernoulli, Uniform and Binomial Random Variables
In questa pagina 4
Examples of r.v.'s with finite alphabet .
1. Bernoulli
We say that the r.v. is Bernoulli if its alphabet is and the density is A Bernoulli r.v. can be used to model a coin-tossing experiment.
Keep in mind that although a Bernoulli r.v. is specified by and , this does not mean that there exists only one such r.v. For example the -th bit of an -bit bitstream can be modelled with a Bernoulli r.v. for all . When we talk about a Bernoulli r.v. we are actually talking about a family of r.v.'s, all with and .
Notation. denotes that belongs to the Bernoulli family with parameter . To be even more precise, there are infinitely many families of Bernoulli r.v.'s, one for each value of .
Example (a Bernoulli r.v. where the map is given; as already mentioned this is not the typical way of assigning a Bernoulli, but sometimes it is possible). For let The indicator function of the event is a Bernoulli r.v. since ; moreover , therefore the parameter is .
Beware of the Bernoulli. It looks like a meek r.v. but in reality everything can be built with enough Bernoullis!
2. Uniform (discrete)
A family of r.v.'s with finite alphabet and Notation. with specified.
3. Binomial
A family of r.v.'s depending on two parameters. We write to mean that with density It should be clear what a r.v. can model: can represent the number of successes (bits ) in a sequence of trials where
- each trial can take only two values , where represents success;
- is constant for ;
- is an independent family.
In practice it might be impossible to verify that the family is independent. In that case the binomial r.v. is still used if the physical conditions of the binomial model are satisfied (identical repeatable trials, two outcomes, trials not influencing each other, constant ); see Applications of IndependenceIndependence simplifies computations of probabilities of unions and of 'exactly one' events, and it is the tool to construct the equiprobable and the binomial probability measures on the space of n-bit sequences.Applications of Independence →.
This matches the binomial measure on : with (the number of 1s), .
Graphs of the density
The page sketches the stem plots of the discrete density:
- : two stems, of heights at and at .
- : , , .
- ( even, ): a single central peak at , symmetric.
- ( odd, ): two equal central stems at and , symmetric.
- with : the mass is concentrated on small values of (peak near the left, long tail to the right).
- with : the mirror picture, with the mass concentrated near .
The page invites the reader to interpret the behaviour of the graphs when varies over (as grows the bulk of the mass moves from towards ).
When is the binomial r.v. applicable?
Example. For each of the following set-ups, specify whether the binomial random variable is applicable.
(a) Throw 1000 times a fair coin and let = "number of heads observed". Assuming that the tosses do not influence each other, it is reasonable to assume .
(b) Throw a fair coin until Heads shows up for the first time. Let = "number of trials until Heads shows up for the first time". Here is a number of trials, not a number of successful trials: is not binomial (see Geometric Random VariableThe geometric random variable counts the trial at which the first success occurs in independent binary trials; it has infinite alphabet, density (1-p)^(k-1) p, mean 1/p and the memoryless property.Geometric Random Variable →).
(c) 7 out of the 30 smoke detectors in this building are faulty. I select 5 detectors at random from the 30 and test them. Let be the number of faulty detectors among the 5 tested. There are 5 trials, each with two possible outcomes (working / faulty), and yet cannot be modelled as a binomial. Indeed, when we select the 5 detectors randomly out of the 30 the selection process is equivalent to drawings from an urn without replacement. The probability that the -th detector selected is faulty is for , as is well known, but the events ("-th detector faulty") are not independent, as proved before. The binomial model does not apply.
(d) On the table there are 5 urns numbered 1 to 5. Urn has red balls and black balls. 5 balls are extracted, the first from urn 1, the second from urn 2, etc. Let = number of red balls extracted. Here is not binomial, because the probability of extracting a red ball is for , which is not constant.
(e) On the table there are two urns, with red balls and black balls and with red balls and black balls. At each trial a fair coin is tossed. If it shows Heads one ball is extracted from and then replaced; if the coin shows Tails a ball is extracted from and then replaced. Following this procedure 5 balls are extracted. Let be the number of red balls among the 5. In this case can be described by a binomial, , where Indeed is constant for the 5 extractions since there is replacement (and the coin is tossed afresh each time).
(f) Same set-up as in (e), but this time the fair coin is tossed once at the beginning of the procedure. If the outcome is Heads the 5 balls are extracted independently of each other from , if the outcome is Tails the 5 balls are extracted from . The r.v. = "number of red balls in the 5 extractions" is not binomial. What can be said is that and by the law of total probability (with ) This is clearly not a binomial density but a convex combination of two binomials.
(g) Let us analyse (c) again more closely. 7 out of 30 smoke detectors are faulty; 5 are selected without replacement out of the 30. Let = number of faulty detectors among the 5. The density of is (choose the faulty ones among the 7 and the working ones among the other 13, over all choices of 5 out of 30): This is called the hypergeometric density.
Remark. If in the urn there are 30 000 smoke detectors of which 7000 are faulty and 5 are selected without replacement, then = number of faulty detectors among the chosen 5 is very well approximated by . Indeed, for example, using for large and small,
See Expected ValueThe expected value E(X) is the sum of the values of a discrete random variable weighted by their probabilities; it is linear, lies between the smallest and the largest value, and equals the barycenter of the density.Expected Value → for and Distribution FunctionThe distribution function F_X(x) = P(X <= x) is an alternative to the discrete density; for a discrete random variable it is a right-continuous non-decreasing step function whose jumps are the values of the density.Distribution Function → for the DF of .
Versione ripasso
- Bernoulli : , , . A family, not a single r.v. (every bit of a bitstream is one). The indicator is Bernoulli with .
- Uniform : , .
- Binomial : , . It counts successes in trials with two outcomes, constant , independent. : mass near 0; : mass near ; : symmetric ( even one peak, odd two equal central stems). : .
- Applicability checks: number of trials until the first success is not binomial (geometric); sampling without replacement (events not independent) is not binomial; varying (urn has red probability ) is not binomial; with replacement and fresh coin each trial it is with ; a single coin toss before all draws gives a convex combination of two binomials, not a binomial.
- Hypergeometric: 7 faulty of 30, 5 drawn without replacement: . For a huge urn (30 000 detectors, 7000 faulty) it is well approximated by since .
- Typical mistake: using the binomial whenever there are "5 trials with two outcomes", ignoring dependence or non-constant .