Description Usage Arguments Details Value Examples
View source: R/monty-hall-problem.R
The game continue with adding more code to allow the contestant the option of selecting another door that is still closed with a change door function.
1 | change_door(stay = T, opened.door, a.pick)
|
The |
change_door function calls upon the arguments stay, opened.door and a.pick. The door function takes in the logical vectors 1-3. If statements evaluate the stay argument and assigns the output to function final.pick. |
The contestant is given the option to change from their initial selection to the other door that is still closed. The function will represent the game-playing strategy as the argument stay=TRUE or stay=FALSE.
The return would be a logical vector, an integer, between 1 and 3.
1 2 3 | 1
2
3
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.