Description Usage Arguments Details Value Examples
View source: R/monty-hall-problem Script.R
change_door(stay=T, opened.door, a.pick)
generate an option for the player
to change his selection or remain on his current selection
1 | change_door(stay = T, opened.door, a.pick)
|
opened.door |
Numeric, opened goat door |
a.pick |
Numeric, Player's initial selection |
Stay= |
T or F, logical |
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
return a number between 1 and 3, depending if the player stay or remain on his selection.
1 2 3 | opened.door <- open_goat_door( game, a.pick )
a.pick <- select_door()
change_door( stay=T, opened.door, a.pick )
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.