open_goat_door: Host Opens Goat Door

Description Usage Arguments Details Value Examples

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

Description

This part of the game setup deals with assigning variables to the door number opened. The variables are two goats and a car.

Usage

1
open_goat_door(game, a.pick)

Arguments

The

open_goat_door function calls upon the arguments game and a.pick. The door function takes in the logical vectors 1-3. If statements evaluate the game and a.pick arguments and assign the output to functions goat.doors and opened.door

Details

In this portion of the game, the host will always open a door with a goat behind it. But it cannot be a door the contestant has already selected. So it must be a door that is not a car and not a current contestant selection.

Note: If the contestant selects the car on the first guess, the host can open either door left remaining. But if the contestant selects a goat, the host only has one option, to open the remaining goat door since the host will always open a goat door.

Value

The return would be a logical vector, an integer, between 1 and 3.

Examples

1
2
3
4
  1
  2
  3
 

scribenaz/montyhall documentation built on Jan. 31, 2021, 12:48 a.m.