4

Suppose I take a deck of cards and remove all the cards with numbered ranks and only keep the jack, queen, king and ace cards (of the four ‘suits’ clubs, diamonds, hearts and spades). Starting with the four jacks, I play a random swapping game, where in each round I select one of the four cards in my hands uniformly at random, and replace it by one of the three other cards of the same suit, each with probability $\dfrac13$, i.e., a club can only be traded for another club, a spade can only be traded for another spade, etc, etc. Thus at any point in time you’ll have exactly one card of each of the four suits in your hands.

I want to determine the expected number of 'random swaps' until I will have $4$ Jacks in my hands again. I tried to see whether I could make a transition probability matrix but my intuition already told me that before I would start that there would be too many states. I don't know how I should approach this question without such a matrix then.

Ѕᴀᴀᴅ
  • 35,369
TK99
  • 427

1 Answers1

3

I think we can make a transition matrix with only $5$ states. The $5$ states will be $0, 1, 2, 3, 4$; each corresponds to the number of Jacks we have in our hand.

$$ \begin{array}{c c} & \begin{array}{c c c} 0 \ & 1 \ & 2 \ & 3 \ & 4 \ \\ \end{array} \\ \begin{array}{c c c}0\\1\\2\\3\\4 \end{array} & \left[ \begin{array}{c c c} \frac 23 & \frac 13 & 0 & 0 & 0 \\ \frac 14 & \frac 12 & \frac 14 & 0 & 0\\ 0 & \frac 12 & \frac 13 & \frac 16 & 0 \\ 0 & 0 & \frac 34 & \frac 16 & \frac 1{12} \\ 0 & 0 & 0 & 1 & 0 \end{array} \right] \end{array} $$

Please check my work on those transition probabilities. From here, we're going to do what's known as 'first-step analysis'. Let's define $\mu_i = \mathsf E[\text {number of steps to reach state $4$ | we are in state $i$}]$. Then we are looking for $1+\mu_3$ because when we start with $4$ Jacks, we play $1$ swap and move down to state $3$ with probability $1$. Then we want to know the expected number of swaps we have to play to get back to state $4$. Let $p_{ij}$ be the transition probability from $i$ to $j$ and the consider the following:

$$\mathsf E[\text{number of steps to reah state $4$ | we are in state $3$}] = 1 + \mathsf{E}[\text{number of steps to reach state $4$ | we are in state 2}]p_{32} + \mathsf{E}[\text{number of steps to reach state $4$ | we are in state 3}]p_{33} + \mathsf{E}[\text{number of steps to reach state $4$ | we are in state 4}]p_{34}$$

This is by the Law of Total Expectation, and the $+1$ is because we did $1$ swap to move states.

$$\therefore \mu_3 = 1 + \mu_2 p_{32} + \mu_3 p_{33} + \mu_4 p_{34}$$

Note $\mu_4 = 0$. By similar reasoning, we can design this system of equations:

$$ \mu_0 = 1 + \frac23 \mu_0 + \frac13 \mu_1 \\ \mu_1 = 1 + \frac14 \mu_0 + \frac12 \mu_1 + \frac14 \mu_2 \\ \mu_2 = 1 + \frac12 \mu_1 + \frac13 \mu_2 + \frac16 \mu_3 \\ \mu_3 = 1 + \frac34 \mu_2 + \frac16 \mu_3 + \frac1{12} \mu_4 \\ \mu_4 = 0 $$

When I plug this system into Wolfram Alpha, it gives me $\mu_3 = 255.$ Since we are looking for $1 + \mu_3$, our answer is 256.$

jeremy909
  • 1,048
  • In the first row of the matrix, I think the two non-zero entries should be swapped. – C_M May 13 '20 at 15:35
  • Good point @C_M , will change now – jeremy909 May 13 '20 at 15:40
  • An equivalent approach is to convert this process to an absorbing Markov chain by “splitting” state 4 and then using the standard $(I-Q)^{-1}\mathbf 1$ formula to compute expected time to absorption. – amd May 13 '20 at 21:18
  • @amd you should post that as an answer, I don't know it – jeremy909 May 14 '20 at 04:21