Probability of a full house
A full house occurs when three of the dice are of one denomination, and the remaining two dice are of another denomination. In other words, it consists of a "set of three" and "a pair." An example is {2,2,2,5,5}.
Let's calculate the probability of a "full house" in a single roll of the five dice.
This is a part of the course
“Probability Puzzles in R”
Exercise instructions
- Calculate the overall number of denominations possible for the set of three and the pair together.
- Calculate the number of ways to form the groups; that is, which dice are in the set of three and which are in the pair.
- Combine the previous two quantities to determine the number of possible full houses.
- Calculate the probability of obtaining a full house, and then print it.
Hands-on interactive exercise
Have a go at this exercise by completing this sample code.
s_space <- 6^5
# Calculate the number of denominations possible
n_denom <- ___
# Calculate the number of ways to form the groups
n_groupings <- ___
# Calculate the total number of full houses
n_full_house <- ___
# Calculate and print the answer
p_full_house <- ___
print(p_full_house)
This exercise is part of the course
Probability Puzzles in R
Learn strategies for answering probability questions in R by solving a variety of probability puzzles.
In this chapter, we explore games in which dice are rolled, including Yahtzee, Settlers of Catan, and Craps. You will learn tools such as using built-in R functions to calculate combinatorics, and using functions such as replicate and the %in% operator.
Exercise 1: YahtzeeExercise 2: Probability of a YahtzeeExercise 3: Probability of a large straightExercise 4: Probability of a full houseExercise 5: Settlers of CatanExercise 6: Simulate one gameExercise 7: Simulate 10000 gamesExercise 8: CrapsExercise 9: Function to keep rolling when point is establishedExercise 10: Function to run one roundExercise 11: Probability of winning the pass line betWhat is DataCamp?
Learn the data skills you need online at your own pace—from non-coding essentials to data science and machine learning.