change_door: Change the door

Description Usage Arguments Details Value Examples

View source: R/monty-hall-problem Script.R

Description

change_door(stay=T, opened.door, a.pick) generate an option for the player to change his selection or remain on his current selection

Usage

1
change_door(stay = T, opened.door, a.pick)

Arguments

opened.door

Numeric, opened goat door

a.pick

Numeric, Player's initial selection

Stay=

T or F, logical

Details

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

Value

return a number between 1 and 3, depending if the player stay or remain on his selection.

Examples

1
2
3
opened.door <- open_goat_door( game, a.pick )
a.pick <- select_door()
change_door( stay=T, opened.door, a.pick )

Rami-Assaad/montyhall documentation built on Dec. 18, 2021, 9:52 a.m.