1. Learn
  2. /
  3. Courses
  4. /
  5. Probability Puzzles in R

Exercise

Simulate 10000 games

Now, let's simulate 10000 games and answer the following: since 2 and 12 are equally unlikely, how often does either a 2 or a 12 get rolled more than twice within a game?

Basic strategy indicates that the spaces with 2 or 12 should be avoided because they are the least probable, and although this is true theoretically, here we will investigate how surprising it really should be if they end up coming up more frequently than expected. The roll_dice function from previous exercises has been preloaded for you.

Instructions

100 XP
  • Use the replicate function to roll two dice 60 times.
  • Use a compound condition to check whether either a 2 or 12 was rolled more than twice.
  • Print your estimated probability of rolling a 2 or 12 more than twice within a game.