I have two urns: A, B. Five balls are distributed between the two urns. Each period, one of the 5 balls is selected at random, and whichever urn it's in, it is moved to the random urn. Determine the transition probability matrix.
I tried to attempt drawing the tree diagram, and I let $X_{n}$ be the number of balls in urn A at time $n$. How could I find the transition probability matrix?
By Law of total probability, let $C$ be the event that randomly chosen ball is from urn $A$, $A$ and $B$ are the events that it will be placed into the urn $A$ or $B$ respectively.
The number of ball stay the same if we choose ball from $A$ and put it to $A$, or take ball from $B$ and put it to $B$: $$ \mathbb P(X_{n+1}=n\mid X_n=n) = \mathbb P(C)\cdot \mathbb P(A\mid C)+\mathbb P(C^c)\cdot \mathbb P(B\mid C^c) = \frac{n}{5}\cdot \frac12+\frac{5 - n}{5}\cdot \frac12 = \frac12 $$ Next, the number of balls in $A$ decreased by $1$ if we take ball from $A$ and put it to $B$: $$ \mathbb P(X_{n+1}=n-1\mid X_n=n) = \mathbb P(C)\cdot \mathbb P(B\mid C) = \frac{n}{5}\cdot \frac12= \frac{n}{10} $$ And the number of balls in $A$ increased by $1$ if we take a ball from $B$ and put it to $A$: $$ \mathbb P(X_{n+1}=n+1\mid X_n=n) = \mathbb P(C^c)\cdot \mathbb P(A\mid C^c) = \frac{5-n}{5}\cdot \frac12= \frac12-\frac{n}{10}. $$