Question: Python Game Simulation. Can use scipy.stats, numpy, panda, matplotlib.pyplot [30 points] Problem 1: The Game of Strife Below, and at the link here, you will

Python Game Simulation. Can use scipy.stats, numpy, panda, matplotlib.pyplot

Python Game Simulation. Can use scipy.stats, numpy, panda, matplotlib.pyplot [30 points] Problem

1: The Game of Strife Below, and at the link here, you

will find the board for the Game of Strife, a simplified and

[30 points] Problem 1: The Game of Strife Below, and at the link here, you will find the board for the Game of Strife, a simplified and slightly more depressing version of the Game of Life. Here are some rules Players begin at START and may choose to begin the game by either going to college (moving to the right from START) or starting a career (moving downward from START). Players then move along the game board in order of increasing tile number. lf a player begins by going to college, then they start the game with-$20,000. That is indeed negative money, to account for student loan debt. lf a player begins by starting a career, then they start the game with $5,000- At the beginning of a player's turn, they roll a fair 6-sided die, the outcome of which determines how many tiles they move forward. .When a player reaches a red square (tiles 9, 17 or 30), they must stop at that square for the rest of their turn, even if they would not have landed on the red square. - When a player stops on the CAREER tile after college (square 9), they are randomly assigned a career and salary from the possibilities: 50,000,70,000, 90,000, 110,000, or $130,000 (all with equal probability). The player's actual career Is irrelevant to the game, but please make something up so you are emotionally Invested in the game. lf a player starts a career at the beginning of the game, they are assigned a salary randomly from possibilities 40,000, 50,000 60,000, 70,000, or $80,000 When a player stops on the HOUSE tile, they put a down payment on a house. This down payment is drawn randomly from the set 25,000,40,000, 55,000or 70,000 - When a player stops on the RETIRE tile, the player collects a pension equal to half their salary and then the game ends immediately. When a player lands on or passes a PAYDAY square, they earn money equal to their salary. When a player lands on a STRIFE square (1, 4, 7, 13, 18, 23 or 29 If they go to college, or 2, 7, 13, 18, 23 or 29 If they start a career Immediately at the beginning of the game), they draw a STRIFE card. The . STRIFE cards have the player earn 5,000or 10,000, or lose 1,000,2,000 or $5,000. . Players can have negative money, which corresponds to being in debt. College? START STRIFE STRIFE STRIFE 2 5 4 Career? CAREER STRIFE PAYDAY STRIFE PAYDAY 3 5 10 STRIFE HOUSE PAYDAY STRIFE 20 19 15 14 12 18 16 13 21 STRIFE PAYDAY STRIFE RETIRE 24 25 26 28 23 27 29 30 Part A: Write code to simulate an entire game of the Game of Strife (with only one player). You may not have two separate routines for simulating the game, or a turn, depending on whether a player goes to college or starts a career at the beginning; both possibilities should be accounted for within your one set of codes Then run two ensembles of at least 10,000 games, one where the player starts by going to college, the other where the player starts a career immediately. Plot density histograms of the players' ending distributions of money on the same set of axes. Be sure to label your axes, include a legend and make your histogranm box faces slightly transparent, so both sets of data are visible [30 points] Problem 1: The Game of Strife Below, and at the link here, you will find the board for the Game of Strife, a simplified and slightly more depressing version of the Game of Life. Here are some rules Players begin at START and may choose to begin the game by either going to college (moving to the right from START) or starting a career (moving downward from START). Players then move along the game board in order of increasing tile number. lf a player begins by going to college, then they start the game with-$20,000. That is indeed negative money, to account for student loan debt. lf a player begins by starting a career, then they start the game with $5,000- At the beginning of a player's turn, they roll a fair 6-sided die, the outcome of which determines how many tiles they move forward. .When a player reaches a red square (tiles 9, 17 or 30), they must stop at that square for the rest of their turn, even if they would not have landed on the red square. - When a player stops on the CAREER tile after college (square 9), they are randomly assigned a career and salary from the possibilities: 50,000,70,000, 90,000, 110,000, or $130,000 (all with equal probability). The player's actual career Is irrelevant to the game, but please make something up so you are emotionally Invested in the game. lf a player starts a career at the beginning of the game, they are assigned a salary randomly from possibilities 40,000, 50,000 60,000, 70,000, or $80,000 When a player stops on the HOUSE tile, they put a down payment on a house. This down payment is drawn randomly from the set 25,000,40,000, 55,000or 70,000 - When a player stops on the RETIRE tile, the player collects a pension equal to half their salary and then the game ends immediately. When a player lands on or passes a PAYDAY square, they earn money equal to their salary. When a player lands on a STRIFE square (1, 4, 7, 13, 18, 23 or 29 If they go to college, or 2, 7, 13, 18, 23 or 29 If they start a career Immediately at the beginning of the game), they draw a STRIFE card. The . STRIFE cards have the player earn 5,000or 10,000, or lose 1,000,2,000 or $5,000. . Players can have negative money, which corresponds to being in debt. College? START STRIFE STRIFE STRIFE 2 5 4 Career? CAREER STRIFE PAYDAY STRIFE PAYDAY 3 5 10 STRIFE HOUSE PAYDAY STRIFE 20 19 15 14 12 18 16 13 21 STRIFE PAYDAY STRIFE RETIRE 24 25 26 28 23 27 29 30 Part A: Write code to simulate an entire game of the Game of Strife (with only one player). You may not have two separate routines for simulating the game, or a turn, depending on whether a player goes to college or starts a career at the beginning; both possibilities should be accounted for within your one set of codes Then run two ensembles of at least 10,000 games, one where the player starts by going to college, the other where the player starts a career immediately. Plot density histograms of the players' ending distributions of money on the same set of axes. Be sure to label your axes, include a legend and make your histogranm box faces slightly transparent, so both sets of data are visible

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!