# Spencer Bliven

## The Statistics of Monopoly

February 22, 2012 | Posted in Math, Tagged , , , ,

American Edition Monopoly board. (Source: wikipedia)

When we were kids, my siblings and I each had our own favorite properties when playing monopoly. My brother always went for the hotel on Boardwalk. My favorite was St. Charles Place. It didn’t cost as much to develop, and I was convinced that people tended to land on St. Charles place a disproportionate amount of the time. I’d be delighted when I managed to purchase St. Charles, and every time someone landed on that square it would reinforce my conviction that St. Charles was the most profitable property in Monopoly.

Armed with a college-level understanding of statistics, I thought I would test my childhood hypothesis that the probability of landing on St. Charles is higher than for other properties. The movement aspect of Monopoly can be modeled as a Markov process, which just means that the probability of landing on a square depends only on what square you were on last term. Let $\mathbf{x}_t$ be a row vector of length 40 giving the probability that a player will land on each square after $t$ rolls. All players start on GO!, so

$\mathbf{x}_t = \left[ 1, 0, 0, \dots, 0\right].$

### Dice Movement

Now define transition probabilities for moving from one square to another. Ignoring things like chance cards, Monopoly uses the sum of two dice to move, so the probability of moving from one square to another is a triangle distribution with a peak 7 squares forward. For instance, the probability of moving to each square if you were previously on GO! is

$\left[ 0, 0, \frac{1}{36}, \frac{2}{36}, \frac{3}{36}, \frac{4}{36}, \frac{5}{36}, \frac{6}{36}, \frac{5}{36}, \frac{4}{36}, \frac{3}{36}, \frac{2}{36}, \frac{1}{36}, 0, 0, \dots \right].$

Here’s some matlab code to generate the full transition matrix. D[i][j] gives the probability of moving from square i to j after rolling the dice.

% Initialize transition matrix for dice movement
D = zeros(40);
D(1,3:13) = [1:6, 5:-1:1]/36;
for i = 2:40,
D(i,:) = circshift(D(i-1,:),[0 1]);
end

We can calculate the probability of being on a particular square after $t$ turns by repeatedly multiplying current state vector by the transition matrix.

$\mathbf{x}_t = \mathbf{x}_{t-1}D = \mathbf{x}_0 D^t$

The probability of landing on each square during the first 50 turns. The board is oriented as above, with GO! in the lower right corner. Pure white indicates a probability of 1, while 50% gray corresponds to a probability of 0.025, which is average for a 40-square board.

Applying this for a few steps, it appears that all squares rapidly become equally probable. But would they eventually all have probability $1/40=.025$? This can be checked by examining the eigenvectors of the transition matrix. The eigenvector corresponding to $\lambda=1$ gives the probabilities of landing on each square after an infinite number of rolls.

%% Find steady state
[V, l] = eigs(A',1,'lm');

xss = V'/sum(V); %x at steady state, eg t->infinity

Running this shows that all the squares do indeed have probability 1/40 at $t=\infty$. So if all movement were determined by dice roll, all spaces would be equally likely to be landed upon.

### Jail and Chance cards

Now lets see what happens when all the detail of Monopoly are included in the model. There are a couple other ways players get moved around:

• The dreaded Go to Jail space
• Community Chest. Most of the 16 community chest cards deal with money, but one sends you to jail.
• Chance. 10 of the 16 chance cards move the player around the board.

This type of movement can be modeled as a second transition matrix, which get applied after each dice roll. Most squares leave the player where they ended up. Landing on ‘Go to Jail’ has a 100% probability of sending you to the jail spot. Community chest has a 1/16 chance of sending you to jail, and a 15/16 chance of remaining on the same spot. The Chance squares are complicated, but we can work out the transition probabilities from Chance squares too.

% Probabilities for non-dice movement.
ND = eye(40);

% Go directly to jail
ND(31,:) = 0; % 'Go to Jail' is square 31
ND(31,11) = 1; \$ 'Jail' is square 11

% Community Chest cards: 16 total
% Cards are assumed to be drawn uniformly at random with replacement.
% 15 Unchanged
chestSquares = [3, 34];
ND(chestSquares,:) = ND(chestSquares,:)*15/16;
% 1 Go directly to Jail
ND(chestSquares,11) = ND(chestSquares,11)+1/16;

% Chance card calculations-download code for details

% A turn consists of a dice roll and then some non-dice movement
A = D*ND;

By including non-dice movement, some squares become much more likely than others. For instance, it is impossible to end a turn on ‘Go to Jail’. Squares such as Railroads are more likely, since players who land on Chance could be sent there.

Probability of ending a turn on each space, including non-dice movement.

Steady state probabilities for each square using the full model. The red line shows the mean probability of 0.025, and a few notable squares are labelled.

RankSquareProbability
1Jail0.0570
2Illinois0.0317
4New York0.0301
6Water Works0.0294
7Communtity Chest0.0289
8Tennessee0.0286
9Free Parking0.0282
10Kentucky0.0278
11St. Charles0.0275

### Conclusion

It turns out that St. Charles Place was not a particularly good space, since the probability of landing there is only 0.0275, slightly above average. I would have been much smarter to try to buy Illinois, which gets landed on significantly more often than average.

So what’s the optimum strategy for playing monopoly? Looking at steady state probabilities of landing on each square gives a hint to this, but doesn’t capture the full complexity of the game. It doesn’t factor in the costs and revenues for each property, nor can it provide advice on trading, selling, or improving properties. Finally, looking at steady state probabilities can be deceiving since the game starts far from steady state. For instance, Vermont Ave has a lower than average chance of being landed on. However, it is almost 50% more likely to be landed on 5 turns after starting from GO! than it would have been if the players began already spread out. Sometimes extra revenue early in the game can translate to a big advantage later on.

Now, who wants to play monopoly?

### Code

Calculating the full transition matrix has a lot of cases, so I didn’t include the code here. If you’re curious, check out the full code from bitbucket. It was tested on both Matlab and the free alternative, Octave. The main script is called ‘MCMonopoly.m’.

## DNA font

February 10, 2012 | Posted in Science,Technology, Tagged , , , , , ,

A short DNA 'word' showing the four bases A, T, C, and G, the 'unknown' base X, and the 'pyrimidine' and 'purine' characters Y and R.

I recently downloaded the Deja-Vu font family and discovered the open-source typography community. I thought it would be fun to try to make a font myself. Since much of my time is spent looking at biological sequences, I thought a way to visualize DNA molecules in a text editor would be cool. The result: DNA Type. DNA only contains a few letters, so I’ve only made 7 characters so far. However, you can use it to write secret messages to your fellow bio-nerds, as long as the messages contain only A, T, G, C, Y, R, and X! The message is read off from the top strand.

Spencer, what’s your favorite instrumental electronic band?
What was the name of that movie which predicted the infringement of human rights based on genetic predisposition, a possibility which seems very plausible in todays high-throughput sequencing world?

DNA is cool, but I’m really more of a protein guy. With a protein font you can make meaningful amino acid glyphs for the whole alphabet. However, polypeptides are usually displayed alternating up and down. I think this is possible with glyph variants, but I need to learn more about the TrueType format and the FontForge program before attempting something so complex.