Chocolates and jelly beans
A machine drops candies one after another. After a chocolate, the next candy is a jelly bean with probability and a chocolate otherwise. After a jelly bean, the next candy is a chocolate with probability and a jelly bean otherwise.
In the long run, what fraction of the candies are jelly beans?
Fractions, decimals with at least 3 significant digits, and expressions such as sqrt(2)/2, e^-1 or pi/4.
This is a Markov chain with two states. Find its stationary distribution.
In the long run, switches from chocolate to jelly bean happen as often as switches back.
h
s Shown after a correct answer. Revealing it first marks the problem as seen, not solved.
Idea. In the long run, the flow from chocolates to jelly beans must balance the flow back. That one equation gives the stationary distribution of a two-state chain.
Step 1: balance. Let and be the long-run fractions of chocolates and jelly beans. Switches from chocolate to jelly bean happen at rate , and back at rate . These must be equal:
Step 2: solve. With :
So of the candies are jelly beans.
In general. For a two-state chain that leaves state A with probability and state B with probability , the long-run fraction of time in B is .