open_goat_door: Host opens a goat door.

Description Usage Arguments Details Value Examples

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

Description

'open_goat_door()' selects one of the doors the contestant did not pick.

Usage

1
open_goat_door(game, a.pick)

Arguments

...

no arguments are used by the function.

Details

If the contestant selected a "car" door, the function randomly selects one of the two remaining doors. Both of these are "goat" doors. If the contestant selected a "goat" door, the function selects the single remaining "goat" door. The "car" door cannot be selected.

Value

The function returns a numeric vector (1, 2, or, 3) that is different from the one returned by 'select_door()' (a.pick). The return is saved as 'opened.door'.

Examples

1
  open_goat_door( game, a.pick)

ekmcintyre/montyhall documentation built on Feb. 1, 2021, 12:24 a.m.