Ask Question, Ask an Expert

+61-413 786 465

info@mywordsolution.com

Ask Homework Help/Study Tips Expert

This is a partial monopoly simulation only tracks how many times the player landed on each positions.

I want you to create a simulation of the classic board game, Monopoly.

You will not be simulating the entire game. You will be simulating only the movement of pieces, and will keep track of which squares the pieces land on.

If you have never played Monopoly before, I recommend watching a few videos on the topic.

https://www.youtube.com/watch?v=4Hfe97Q5kul

(https://www.youtube.com/watch?v=4Hfe97Q5kul)

Rules for movement

The Monopoly Board is effectively a circle with 40 spaces on which a player can land. Players move from space to space around the board in a circle (square).

The number of spaces a player moves is determined by the roll of 2 dice. Most often, the player will roll the dice, land on a space, and end his turn there.

There are, however, several exceptions which provide the primary source of variation in space landing:

One space sends players directly to jail. This space never counts as having been "landed upon." As soon as the player lands here, he is immediately sent to jail, and the jail space gets counted as landed upon. This is the only space on the game board that moves a player's piece.

If a player rolls doubles (two of the same number), the player moves his piece, and then gets to roll the dice again for another move. However, if a player rolls doubles three times in a row, he is sent directly to jail. (The third space that the player would have 'landed on' does not count, but the jail space gets counted as landed on.)

Card Decks
A player can land on a "Chance" or "Community Chest" space. When a player lands on these spaces, he draws a card from the respective deck and follows its instructions. The instructions will sometimes give money to or take money from the player with no change in the player's position on the board. Other times, the card will instruct the player to move to another space on the board. The list of cards that can be drawn from each deck is provided below.
There are nine cards in the Chance deck that move the player's token. There are two cards in the Community Chest deck that move the player's token. All other cards do not move the player's token.
A card may say 'move to the nearest railroad' or 'move to the nearest utility' or even 'go to property xxx'. In these cases, the player always moves forward. So if a player is on 'Oriental Avenue,' the nearest railroad is `Pennsylvania Railroad' and NOT 'Reading Railroad.'


The Chance and Community Chest spaces always get counted as "landed on" even if the card drawn moves the player to another space or sends him to jail. In those cases, a tally is counted for the Chance/Community Chest space, the token is moved, and then a tally is counted for the space where the player ends his turn.
Jail
Jail is the most complicated aspect of this simulation.
If a player lands on space 11 (Jail), he is not in Jail. He is 'just visiting.' His play continues on as normal.
A player can be placed in jail in several ways: he can roll doubles three times in a row. He can land on the "go to jail space." He can draw a card that sends hims to jail.
When in jail, the player has the option to pay a fee to 'get out,' or he can choose not to pay the fee. If he pays the fee, he is out of jail, and his play continues normally as before.
If he chooses not to pay the fee, he rolls the dice. If he rolls doubles on the dice, he gets out of jail and move the number of spaces the dice show. However, despite rolling doubles, he does not roll again. He takes his move out of jail and his turn ends. If he does not roll doubles, he stays in jail.
A player cannot stay in jail for more than three turns. On his third turn in jail, he rolls the dice and moves the number of spaces the dice show no matter what. If they are doubles, he moves those spaces for free. If he does not roll doubles, he moves those spaces, but must also pay a fee.


Your Simulation
Your task is to run 2,000 simulations of a game for one player that rolls the dice 100 times. This is a total of 4 hundred thousand dice rolls - 2000 games x 100 rolls x 2 dice.
Your task is to keep track of where the player lands. Advance the tokens around the board according to the rules. Keep in mind the special situations involving the cards, jail, and rolling doubles.
For your convenience, I have created the necessary data frames for the game board, and the two decks of cards.

2016f7/29 Homework
gameboard <- data.frame(space = 1:40, title = c("Go" , "Mediterranean Avenue" , "Community Ches t" , "Baltic Avenue" , "Income Tax" , "Reading Railroad" , "Oriental Avenue" , "Chance" , "Vermo nt Avenue" , "Connecticut Avenue" , "Jail" , "St. Charles Place" , "Electric Company" , "States Avenue" , "Virginia Avenue" , "Pennsylvania Railroad" , "St. James Place" , "Community Chest" , "Tennessee Avenue" , "New York Avenue" , "Free Parking" , "Kentucky Avenue" , "Chance" , "India na Avenue" , "Illinois Avenue" , "B & 0 Railroad" , "Atlantic Avenue" , "Ventnor Avenue" , "Wate r Works" , "Marvin Gardens" , "Go to jail" , "Pacific Avenue" , "North Carolina Avenue" , "Commu nity Chest" , "Pennsylvania Avenue" , "Short Line Railroad" , "Chance" , "Park Place" , "Luxury Tax" , "Boardwalk"))
chancedeck <- data.frame(index = 1:15, card = c("Advance to Go" , "Advance to Illinois Ave." , "Advance to St. Charles Place" , "Advance token to nearest Utility" , "Advance token to the near est Railroad" , "Take a ride on the Reading Railroad" , "Take a walk on the Boardwalk" , "Go to
Jail" , "Go Back 3 Spaces" , "Bank pays you dividend of $50" , "Get out of Jail Free" , "Make g eneral repairs on all your property" , "Pay poor tax of $15" , "You have been elected Chairman o f the Board" , "Your building loan matures"))
communitydeck <- data.frame(index = 1:16, card = c("Advance to Go" , "Go to Jail" , "Bank error in your favor ??? Collect $200" , "Doctor's fees Pay $50" , "From sale of stock you get $45" , "Get Out of Jail Free" , "Grand Opera Night Opening" , "Xmas Fund matures" , "Income tax refund" , "Life insurance matures ??? Collect $100" , "Pay hospital fees of $100" , "Pay school tax of $150" , "Receive for services $25" , "You are assessed for street repairs" , "You have won seco nd prize in a beauty contest" , "You inherit $100"))
You can 'hard code' the functions that handle the decks. In other words, you can write something along the lines of
## for chance deck
if(carddrawn == 1)
code changes player position to space 1 # advance to go
if(carddrawn == 2)
code changes player position to space 25 # advance to Illinois avenue
# etc.
• • •
To get you started, here is a simple function to roll two dice.
## for your convenience. feeL free to modify if you wish. dice <- function(){
faces <- sample(1:6, 2, replace=TRUE)
if(faces[1] == faces[2]) doubles = TRUE
else doubles = FALSE
movement = sum(faces)
return(list(faces=faces, doubles=doubles, movement=movement))

Your final output should be a list of the spaces on the board and how many times the space was landed upon. Arrange the table in descending order of frequency of landing.

You do not have to simulate or track money at all in this simulation.
2016f7/29 Homework

Tips

At first blush, the task may seem overwhelming.

Break the task into smaller manageable parts.

Start with a simulation that moves pieces around the board and keeps track of where they land. Then add complexity one part at a time.

Add something so landing on "Go to jail" sends the player to jail.

Add functions for the Chance and Community Chest decks. Keep in mind that some cards have no effect on player movement, while other cards do.

Add something to allow players to move again after doubles.

Finally implement the Jail. You'll need to keep track of whether the player is actually in jail or not, how many turns the player has been in jail, and the rules for getting out.

Because of the random nature of sampling, I do not expect everyone's results to match perfectly, but some overall trends should appear.

If you are unable to implement all parts of the solution, that is also okay. I cannot give you full credit, but please indicate what you were able to implement and what you were not able to implement. You will be graded on what you were able to complete.

It may or may not be to your advantage to create a reference class for the player, keeping track of the player's position, whether he's in jail, what turn it is in jail, and anything else.

If the player rolls the dice, then he moves to the chance position. He gets a chance card to move again. We should both count the chance position and the second position.

Homework Help/Study Tips, Others

  • Category:- Homework Help/Study Tips
  • Reference No.:- M91906585

Have any Question?


Related Questions in Homework Help/Study Tips

You discover a drug that prevents voltage-gated na channel

You discover a drug that prevents voltage-gated Na+ channel inactivation gates from opening when they are closed but has no effect on inactivation gates when they are open. What would happen to the action potential in a ...

Question you have been given the following specifications

Question: You have been given the following specifications of a simple database for keeping track of exercise sessions and their instructors at a fitness centre (note that primary keys are shown underlined, foreign keys ...

Question using the patient information provided respond to

Question: Using the patient information provided, respond to the following questions: (a) What cultural considerations are important for you to remember while you interview Ms. Li? (b) What is the abuse assessment screen ...

Question eco 204 principles of microeconomicsanalyze the

Question: ECO 204: Principles of Microeconomics Analyze the major barriers for entry and exit into the airline industry. Explain how each barrier can foster either monopoly or oligopoly. What barriers, if any, do you fee ...

Assignment tasks corporate regulationido you own research

ASSIGNMENT TASKS CORPORATE REGULATION (i) Do you own research and critically discuss whether the financial accounting and reporting should be regulated or manager should be allowed to disclose financial accounting inform ...

For all assessments the following general requirements

For all Assessments, the following general requirements hold: (1) Assignments should be 2-3 double-spaced pages, with reasonable (12 pt.) font and reasonable (1 inch) margins. (2) Citations to the material and in-text ci ...

Question communication and team decision makingpart 1

Question: Communication and Team Decision Making Part 1: Sharpening the Team Mind: Communication and Collective Intelligence A. What are some of the possible biases and points of error that may arise in team communicatio ...

Assignment - parchment basementoverviewfor this individual

Assignment - Parchment Basement Overview For this individual assignment, you will use skills acquired through practical laboratory exercises to automate a business process, and to visualize the impact of the automation. ...

Question present your assignment in an apa format word

Question: Present your assignment in an APA format, word document, Arial 12 font . A minimum of 2 evidence-based references is required. A minimum of 600 words is required. 1. Identify and discuss the types of disasters. ...

Need one page double spacedreview the fishbein model

Need one page double spaced Review the Fishbein model material before completing this exercise. Choose two competitors for one of your retailers and build a Fishbein model in Excel to evaluate the three entities. For the ...

  • 4,153,160 Questions Asked
  • 13,132 Experts
  • 2,558,936 Questions Answered

Ask Experts for help!!

Looking for Assignment Help?

Start excelling in your Courses, Get help with Assignment

Write us your full requirement for evaluation and you will receive response within 20 minutes turnaround time.

Ask Now Help with Problems, Get a Best Answer

Why might a bank avoid the use of interest rate swaps even

Why might a bank avoid the use of interest rate swaps, even when the institution is exposed to significant interest rate

Describe the difference between zero coupon bonds and

Describe the difference between zero coupon bonds and coupon bonds. Under what conditions will a coupon bond sell at a p

Compute the present value of an annuity of 880 per year

Compute the present value of an annuity of $ 880 per year for 16 years, given a discount rate of 6 percent per annum. As

Compute the present value of an 1150 payment made in ten

Compute the present value of an $1,150 payment made in ten years when the discount rate is 12 percent. (Do not round int

Compute the present value of an annuity of 699 per year

Compute the present value of an annuity of $ 699 per year for 19 years, given a discount rate of 6 percent per annum. As