Description Usage Arguments Details Value Examples
View source: R/monty-hall-problem.R
'play_n_games' plays the Monty Hall game a number of times based on the numerical parameter you pass to it. It then shows the proportional results.
1 | play_n_games(n)
|
'n' |
- This determines the number of times the game is run. |
The function uses a 'for' loop that continues based on the parameter passed into the function. It records each outcome in a results list. When the loop finishes, it creates a table showing the proportional results.
The function returns a results table showing the proportional results of 'n' runs of the game.
1 2 | play_n_games(30)
play_n_games(100)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.