change_door: Change doors option

Description Usage Arguments Details Value Examples

View source: R/Montyhall.R

Description

The contestant is given the option of changing doors from his first selection and change to the other door that is still closed.

Usage

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

Arguments

The

stay argument is a logical vector, as it contains "True" and "false" value.

Details

The change_door()uses the game-playing strategy of sticking to the contestant's first selection or not by using the arguments stay = True or stay = False. If the contestant decided to stay (i.e. stay = T), the returned result or the final pick will be the contestant's initial selection (a.pick). If the contestant decided not to stay(i.e. stay = F or ! stay), the returned result or the final pick will be the other closed door (i.e the door that was not initially selected by the contestant or the goat door opened by the host)

Value

The function returns a length of one numeric vector indicating the final pick made by the contestant after being offered by the host the option to change doors.

Examples

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

Ma112120/Montyhall documentation built on Dec. 17, 2021, 2:14 a.m.