Description Usage Arguments Details Value Examples
View source: R/monty-hall-problem.R
play_n_games()
simulates the game by n rounds/ default at 100 and
generates the strategy table with the probability of stay or switch to
the respective chance on win or lose.
1 | play_n_games(n = 100)
|
n |
numeric vectors, length 1, default at 100 |
The function will create a list to document the game result with a loop by n rounds, append each additional game result to the list according to the index position. and transform the list into a table with row proportions rounded to the second decimal digits.
The function returns a 2 by 2 data frame indicating the probability of win or lose for stay and switch strategies.
1 |
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.