open_goat_door: Host opens Goat Door

Description Usage Arguments Details Value Examples

View source: R/monty-hall-problem (4).R

Description

open_goat_door( game, a.pick ) generates a selection made from the host, will always open a door containing a goat behind it. This selection cannot be the door the contestant initially selected.

Usage

1
open_goat_door(game, a.pick)

Arguments

...

If the contestant selected car, randomly select one of the two goats, if contestant selected goat, select other door containing a goat.

Details

When the host opens a door revealing a goat, it cannot be a door the contestant selected, nor can it be the door containing the car. If the contestant selected the car in his/her initial selection, the host can open either of the other doors containing goats.

Value

The function returns a length 3 character vector indicating a number between 1 and 3, that will indicate the door opened by the host revealing a goat.

Examples

1
  open_goat_door( game, a.pick )

bbeltran2395/montyhall documentation built on Dec. 19, 2021, 6:46 a.m.