Description Usage Arguments Details Value Examples
View source: R/monty-hall-problem.R
This function will be using the play_game() function to simulates and test the game a hundred times. The game will be using a loop to run the function "n" times (n=100 in this came).
1 | play_n_games(n = 100)
|
The |
function will run the game utilizing the function ""loop.count""play_game()", the library (dplyr), the function "for(in)". Some of the variables used in this function are loop.count, results.list, and game.outcome. |
The function will be using a loop that will help to running the game continually up to 100 times to see the different results.
The function will return the outcome of the strategy chosen. How many times a contestant could win if chooses to stay or how may times the contestant could win if chooses to switch?
1 |
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.