The Ehrenfest chain models a simple diffusion process as a Markov chain. Suppose that we have two urn with a total of \(m\) balls. The state of the system at any time is the number of balls in urn 1, so that the state space is \(S = \{0, 1, \ldots, m\}\)
In the basic model, a ball is selected at random at each time (so that each ball is equally likely to be chosen), and then moved to the other urn. The transition matrix \(P\) is given by \[ P(x, x - 1) = \frac{x}{m}, \; P(x, x + 1) = \frac{m - x}{m}; \quad x \in S \] In the modified model, a ball is chosen at random and an urn is chosen at random. Then the chosen ball is put in the chosen urn. The transition matrix \(Q\) is given by \[ Q(x, x - 1) = \frac{x}{2 \, m}, \; Q(x, x) = \frac{1}{2}, \; Q(x, x + 1) = \frac{m - x}{2 \, m}; \quad x \in S \] The top graph shows the state space, with the current state colored red and the initial state colored blue. As the process runs, the chain moves from state to state. The time and the sate are recorded at each update in the data table. The limiting distribution and the proportion of time that the chain is in each state are shown in the distribution graph and the distirbution table. The limiting distribution is binomial with parameters \(m\) and \(1 / 2\).
The number of balls \(m\) and the initial state \(x_0\) can be varied with the input controls; the model can be chosen from the drop-down box.