In a game of Machi Koro, I had the Sushi Bar (active) while my opponent had a Wheat Field and Bakery with no low-roll buildings available. I want to know how long they have to roll before they can afford the Train Station.
That is, they're engaged in a Markov chain where the state space is "0 to 4 coins" ($\{0, 1, 2, 3, 4\}$) and I want to know the probability, for each $n$, that they reach $4$ for the first time after exactly $n$ transitions (preferably for all starting states, but just for zero is interesting enough). I might also be interested in the cumulative version: for each $n$, what's the likelihood that they'll have reached $4$ at least once after $n$ transitions.
The transition probabilities are as follows: from $k$ coins, $k < 4$: to $1$ with probability $1/6$; otherwise, to $k$ with probability $3/6$ and to $k+1$ with probability $2/6$. Since the transitions from $4$ to anything are not interesting, I'll just define them arbitrarily as $4$ to $4$ with probability $1$ (really they'll spend all their coins, but the questions don't care what happens after $4$ is reached).
Spelled out:
$ \left[ \begin{matrix} 3/6 & 3/6 & & & \\ & 4/6 & 2/6 & & \\ & 1/6 & 3/6 & 2/6 & \\ & 1/6 & & 3/6 & 2/6 \\ & & & & 1 \end{matrix} \right] $
(The probability in row $i$ column $j$ is the probability of transition from $i$ to $j$ coins in a single step.)
Some analysis: in the transition graph, there are strongly connected components $\{0\}, \{1, 2, 3\}$ and $\{4\}$ with transitions $0 \rightarrow 1$ and $3 \rightarrow 4$. Maybe it helps to analyse each scc separately. You go from zero coins to one in $k$ steps, $k > 0$, with probability $2^{-k}$; the big one essentially boils down to "how soon will you increment your state three times in a row (each w. prob. $2/6$) without falling back to $1$ (w. p. $1/6$ each step)". I'm not sure how to analyze this, though.
I could probably spell my way through https://en.wikipedia.org/wiki/Markov_chain but given that my matrix-fu is a little rusty, some hand-holding would be appreciated.
Edit: Come to think of it, given the City Hall the transition from $0$ is to $1$ with probability $1$. The 50/50-out-of-0 would occur if I had three Cafés instead of the Sushi Bar and we were playing without the Harbor expansion. Feel free to analyze either—or both! Also, for purposes of simplifying the math, in both cases I'm ignoring the fact that my opponent earns a coin whenever I roll a 1.
A bit of simulation can say something about the shape of the distribution. See below for the full simulation code.
Based on 100,000 games, the quartile (lower) boundaries are at 8, 12 and 20; that is, in fewer than 25% of games four coins are reached by turn 8 or earlier, and in more than 25% of games four coins are reached by turn 9 (or earlier).
The decile (lower) boundaries are 5, 7, 8, 10, 12, 14, 18, 22, 29.
Based on a slightly simplistic simulation of two competing strategies which focus on the Convenience Store and Cheese Factory, respectively, the median and mode game length are between 25 and 30 (in 1000 games), ranging from 20 to 60, falling off quickly from 40 and beyond.
The cumulative likelihood of reaching 4 for the first time by turn $n$, starting with 0 coins, is given below, up to 50%. Note that it can't be done before turn 4. The right tail goes towards 100% as $n$ goes to infinity, of course; it crosses 99% in turns 54-55, 99.9% in turns 79-80 and 99.99 in turns 108-109.
$ \begin{array}{r|r} \textrm{turn} & \textrm{cumul. prob.} \\ \hline 4 & 1.825\% \\ 5 & 5.787\% \\ 6 & 11.450\% \\ 7 & 17.811\% \\ 8 & 24.228\% \\ 9 & 30.599\% \\ 10 & 36.591\% \\ 11 & 42.104\% \\ 12 & 47.358\% \\ 13 & 52.032\% \\ \end{array} $
Here's the simulation code:
Have fun running your own simulations. An analytical answer, and an explanation of the techniques for finding it, will still be much appreciated :-)