Candyland is one of my most unfavorite games in the world. You do nothing but follow orders. Literally no decisions are made after deciding which of the characters you choose. Maybe it teaches colors and obedience. I don’t know, but I play it frequently. While I don’t enjoy the game itself, I do enjoy the people I spend it with. Your job is to run a simulation to solve a few questions I’ve always had:
1) If you were playing Candyland by yourself and you simulated this 1,000 times, what is the average number of turns it will take until the game finally ends? How do you know this?
2) If you were playing Candyland by yourself and you simulated this 1,000 times, what is the longest number of turns any of those games took? How do you know this and is it a serious outlier or is it pretty close to the other games? Show your results.
3) If you were playing Candyland by yourself and you simulated this 1,000 times, what is the shortest number of turns any of those games took? How do you know this and is it a serious outlier or is it pretty close to the other games? Show your results.
4) Create a histogram showing the distribution of how long a game of Candyland takes. Provide a VARIETY of summary statistics about this distribution. Comment on the key attributes of the distribution and summary statistics.
5) If four people are playing together, what is the average length of the game (in number of ROUNDS, as in everyone gets a turn)? If each TURN takes 25 seconds and I’m playing with my wife and two daughters, how long is this game going to take?
Submission: You will submit a Word document with an explanation of each of the answers above. You will also submit a clear, concise, well-commented, and well-structured R file supporting each one Upload both together in your final submission.
Grading:
- Correct answers: 10 points.
– Presentation of information in Word document: 4 points.
– Code is commented clearly: 2 points.
– Code is clean: 4 points. (Structured, efficient, easy to follow)
Hints:
– I will bring in the game to help you visualize all of the steps. We will be using the version of the game with a spinner rather than cards. This simplifies the calculation for a randomized turn. I have also attached a picture of it below.
– If you can solve one question, the others take nearly no time at all (mean, max, min).
– DO NOT worry about coding individual colors. That is the wrong path to pursue.
– Every spot on the board could simply be translated into a number. If you make it to the final number or beyond, the game is over and you can record which turn you’re on.
– If you look closely there is an anomalous color on the board …. How do we deal with this?
– You DO need to worry about the random events moving you to a specific location on the board. (Please save me princess lolly and ice cream lady!) These fundamentally are associated with a certain number space on the board (see above). How are you going to spin the wheel? This stackoverflow page may help:
https://stackoverflow.com/questions/33015000/generate-random-number-with-given-probability (Links to an external site.)
– Functions can shorten this task considerably, but I leave the form up to you.
Pictures: