Geometric and Negative Binomial
We now introduce two more famous discrete distributions, the Geometric and Negative Binomial, and calculate their expected values.
Story: Geometric Distribution
Consider a sequence of independent Bernoulli trials, each with the same success probability , with trials performed until a success occurs. Let be the number of failures before the first successful trial. Then has the Geometric distribution with parameter ; we denote this by .
For example, if we flip a fair coin until it lands Heads for the first time, then the number of Tails before the first occurrence of Heads is distributed as . To get the Geometric PMF from the story, imagine the Bernoulli trials as a string of 0's (failures) ending in a single 1 (success). Each 0 has probability and the final 1 has probability , so a string of failures followed by one success has probability .
Theorem: Geometric PMF
If , then the PMF of is
for where .
This is a valid PMF because
Just as the binomial theorem shows that the Binomial PMF is valid, a geometric series shows that the Geometric PMF is valid!
Warning
There are differing conventions for the definition of the Geometric distribution; some sources define the Geometric as the total number of trials, including the success. In our convention, the Geometric distribution excludes the success, and the First Success distribution includes the success.
Definition: First Success Distribution
In a sequence of independent Bernoulli trials with success probability , let be the number of trials until the first successful trial, including the success. Then has the First Success distribution with parameter ; we denote this by .
It is easy to convert back and forth between the two but important to be careful about which convention is being used. By definition, if then , and we can convert between the PMFs of and by writing . Conversely, if , then .
Example Geometric Expectation
Example First Success Expectation
Story: Negative Binomial Distribution
In a sequence of independent Bernoulli trials with success probability , if is the number of failures before the th success, then is said to have the Negative Binomial distribution with parameters and , denoted . Both the Binomial and the Negative Binomial distributions are based on independent Bernoulli trials; they differ in the stopping rule and in what they are counting: the Binomial counts the number of successes in a fixed number of trials, while the Negative Binomial counts the number of failures until a fixed number of successes.
Theorem: Negative Binomial PMF
If , then the PMF of is
for where .
Proof:
Just as a Binomial r.v. can be represented as a sum of i.i.d. Bernoullis, a Negative Binomial r.v. can be represented as a sum of i.i.d. Geometrics.
Theorem
Let , viewed as the number of failures before the th success in a sequence of independent Bernoulli trials with success probability . Then we can write where the are i.i.d.
Proof:
Example Negative Binomial Expectation
Example Coupon collector
Suppose there are types of toys, which you are collecting one by one, with the goal of getting a complete set. When collecting toys, the toy types are random (as is sometimes the case, for example, with toys included in cereal boxes or included with kids' meals from a fast food restaurant). Assume that each time you collect a toy, it is equally likely to be any of the types. What is the expected number of toys needed until you have a complete set?
Solution: Let be the number of toys needed; we want to find . Our strategy will be to break up into a sum of simpler r.v.s so that we can apply linearity. So write
where is the number of toys until the first toy type you haven't seen before (which is always 1, as the first toy is always a new type), is the additional number of toys until the second toy type you haven't seen before, and so forth. The following figure illustrates these definitions with toy types.
Warning
Expectation is linear, but in general we do not have for arbitrary functions . We must be careful not to move the around when is not linear. The next example shows a situation in which is very different from .
Example St. Petersburg paradox
Suppose a wealthy stranger offers to play the following game with you. You will flip a fair coin until it lands Heads for the first time, and you will receive 4 if the game lasts for 2 rounds, $8 if the game lasts for 3 rounds, and in general, if the game lasts for rounds. What is the fair value of this game (the expected payoff)? How much would you be willing to pay to play this game once?
Solution: