In class this week, we will work on simulating the game of Yahtzee. In the game of Yahtzee, five dice are tossed, and various combinations of numbers, similar to poker hands, are assigned point values. In the game, dice can be selected and re-tossed, but we will focus on calculating the probabilities for the first toss only. We will also deal only with the "lower half" of the score card in the game. For the interested student, continuing this project to account for the complete rules of play would be an entertaining challenge. Anyone not familiar with Yahtzee should try a web search for the rules of the game. Some sites have applets that let you play online. All you really need to know for this lesson, though, is which combinations are counted. We will call these "hands," as the combinations in poker are called. The hands in Yahtzee are: Three of a Kind (three of one number and two others that are different) Full House (three of one number and two of another number) Four of a Kind (four of one number and one other) Yahtzee (five of the same number) Small Straight (four consecutive numbers) Large Straight (five consecutive numbers) Chance (anything that does not fit the above patterns) We begin by simulating dice rolls. For example we can simulate one roll of a die to be: library(tidyverse)roll <- sample(1:6, size=1, replace=T)roll Given this information, please answer the following question attached using R. Show the R code.
In class this week, we will work on simulating the game of Yahtzee. In the game of Yahtzee, five dice are tossed, and various combinations of numbers, similar to poker hands, are assigned point values. In the game, dice can be selected and re-tossed, but we will focus on calculating the probabilities for the first toss only. We will also deal only with the "lower half" of the score card in the game. For the interested student, continuing this project to account for the complete rules of play would be an entertaining challenge.
Anyone not familiar with Yahtzee should try a web search for the rules of the game. Some sites have applets that let you play online.
All you really need to know for this lesson, though, is which combinations are counted. We will call these "hands," as the combinations in poker are called. The hands in Yahtzee are:
- Three of a Kind (three of one number and two others that are different)
- Full House (three of one number and two of another number)
- Four of a Kind (four of one number and one other)
- Yahtzee (five of the same number)
- Small Straight (four consecutive numbers)
- Large Straight (five consecutive numbers)
- Chance (anything that does not fit the above patterns)
We begin by simulating dice rolls. For example we can simulate one roll of a die to be:
Trending now
This is a popular solution!
Step by step
Solved in 2 steps