---
title: "Monopoly"
author: "Prof. Richey and Prof. Wright"
date: "April 19, 2018"
output:
html_document: default
pdf_document: default
---
```{r setup, include=FALSE}
knitr::opts_chunk$set(echo = TRUE)
```
# Monopoly and Markov Chains
Your goal is to recreate the results from "Take a Walk on the Boardwalk" by Abbott and Richey.
In particular, find the steady state probabilities of each of the board positions and color groups.
Try to follow the route described in the paper.
Additional details can be found in the [Monopoly Project document](https://www.mlwright.org/teaching/math242s18/other/monopoly_project.pdf) on the course web page.
A good source of Monopoly information can be found at the [Monopoly Wiki](http://monopoly.wikia.com/wiki/) or at the Monopoly Wikipedia entry.
## Monopoly Game Board
The Monopoly game board consists 40 spaces (states) arranged in a square.
Some of them have special functions that are relevant for our simulation:
* Go: State 1
* Chance: States 8, 23, and 37
* Community Chest: States 3, 28, and 34.
* Jail: State 11
* Utility: States 13 and 29
* Railroads: States 6, 16, 26, and 36
* Go to Jail: State 31
Two dice are rolled to determine each move.
Thus the possible numbers of spaces moved are 2, 3, ..., 12.
## Step 1: Preliminary Frequencies
At the first stage, you will simply create a simple model which extends the work we've done in class. In this case, you need to consider three factors.
* The rolling matrix: You will need to determine the probabilities of obtaining each value that occurs when two dice are rolled.
* Go to Jail matrix: Essentially the same as what have already done.
* Chance and Community Chest cards: These are similar in spirit to what we've already done. You need to account the possibility of making a move due to drawing a card. There are three Chance locations and three Community Chest locations. Each has 16 cards. You can assume each time a card is drawn, the deck has beens shuffled.
For [*Chance*](http://monopoly.wikia.com/wiki/Chance), there are ten cards which move you around:
* Advance to Go
* Go to Jail
* Go to Illinois Avenue
* Go to St. Charles
* Take a walk on the Boardwalk (Go to Boardwalk)
* Go back three spaces
* Go to nearest Utility (depends on which Chance location you are on)
* Go to nearest Railroad (depends on which Chance location you are on) -- there are **two** of these cards
* Go to Reading Railroad
For [*Community Chest*](http://monopoly.wikia.com/wiki/Community_Chest) there are only two cards that move you around:
* Advance to Go
* Go to Jail.
You should be able to reproduce Table 1 with this information.
## Step 2: Stay in jail
Next, you want to work into the analysis the fact that, after the game has been played for a while, a player wants to stay in jail as long as possible. The rules of Monopoly state that one must leave jail after three rolls. The trick to incorporating this feature into the analysis is to add extra Jail states, leading to 42 total states, not 40.
You should be able to reproduce Table 2 with this information.
## Step 3: Doubles
Lastly, you need to include the fact that if a player rolls doubles three times in a row, then the player is sent to jail. This rule is tricky. One way to approximate the effect is to factor into the analysis that three rolls of doubles occurs with probability 1/216.
You should be able to reproduce Table 3 with this information.
## Step 4: Game analysis
One you have have the steady state probabilities, perform a deeper analysis. Take the perspective that you are deep into the game and all the properties have been bought and completely outfitted with houses and hotels.
The basic idea of Monopoly is that you move around the board and land on properites (or other sites). If landed on, properties can be bought if they are available. Otherwise, you pay the owner of the property **rent** based on the amount of developent on the property. For example, the property Marvin Gardens initially costs \$280. If undeveloped, it will earn a rent of \$24 each time another player lands on it. If outfitted with four houses and a hotel, it earns \$1200. It benefits a player to develop each property as much as possible, in this case with four houses and a hotel each costing \$150. Therefore, aside from the initial purchase price, there needs to be an additional \$750 spent on development.
Properties can only be developed if a player owns all the properties in the color group. Hence, by the end of the game, after all the wheeling and dealing is done, each player owns all the properties in single color block. The questions asked in the paper include:
* What are the steady state probabilities for each color group? (just add up the probabilies for all the properties in the group).
* Assuming the group is fully developed, how much does it earn per roll? (Multiply the total rent times the probability).
* If you know how much a property earns per roll, how many rolls does it take to "break even" for the property? (Divide total development cost by earnings per roll).
Data for the Monopoly properties is in the file `MonopolyData.csv`. You can read this into your R session via:
```{r, eval=FALSE}
monopoly.dat<-read.csv("MonopolyData.csv")
```
This assumes the file `MonopolyData.csv` is in the same directory/folder that you are running your R session from. Otherwise, you must adjust the file path.