Description Usage Arguments Details Value Examples
View source: R/monty-hall-problem.R
This function will help to demonstrate which is the best strategy, "stay" or "switch"
1 |
This |
function will allocate variables to store the game setup (create game), a variable to store the initial pick, another one to store the opened doors, another one to save the final pick, another one for the outcome (stay or switch), another variable to save the "strategy", and another for the outcome. |
The function will utilize all the previous functions, to create the game, to select the first door, to the host open one door, to the contestant to decides to stay or choose another door. The contestant option will be saved in a variable, also if the contestant's final choice, their strategy, the opened doors numbers and the game outcome.
The function will display the game setup (cars and goats order), the initial selection, the opened doors, the final door selection and the results of the game "WIN" or "LOSE".
1 | play_game( )
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.